diff --git a/packages/google-cloud-secretmanager/README.md b/packages/google-cloud-secretmanager/README.md index 34149055360..505868f82ac 100644 --- a/packages/google-cloud-secretmanager/README.md +++ b/packages/google-cloud-secretmanager/README.md @@ -77,6 +77,21 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Secret_manager_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.set_iam_policy.js,packages/google-cloud-secretmanager/samples/README.md) | | Secret_manager_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.test_iam_permissions.js,packages/google-cloud-secretmanager/samples/README.md) | | Secret_manager_service.update_secret | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.update_secret.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.update_secret.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.access_secret_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.add_secret_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.create_secret | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.delete_secret | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.destroy_secret_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.disable_secret_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.enable_secret_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.get_secret | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.get_secret_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.list_secret_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.list_secrets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js,packages/google-cloud-secretmanager/samples/README.md) | +| Secret_manager_service.update_secret | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js,packages/google-cloud-secretmanager/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/quickstart.js,packages/google-cloud-secretmanager/samples/README.md) | diff --git a/packages/google-cloud-secretmanager/protos/google/cloud/secretmanager/v1beta2/resources.proto b/packages/google-cloud-secretmanager/protos/google/cloud/secretmanager/v1beta2/resources.proto new file mode 100644 index 00000000000..1df900c7492 --- /dev/null +++ b/packages/google-cloud-secretmanager/protos/google/cloud/secretmanager/v1beta2/resources.proto @@ -0,0 +1,494 @@ +// Copyright 2023 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.secretmanager.v1beta2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.SecretManager.V1Beta2"; +option go_package = "cloud.google.com/go/secretmanager/apiv1beta2/secretmanagerpb;secretmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.secretmanager.v1beta2"; +option objc_class_prefix = "GSM"; +option php_namespace = "Google\\Cloud\\SecretManager\\V1beta2"; +option ruby_package = "Google::Cloud::SecretManager::V1beta2"; + +// A [Secret][google.cloud.secretmanager.v1beta2.Secret] is a logical secret +// whose value and versions can be accessed. +// +// A [Secret][google.cloud.secretmanager.v1beta2.Secret] is made up of zero or +// more [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] that +// represent the secret data. +message Secret { + option (google.api.resource) = { + type: "secretmanager.googleapis.com/Secret" + pattern: "projects/{project}/secrets/{secret}" + pattern: "projects/{project}/locations/{location}/secrets/{secret}" + plural: "secrets" + singular: "secret" + }; + + // Output only. The resource name of the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] in the format + // `projects/*/secrets/*`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. The replication policy of the secret data attached to + // the [Secret][google.cloud.secretmanager.v1beta2.Secret]. + // + // The replication policy cannot be changed after the Secret has been created. + Replication replication = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // Output only. The time at which the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels assigned to this Secret. + // + // Label keys must be between 1 and 63 characters long, have a UTF-8 encoding + // of maximum 128 bytes, and must conform to the following PCRE regular + // expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` + // + // Label values must be between 0 and 63 characters long, have a UTF-8 + // encoding of maximum 128 bytes, and must conform to the following PCRE + // regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` + // + // No more than 64 labels can be assigned to a given resource. + map labels = 4; + + // Optional. A list of up to 10 Pub/Sub topics to which messages are published + // when control plane operations are called on the secret or its versions. + repeated Topic topics = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Expiration policy attached to the + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. If specified the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] and all + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] will be + // automatically deleted at expiration. Expired secrets are irreversibly + // deleted. + // + // Expiration is *not* the recommended way to set time-based permissions. [IAM + // Conditions](https://cloud.google.com/secret-manager/docs/access-control#conditions) + // is recommended for granting time-based permissions because the operation + // can be reversed. + oneof expiration { + // Optional. Timestamp in UTC when the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] is scheduled to + // expire. This is always provided on output, regardless of what was sent on + // input. + google.protobuf.Timestamp expire_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Input only. The TTL for the + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + google.protobuf.Duration ttl = 7 [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Optional. Etag of the currently stored + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Rotation policy attached to the + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. May be excluded if + // there is no rotation policy. + Rotation rotation = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mapping from version alias to version name. + // + // A version alias is a string with a maximum length of 63 characters and can + // contain uppercase and lowercase letters, numerals, and the hyphen (`-`) + // and underscore ('_') characters. An alias string must start with a + // letter and cannot be the string 'latest' or 'NEW'. + // No more than 50 aliases can be assigned to a given secret. + // + // Version-Alias pairs will be viewable via GetSecret and modifiable via + // UpdateSecret. Access by alias is only supported for + // GetSecretVersion and AccessSecretVersion. + map version_aliases = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom metadata about the secret. + // + // Annotations are distinct from various forms of labels. + // Annotations exist to allow client tools to store their own state + // information without requiring a database. + // + // Annotation keys must be between 1 and 63 characters long, have a UTF-8 + // encoding of maximum 128 bytes, begin and end with an alphanumeric character + // ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and + // alphanumerics in between these symbols. + // + // The total size of annotation keys and values must be less than 16KiB. + map annotations = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Secret Version TTL after destruction request + // + // This is a part of the Delayed secret version destroy feature. + // For secret with TTL>0, version destruction doesn't happen immediately + // on calling destroy instead the version goes to a disabled state and + // destruction happens after the TTL expires. + google.protobuf.Duration version_destroy_ttl = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The customer-managed encryption configuration of the Regionalised + // Secrets. If no configuration is provided, Google-managed default encryption + // is used. + // + // Updates to the [Secret][google.cloud.secretmanager.v1beta2.Secret] + // encryption configuration only apply to + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] added + // afterwards. They do not apply retroactively to existing + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. + CustomerManagedEncryption customer_managed_encryption = 15 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A secret version resource in the Secret Manager API. +message SecretVersion { + option (google.api.resource) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{secret_version}" + pattern: "projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}" + plural: "secretVersions" + singular: "secretVersion" + }; + + // The state of a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion], + // indicating if it can be accessed. + enum State { + // Not specified. This value is unused and invalid. + STATE_UNSPECIFIED = 0; + + // The [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] may + // be accessed. + ENABLED = 1; + + // The [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] may + // not be accessed, but the secret data is still available and can be placed + // back into the + // [ENABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.ENABLED] + // state. + DISABLED = 2; + + // The [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] is + // destroyed and the secret data is no longer stored. A version may not + // leave this state once entered. + DESTROYED = 3; + } + + // Output only. The resource name of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] in the + // format `projects/*/secrets/*/versions/*`. + // + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] IDs in a + // [Secret][google.cloud.secretmanager.v1beta2.Secret] start at 1 and are + // incremented for each subsequent version of the secret. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] was + // created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] was + // destroyed. Only present if + // [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] is + // [DESTROYED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DESTROYED]. + google.protobuf.Timestamp destroy_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The replication status of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + ReplicationStatus replication_status = 5; + + // Output only. Etag of the currently stored + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + string etag = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if payload checksum specified in + // [SecretPayload][google.cloud.secretmanager.v1beta2.SecretPayload] object + // has been received by + // [SecretManagerService][google.cloud.secretmanager.v1beta2.SecretManagerService] + // on + // [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion]. + bool client_specified_payload_checksum = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. Scheduled destroy time for secret version. + // This is a part of the Delayed secret version destroy feature. For a + // Secret with a valid version destroy TTL, when a secert version is + // destroyed, version is moved to disabled state and it is scheduled for + // destruction Version is destroyed only after the scheduled_destroy_time. + google.protobuf.Timestamp scheduled_destroy_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The customer-managed encryption status of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. Only + // populated if customer-managed encryption is used and + // [Secret][google.cloud.secretmanager.v1beta2.Secret] is a Regionalised + // Secret. + CustomerManagedEncryptionStatus customer_managed_encryption = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A policy that defines the replication and encryption configuration of data. +message Replication { + // A replication policy that replicates the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] payload without any + // restrictions. + message Automatic { + // Optional. The customer-managed encryption configuration of the + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. If no configuration + // is provided, Google-managed default encryption is used. + // + // Updates to the [Secret][google.cloud.secretmanager.v1beta2.Secret] + // encryption configuration only apply to + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] added + // afterwards. They do not apply retroactively to existing + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. + CustomerManagedEncryption customer_managed_encryption = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // A replication policy that replicates the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] payload into the + // locations specified in [Secret.replication.user_managed.replicas][] + message UserManaged { + // Represents a Replica for this + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + message Replica { + // The canonical IDs of the location to replicate data. + // For example: `"us-east1"`. + string location = 1; + + // Optional. The customer-managed encryption configuration of the + // [User-Managed Replica][Replication.UserManaged.Replica]. If no + // configuration is provided, Google-managed default encryption is used. + // + // Updates to the [Secret][google.cloud.secretmanager.v1beta2.Secret] + // encryption configuration only apply to + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] + // added afterwards. They do not apply retroactively to existing + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. + CustomerManagedEncryption customer_managed_encryption = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The list of Replicas for this + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + // + // Cannot be empty. + repeated Replica replicas = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The replication policy for this secret. + oneof replication { + // The [Secret][google.cloud.secretmanager.v1beta2.Secret] will + // automatically be replicated without any restrictions. + Automatic automatic = 1; + + // The [Secret][google.cloud.secretmanager.v1beta2.Secret] will only be + // replicated into the locations specified. + UserManaged user_managed = 2; + } +} + +// Configuration for encrypting secret payloads using customer-managed +// encryption keys (CMEK). +message CustomerManagedEncryption { + // Required. The resource name of the Cloud KMS CryptoKey used to encrypt + // secret payloads. + // + // For secrets using the + // [UserManaged][google.cloud.secretmanager.v1beta2.Replication.UserManaged] + // replication policy type, Cloud KMS CryptoKeys must reside in the same + // location as the [replica location][Secret.UserManaged.Replica.location]. + // + // For secrets using the + // [Automatic][google.cloud.secretmanager.v1beta2.Replication.Automatic] + // replication policy type, Cloud KMS CryptoKeys must reside in `global`. + // + // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The replication status of a +// [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. +message ReplicationStatus { + // The replication status of a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] using + // automatic replication. + // + // Only populated if the parent + // [Secret][google.cloud.secretmanager.v1beta2.Secret] has an automatic + // replication policy. + message AutomaticStatus { + // Output only. The customer-managed encryption status of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. Only + // populated if customer-managed encryption is used. + CustomerManagedEncryptionStatus customer_managed_encryption = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The replication status of a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] using + // user-managed replication. + // + // Only populated if the parent + // [Secret][google.cloud.secretmanager.v1beta2.Secret] has a user-managed + // replication policy. + message UserManagedStatus { + // Describes the status of a user-managed replica for the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + message ReplicaStatus { + // Output only. The canonical ID of the replica location. + // For example: `"us-east1"`. + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The customer-managed encryption status of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. Only + // populated if customer-managed encryption is used. + CustomerManagedEncryptionStatus customer_managed_encryption = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The list of replica statuses for the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + repeated ReplicaStatus replicas = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The replication status of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + oneof replication_status { + // Describes the replication status of a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] with + // automatic replication. + // + // Only populated if the parent + // [Secret][google.cloud.secretmanager.v1beta2.Secret] has an automatic + // replication policy. + AutomaticStatus automatic = 1; + + // Describes the replication status of a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] with + // user-managed replication. + // + // Only populated if the parent + // [Secret][google.cloud.secretmanager.v1beta2.Secret] has a user-managed + // replication policy. + UserManagedStatus user_managed = 2; + } +} + +// Describes the status of customer-managed encryption. +message CustomerManagedEncryptionStatus { + // Required. The resource name of the Cloud KMS CryptoKeyVersion used to + // encrypt the secret payload, in the following format: + // `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. + string kms_key_version_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A Pub/Sub topic which Secret Manager will publish to when control plane +// events occur on this secret. +message Topic { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" + }; + + // Required. The resource name of the Pub/Sub topic that will be published to, + // in the following format: `projects/*/topics/*`. For publication to succeed, + // the Secret Manager service agent must have the `pubsub.topic.publish` + // permission on the topic. The Pub/Sub Publisher role + // (`roles/pubsub.publisher`) includes this permission. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The rotation time and period for a +// [Secret][google.cloud.secretmanager.v1beta2.Secret]. At next_rotation_time, +// Secret Manager will send a Pub/Sub notification to the topics configured on +// the Secret. [Secret.topics][google.cloud.secretmanager.v1beta2.Secret.topics] +// must be set to configure rotation. +message Rotation { + // Optional. Timestamp in UTC at which the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] is scheduled to rotate. + // Cannot be set to less than 300s (5 min) in the future and at most + // 3153600000s (100 years). + // + // [next_rotation_time][google.cloud.secretmanager.v1beta2.Rotation.next_rotation_time] + // MUST be set if + // [rotation_period][google.cloud.secretmanager.v1beta2.Rotation.rotation_period] + // is set. + google.protobuf.Timestamp next_rotation_time = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Input only. The Duration between rotation notifications. Must be in seconds + // and at least 3600s (1h) and at most 3153600000s (100 years). + // + // If + // [rotation_period][google.cloud.secretmanager.v1beta2.Rotation.rotation_period] + // is set, + // [next_rotation_time][google.cloud.secretmanager.v1beta2.Rotation.next_rotation_time] + // must be set. + // [next_rotation_time][google.cloud.secretmanager.v1beta2.Rotation.next_rotation_time] + // will be advanced by this period when the service automatically sends + // rotation notifications. + google.protobuf.Duration rotation_period = 2 + [(google.api.field_behavior) = INPUT_ONLY]; +} + +// A secret payload resource in the Secret Manager API. This contains the +// sensitive secret payload that is associated with a +// [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. +message SecretPayload { + // The secret data. Must be no larger than 64KiB. + bytes data = 1; + + // Optional. If specified, + // [SecretManagerService][google.cloud.secretmanager.v1beta2.SecretManagerService] + // will verify the integrity of the received + // [data][google.cloud.secretmanager.v1beta2.SecretPayload.data] on + // [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion] + // calls using the crc32c checksum and store it to include in future + // [SecretManagerService.AccessSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion] + // responses. If a checksum is not provided in the + // [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion] + // request, the + // [SecretManagerService][google.cloud.secretmanager.v1beta2.SecretManagerService] + // will generate and store one for you. + // + // The CRC32C value is encoded as a Int64 for compatibility, and can be + // safely downconverted to uint32 in languages that support this type. + // https://cloud.google.com/apis/design/design_patterns#integer_types + optional int64 data_crc32c = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-secretmanager/protos/google/cloud/secretmanager/v1beta2/service.proto b/packages/google-cloud-secretmanager/protos/google/cloud/secretmanager/v1beta2/service.proto new file mode 100644 index 00000000000..640a2600737 --- /dev/null +++ b/packages/google-cloud-secretmanager/protos/google/cloud/secretmanager/v1beta2/service.proto @@ -0,0 +1,589 @@ +// Copyright 2023 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.secretmanager.v1beta2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/secretmanager/v1beta2/resources.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.SecretManager.V1Beta2"; +option go_package = "cloud.google.com/go/secretmanager/apiv1beta2/secretmanagerpb;secretmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.secretmanager.v1beta2"; +option objc_class_prefix = "GSM"; +option php_namespace = "Google\\Cloud\\SecretManager\\V1beta2"; +option ruby_package = "Google::Cloud::SecretManager::V1beta2"; + +// Secret Manager Service +// +// Manages secrets and operations using those secrets. Implements a REST +// model with the following objects: +// +// * [Secret][google.cloud.secretmanager.v1beta2.Secret] +// * [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] +service SecretManagerService { + option (google.api.default_host) = "secretmanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists [Secrets][google.cloud.secretmanager.v1beta2.Secret]. + rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) { + option (google.api.http) = { + get: "/v1beta2/{parent=projects/*}/secrets" + additional_bindings { + get: "/v1beta2/{parent=projects/*/locations/*}/secrets" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new [Secret][google.cloud.secretmanager.v1beta2.Secret] + // containing no + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. + rpc CreateSecret(CreateSecretRequest) returns (Secret) { + option (google.api.http) = { + post: "/v1beta2/{parent=projects/*}/secrets" + body: "secret" + additional_bindings { + post: "/v1beta2/{parent=projects/*/locations/*}/secrets" + body: "secret" + } + }; + option (google.api.method_signature) = "parent,secret_id,secret"; + } + + // Creates a new + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] + // containing secret data and attaches it to an existing + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc AddSecretVersion(AddSecretVersionRequest) returns (SecretVersion) { + option (google.api.http) = { + post: "/v1beta2/{parent=projects/*/secrets/*}:addVersion" + body: "*" + additional_bindings { + post: "/v1beta2/{parent=projects/*/locations/*/secrets/*}:addVersion" + body: "*" + } + }; + option (google.api.method_signature) = "parent,payload"; + } + + // Gets metadata for a given + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc GetSecret(GetSecretRequest) returns (Secret) { + option (google.api.http) = { + get: "/v1beta2/{name=projects/*/secrets/*}" + additional_bindings { + get: "/v1beta2/{name=projects/*/locations/*/secrets/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates metadata of an existing + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc UpdateSecret(UpdateSecretRequest) returns (Secret) { + option (google.api.http) = { + patch: "/v1beta2/{secret.name=projects/*/secrets/*}" + body: "secret" + additional_bindings { + patch: "/v1beta2/{secret.name=projects/*/locations/*/secrets/*}" + body: "secret" + } + }; + option (google.api.method_signature) = "secret,update_mask"; + } + + // Deletes a [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc DeleteSecret(DeleteSecretRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta2/{name=projects/*/secrets/*}" + additional_bindings { + delete: "/v1beta2/{name=projects/*/locations/*/secrets/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. + // This call does not return secret data. + rpc ListSecretVersions(ListSecretVersionsRequest) + returns (ListSecretVersionsResponse) { + option (google.api.http) = { + get: "/v1beta2/{parent=projects/*/secrets/*}/versions" + additional_bindings { + get: "/v1beta2/{parent=projects/*/locations/*/secrets/*}/versions" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets metadata for a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + // + // `projects/*/secrets/*/versions/latest` is an alias to the most recently + // created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + rpc GetSecretVersion(GetSecretVersionRequest) returns (SecretVersion) { + option (google.api.http) = { + get: "/v1beta2/{name=projects/*/secrets/*/versions/*}" + additional_bindings { + get: "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Accesses a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. This + // call returns the secret data. + // + // `projects/*/secrets/*/versions/latest` is an alias to the most recently + // created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + rpc AccessSecretVersion(AccessSecretVersionRequest) + returns (AccessSecretVersionResponse) { + option (google.api.http) = { + get: "/v1beta2/{name=projects/*/secrets/*/versions/*}:access" + additional_bindings { + get: "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:access" + } + }; + option (google.api.method_signature) = "name"; + } + + // Disables a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + // + // Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of + // the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + // [DISABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DISABLED]. + rpc DisableSecretVersion(DisableSecretVersionRequest) + returns (SecretVersion) { + option (google.api.http) = { + post: "/v1beta2/{name=projects/*/secrets/*/versions/*}:disable" + body: "*" + additional_bindings { + post: "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:disable" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Enables a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + // + // Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of + // the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + // [ENABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.ENABLED]. + rpc EnableSecretVersion(EnableSecretVersionRequest) returns (SecretVersion) { + option (google.api.http) = { + post: "/v1beta2/{name=projects/*/secrets/*/versions/*}:enable" + body: "*" + additional_bindings { + post: "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:enable" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Destroys a + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + // + // Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of + // the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + // [DESTROYED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DESTROYED] + // and irrevocably destroys the secret data. + rpc DestroySecretVersion(DestroySecretVersionRequest) + returns (SecretVersion) { + option (google.api.http) = { + post: "/v1beta2/{name=projects/*/secrets/*/versions/*}:destroy" + body: "*" + additional_bindings { + post: "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:destroy" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Sets the access control policy on the specified secret. Replaces any + // existing policy. + // + // Permissions on + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] are + // enforced according to the policy set on the associated + // [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta2/{resource=projects/*/secrets/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1beta2/{resource=projects/*/locations/*/secrets/*}:setIamPolicy" + body: "*" + } + }; + } + + // Gets the access control policy for a secret. + // Returns empty policy if the secret exists and does not have a policy set. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + get: "/v1beta2/{resource=projects/*/secrets/*}:getIamPolicy" + additional_bindings { + get: "/v1beta2/{resource=projects/*/locations/*/secrets/*}:getIamPolicy" + } + }; + } + + // Returns permissions that a caller has for the specified secret. + // If the secret does not exist, this call returns an empty set of + // permissions, not a NOT_FOUND error. + // + // Note: This operation is designed to be used for building permission-aware + // UIs and command-line tools, not for authorization checking. This operation + // may "fail open" without warning. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1beta2/{resource=projects/*/secrets/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1beta2/{resource=projects/*/locations/*/secrets/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// Request message for +// [SecretManagerService.ListSecrets][google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecrets]. +message ListSecretsRequest { + // Required. The resource name of the project associated with the + // [Secrets][google.cloud.secretmanager.v1beta2.Secret], in the format + // `projects/*` or `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "secretmanager.googleapis.com/Secret" + } + ]; + + // Optional. The maximum number of results to be returned in a single page. If + // set to 0, the server decides the number of results to return. If the + // number is greater than 25000, it is capped at 25000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListSecretsResponse.next_page_token][google.cloud.secretmanager.v1beta2.ListSecretsResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter string, adhering to the rules in + // [List-operation + // filtering](https://cloud.google.com/secret-manager/docs/filtering). List + // only secrets matching the filter. If filter is empty, all secrets are + // listed. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [SecretManagerService.ListSecrets][google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecrets]. +message ListSecretsResponse { + // The list of [Secrets][google.cloud.secretmanager.v1beta2.Secret] sorted in + // reverse by create_time (newest first). + repeated Secret secrets = 1; + + // A token to retrieve the next page of results. Pass this value in + // [ListSecretsRequest.page_token][google.cloud.secretmanager.v1beta2.ListSecretsRequest.page_token] + // to retrieve the next page. + string next_page_token = 2; + + // The total number of [Secrets][google.cloud.secretmanager.v1beta2.Secret] + // but 0 when the + // [ListSecretsRequest.filter][google.cloud.secretmanager.v1beta2.ListSecretsRequest.filter] + // field is set. + int32 total_size = 3; +} + +// Request message for +// [SecretManagerService.CreateSecret][google.cloud.secretmanager.v1beta2.SecretManagerService.CreateSecret]. +message CreateSecretRequest { + // Required. The resource name of the project to associate with the + // [Secret][google.cloud.secretmanager.v1beta2.Secret], in the format + // `projects/*` or `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "secretmanager.googleapis.com/Secret" + } + ]; + + // Required. This must be unique within the project. + // + // A secret ID is a string with a maximum length of 255 characters and can + // contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + // underscore (`_`) characters. + string secret_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [Secret][google.cloud.secretmanager.v1beta2.Secret] with + // initial field values. + Secret secret = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion]. +message AddSecretVersionRequest { + // Required. The resource name of the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] to associate with the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] in the + // format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/Secret" + } + ]; + + // Required. The secret payload of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + SecretPayload payload = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [SecretManagerService.GetSecret][google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecret]. +message GetSecretRequest { + // Required. The resource name of the + // [Secret][google.cloud.secretmanager.v1beta2.Secret], in the format + // `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/Secret" + } + ]; +} + +// Request message for +// [SecretManagerService.ListSecretVersions][google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersions]. +message ListSecretVersionsRequest { + // Required. The resource name of the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] associated with the + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] to list, + // in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/Secret" + } + ]; + + // Optional. The maximum number of results to be returned in a single page. If + // set to 0, the server decides the number of results to return. If the + // number is greater than 25000, it is capped at 25000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // ListSecretVersionsResponse.next_page_token][]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter string, adhering to the rules in + // [List-operation + // filtering](https://cloud.google.com/secret-manager/docs/filtering). List + // only secret versions matching the filter. If filter is empty, all secret + // versions are listed. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [SecretManagerService.ListSecretVersions][google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersions]. +message ListSecretVersionsResponse { + // The list of + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] sorted + // in reverse by create_time (newest first). + repeated SecretVersion versions = 1; + + // A token to retrieve the next page of results. Pass this value in + // [ListSecretVersionsRequest.page_token][google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest.page_token] + // to retrieve the next page. + string next_page_token = 2; + + // The total number of + // [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] but 0 + // when the + // [ListSecretsRequest.filter][google.cloud.secretmanager.v1beta2.ListSecretsRequest.filter] + // field is set. + int32 total_size = 3; +} + +// Request message for +// [SecretManagerService.GetSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretVersion]. +message GetSecretVersionRequest { + // Required. The resource name of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] in the + // format `projects/*/secrets/*/versions/*` or + // `projects/*/locations/*/secrets/*/versions/*`. + // + // `projects/*/secrets/*/versions/latest` or + // `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + // recently created + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; +} + +// Request message for +// [SecretManagerService.UpdateSecret][google.cloud.secretmanager.v1beta2.SecretManagerService.UpdateSecret]. +message UpdateSecretRequest { + // Required. [Secret][google.cloud.secretmanager.v1beta2.Secret] with updated + // field values. + Secret secret = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the fields to be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [SecretManagerService.AccessSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion]. +message AccessSecretVersionRequest { + // Required. The resource name of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] in the + // format `projects/*/secrets/*/versions/*` or + // `projects/*/locations/*/secrets/*/versions/*`. + // + // `projects/*/secrets/*/versions/latest` or + // `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + // recently created + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; +} + +// Response message for +// [SecretManagerService.AccessSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion]. +message AccessSecretVersionResponse { + // The resource name of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] in the + // format `projects/*/secrets/*/versions/*` or + // `projects/*/locations/*/secrets/*/versions/*`. + string name = 1 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; + + // Secret payload + SecretPayload payload = 2; +} + +// Request message for +// [SecretManagerService.DeleteSecret][google.cloud.secretmanager.v1beta2.SecretManagerService.DeleteSecret]. +message DeleteSecretRequest { + // Required. The resource name of the + // [Secret][google.cloud.secretmanager.v1beta2.Secret] to delete in the format + // `projects/*/secrets/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/Secret" + } + ]; + + // Optional. Etag of the [Secret][google.cloud.secretmanager.v1beta2.Secret]. + // The request succeeds if it matches the etag of the currently stored secret + // object. If the etag is omitted, the request succeeds. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [SecretManagerService.DisableSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.DisableSecretVersion]. +message DisableSecretVersionRequest { + // Required. The resource name of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + // disable in the format `projects/*/secrets/*/versions/*` or + // `projects/*/locations/*/secrets/*/versions/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Optional. Etag of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. The + // request succeeds if it matches the etag of the currently stored secret + // version object. If the etag is omitted, the request succeeds. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [SecretManagerService.EnableSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.EnableSecretVersion]. +message EnableSecretVersionRequest { + // Required. The resource name of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to enable + // in the format `projects/*/secrets/*/versions/*` or + // `projects/*/locations/*/secrets/*/versions/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Optional. Etag of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. The + // request succeeds if it matches the etag of the currently stored secret + // version object. If the etag is omitted, the request succeeds. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [SecretManagerService.DestroySecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.DestroySecretVersion]. +message DestroySecretVersionRequest { + // Required. The resource name of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + // destroy in the format `projects/*/secrets/*/versions/*` or + // `projects/*/locations/*/secrets/*/versions/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Optional. Etag of the + // [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. The + // request succeeds if it matches the etag of the currently stored secret + // version object. If the etag is omitted, the request succeeds. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-secretmanager/protos/protos.d.ts b/packages/google-cloud-secretmanager/protos/protos.d.ts index 0a3bf13b3d2..396b540dc74 100644 --- a/packages/google-cloud-secretmanager/protos/protos.d.ts +++ b/packages/google-cloud-secretmanager/protos/protos.d.ts @@ -3556,6 +3556,3564 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Namespace v1beta2. */ + namespace v1beta2 { + + /** Properties of a Secret. */ + interface ISecret { + + /** Secret name */ + name?: (string|null); + + /** Secret replication */ + replication?: (google.cloud.secretmanager.v1beta2.IReplication|null); + + /** Secret createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Secret labels */ + labels?: ({ [k: string]: string }|null); + + /** Secret topics */ + topics?: (google.cloud.secretmanager.v1beta2.ITopic[]|null); + + /** Secret expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Secret ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** Secret etag */ + etag?: (string|null); + + /** Secret rotation */ + rotation?: (google.cloud.secretmanager.v1beta2.IRotation|null); + + /** Secret versionAliases */ + versionAliases?: ({ [k: string]: (number|Long|string) }|null); + + /** Secret annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Secret versionDestroyTtl */ + versionDestroyTtl?: (google.protobuf.IDuration|null); + + /** Secret customerManagedEncryption */ + customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null); + } + + /** Represents a Secret. */ + class Secret implements ISecret { + + /** + * Constructs a new Secret. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ISecret); + + /** Secret name. */ + public name: string; + + /** Secret replication. */ + public replication?: (google.cloud.secretmanager.v1beta2.IReplication|null); + + /** Secret createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Secret labels. */ + public labels: { [k: string]: string }; + + /** Secret topics. */ + public topics: google.cloud.secretmanager.v1beta2.ITopic[]; + + /** Secret expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Secret ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** Secret etag. */ + public etag: string; + + /** Secret rotation. */ + public rotation?: (google.cloud.secretmanager.v1beta2.IRotation|null); + + /** Secret versionAliases. */ + public versionAliases: { [k: string]: (number|Long|string) }; + + /** Secret annotations. */ + public annotations: { [k: string]: string }; + + /** Secret versionDestroyTtl. */ + public versionDestroyTtl?: (google.protobuf.IDuration|null); + + /** Secret customerManagedEncryption. */ + public customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null); + + /** Secret expiration. */ + public expiration?: ("expireTime"|"ttl"); + + /** + * Creates a new Secret instance using the specified properties. + * @param [properties] Properties to set + * @returns Secret instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ISecret): google.cloud.secretmanager.v1beta2.Secret; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.Secret; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.Secret; + + /** + * Verifies a Secret message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Secret + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.Secret; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @param message Secret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.Secret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Secret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Secret + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecretVersion. */ + interface ISecretVersion { + + /** SecretVersion name */ + name?: (string|null); + + /** SecretVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SecretVersion destroyTime */ + destroyTime?: (google.protobuf.ITimestamp|null); + + /** SecretVersion state */ + state?: (google.cloud.secretmanager.v1beta2.SecretVersion.State|keyof typeof google.cloud.secretmanager.v1beta2.SecretVersion.State|null); + + /** SecretVersion replicationStatus */ + replicationStatus?: (google.cloud.secretmanager.v1beta2.IReplicationStatus|null); + + /** SecretVersion etag */ + etag?: (string|null); + + /** SecretVersion clientSpecifiedPayloadChecksum */ + clientSpecifiedPayloadChecksum?: (boolean|null); + + /** SecretVersion scheduledDestroyTime */ + scheduledDestroyTime?: (google.protobuf.ITimestamp|null); + + /** SecretVersion customerManagedEncryption */ + customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null); + } + + /** Represents a SecretVersion. */ + class SecretVersion implements ISecretVersion { + + /** + * Constructs a new SecretVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ISecretVersion); + + /** SecretVersion name. */ + public name: string; + + /** SecretVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SecretVersion destroyTime. */ + public destroyTime?: (google.protobuf.ITimestamp|null); + + /** SecretVersion state. */ + public state: (google.cloud.secretmanager.v1beta2.SecretVersion.State|keyof typeof google.cloud.secretmanager.v1beta2.SecretVersion.State); + + /** SecretVersion replicationStatus. */ + public replicationStatus?: (google.cloud.secretmanager.v1beta2.IReplicationStatus|null); + + /** SecretVersion etag. */ + public etag: string; + + /** SecretVersion clientSpecifiedPayloadChecksum. */ + public clientSpecifiedPayloadChecksum: boolean; + + /** SecretVersion scheduledDestroyTime. */ + public scheduledDestroyTime?: (google.protobuf.ITimestamp|null); + + /** SecretVersion customerManagedEncryption. */ + public customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null); + + /** + * Creates a new SecretVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretVersion instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ISecretVersion): google.cloud.secretmanager.v1beta2.SecretVersion; + + /** + * Encodes the specified SecretVersion message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretVersion.verify|verify} messages. + * @param message SecretVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ISecretVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretVersion message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretVersion.verify|verify} messages. + * @param message SecretVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ISecretVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.SecretVersion; + + /** + * Decodes a SecretVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.SecretVersion; + + /** + * Verifies a SecretVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecretVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.SecretVersion; + + /** + * Creates a plain object from a SecretVersion message. Also converts values to other types if specified. + * @param message SecretVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.SecretVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecretVersion { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + DESTROYED = 3 + } + } + + /** Properties of a Replication. */ + interface IReplication { + + /** Replication automatic */ + automatic?: (google.cloud.secretmanager.v1beta2.Replication.IAutomatic|null); + + /** Replication userManaged */ + userManaged?: (google.cloud.secretmanager.v1beta2.Replication.IUserManaged|null); + } + + /** Represents a Replication. */ + class Replication implements IReplication { + + /** + * Constructs a new Replication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IReplication); + + /** Replication automatic. */ + public automatic?: (google.cloud.secretmanager.v1beta2.Replication.IAutomatic|null); + + /** Replication userManaged. */ + public userManaged?: (google.cloud.secretmanager.v1beta2.Replication.IUserManaged|null); + + /** Replication replication. */ + public replication?: ("automatic"|"userManaged"); + + /** + * Creates a new Replication instance using the specified properties. + * @param [properties] Properties to set + * @returns Replication instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IReplication): google.cloud.secretmanager.v1beta2.Replication; + + /** + * Encodes the specified Replication message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.verify|verify} messages. + * @param message Replication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IReplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Replication message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.verify|verify} messages. + * @param message Replication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IReplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Replication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Replication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.Replication; + + /** + * Decodes a Replication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Replication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.Replication; + + /** + * Verifies a Replication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Replication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Replication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.Replication; + + /** + * Creates a plain object from a Replication message. Also converts values to other types if specified. + * @param message Replication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.Replication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Replication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Replication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Replication { + + /** Properties of an Automatic. */ + interface IAutomatic { + + /** Automatic customerManagedEncryption */ + customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null); + } + + /** Represents an Automatic. */ + class Automatic implements IAutomatic { + + /** + * Constructs a new Automatic. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.Replication.IAutomatic); + + /** Automatic customerManagedEncryption. */ + public customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null); + + /** + * Creates a new Automatic instance using the specified properties. + * @param [properties] Properties to set + * @returns Automatic instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.Replication.IAutomatic): google.cloud.secretmanager.v1beta2.Replication.Automatic; + + /** + * Encodes the specified Automatic message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.Automatic.verify|verify} messages. + * @param message Automatic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.Replication.IAutomatic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Automatic message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.Automatic.verify|verify} messages. + * @param message Automatic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.Replication.IAutomatic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Automatic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Automatic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.Replication.Automatic; + + /** + * Decodes an Automatic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Automatic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.Replication.Automatic; + + /** + * Verifies an Automatic message. + * @param message Plain 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 Automatic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Automatic + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.Replication.Automatic; + + /** + * Creates a plain object from an Automatic message. Also converts values to other types if specified. + * @param message Automatic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.Replication.Automatic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Automatic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Automatic + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserManaged. */ + interface IUserManaged { + + /** UserManaged replicas */ + replicas?: (google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica[]|null); + } + + /** Represents a UserManaged. */ + class UserManaged implements IUserManaged { + + /** + * Constructs a new UserManaged. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.Replication.IUserManaged); + + /** UserManaged replicas. */ + public replicas: google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica[]; + + /** + * Creates a new UserManaged instance using the specified properties. + * @param [properties] Properties to set + * @returns UserManaged instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.Replication.IUserManaged): google.cloud.secretmanager.v1beta2.Replication.UserManaged; + + /** + * Encodes the specified UserManaged message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.verify|verify} messages. + * @param message UserManaged message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.Replication.IUserManaged, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserManaged message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.verify|verify} messages. + * @param message UserManaged message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.Replication.IUserManaged, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserManaged message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserManaged + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.Replication.UserManaged; + + /** + * Decodes a UserManaged message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserManaged + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.Replication.UserManaged; + + /** + * Verifies a UserManaged message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserManaged message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserManaged + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.Replication.UserManaged; + + /** + * Creates a plain object from a UserManaged message. Also converts values to other types if specified. + * @param message UserManaged + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.Replication.UserManaged, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserManaged to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserManaged + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UserManaged { + + /** Properties of a Replica. */ + interface IReplica { + + /** Replica location */ + location?: (string|null); + + /** Replica customerManagedEncryption */ + customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null); + } + + /** Represents a Replica. */ + class Replica implements IReplica { + + /** + * Constructs a new Replica. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica); + + /** Replica location. */ + public location: string; + + /** Replica customerManagedEncryption. */ + public customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null); + + /** + * Creates a new Replica instance using the specified properties. + * @param [properties] Properties to set + * @returns Replica instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica): google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica; + + /** + * Encodes the specified Replica message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.verify|verify} messages. + * @param message Replica message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Replica message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.verify|verify} messages. + * @param message Replica message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Replica message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Replica + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica; + + /** + * Decodes a Replica message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Replica + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica; + + /** + * Verifies a Replica message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Replica message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Replica + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica; + + /** + * Creates a plain object from a Replica message. Also converts values to other types if specified. + * @param message Replica + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Replica to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Replica + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a CustomerManagedEncryption. */ + interface ICustomerManagedEncryption { + + /** CustomerManagedEncryption kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents a CustomerManagedEncryption. */ + class CustomerManagedEncryption implements ICustomerManagedEncryption { + + /** + * Constructs a new CustomerManagedEncryption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption); + + /** CustomerManagedEncryption kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new CustomerManagedEncryption instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerManagedEncryption instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption): google.cloud.secretmanager.v1beta2.CustomerManagedEncryption; + + /** + * Encodes the specified CustomerManagedEncryption message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.verify|verify} messages. + * @param message CustomerManagedEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerManagedEncryption message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.verify|verify} messages. + * @param message CustomerManagedEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerManagedEncryption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerManagedEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.CustomerManagedEncryption; + + /** + * Decodes a CustomerManagedEncryption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerManagedEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.CustomerManagedEncryption; + + /** + * Verifies a CustomerManagedEncryption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerManagedEncryption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerManagedEncryption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.CustomerManagedEncryption; + + /** + * Creates a plain object from a CustomerManagedEncryption message. Also converts values to other types if specified. + * @param message CustomerManagedEncryption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.CustomerManagedEncryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerManagedEncryption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerManagedEncryption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReplicationStatus. */ + interface IReplicationStatus { + + /** ReplicationStatus automatic */ + automatic?: (google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus|null); + + /** ReplicationStatus userManaged */ + userManaged?: (google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus|null); + } + + /** Represents a ReplicationStatus. */ + class ReplicationStatus implements IReplicationStatus { + + /** + * Constructs a new ReplicationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IReplicationStatus); + + /** ReplicationStatus automatic. */ + public automatic?: (google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus|null); + + /** ReplicationStatus userManaged. */ + public userManaged?: (google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus|null); + + /** ReplicationStatus replicationStatus. */ + public replicationStatus?: ("automatic"|"userManaged"); + + /** + * Creates a new ReplicationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicationStatus instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IReplicationStatus): google.cloud.secretmanager.v1beta2.ReplicationStatus; + + /** + * Encodes the specified ReplicationStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.verify|verify} messages. + * @param message ReplicationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IReplicationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicationStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.verify|verify} messages. + * @param message ReplicationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IReplicationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ReplicationStatus; + + /** + * Decodes a ReplicationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ReplicationStatus; + + /** + * Verifies a ReplicationStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicationStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ReplicationStatus; + + /** + * Creates a plain object from a ReplicationStatus message. Also converts values to other types if specified. + * @param message ReplicationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ReplicationStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicationStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReplicationStatus { + + /** Properties of an AutomaticStatus. */ + interface IAutomaticStatus { + + /** AutomaticStatus customerManagedEncryption */ + customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null); + } + + /** Represents an AutomaticStatus. */ + class AutomaticStatus implements IAutomaticStatus { + + /** + * Constructs a new AutomaticStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus); + + /** AutomaticStatus customerManagedEncryption. */ + public customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null); + + /** + * Creates a new AutomaticStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomaticStatus instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus): google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus; + + /** + * Encodes the specified AutomaticStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.verify|verify} messages. + * @param message AutomaticStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomaticStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.verify|verify} messages. + * @param message AutomaticStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomaticStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomaticStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus; + + /** + * Decodes an AutomaticStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomaticStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus; + + /** + * Verifies an AutomaticStatus message. + * @param message Plain 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 AutomaticStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomaticStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus; + + /** + * Creates a plain object from an AutomaticStatus message. Also converts values to other types if specified. + * @param message AutomaticStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomaticStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomaticStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserManagedStatus. */ + interface IUserManagedStatus { + + /** UserManagedStatus replicas */ + replicas?: (google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus[]|null); + } + + /** Represents a UserManagedStatus. */ + class UserManagedStatus implements IUserManagedStatus { + + /** + * Constructs a new UserManagedStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus); + + /** UserManagedStatus replicas. */ + public replicas: google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus[]; + + /** + * Creates a new UserManagedStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns UserManagedStatus instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus; + + /** + * Encodes the specified UserManagedStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.verify|verify} messages. + * @param message UserManagedStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserManagedStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.verify|verify} messages. + * @param message UserManagedStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserManagedStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserManagedStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus; + + /** + * Decodes a UserManagedStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserManagedStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus; + + /** + * Verifies a UserManagedStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserManagedStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserManagedStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus; + + /** + * Creates a plain object from a UserManagedStatus message. Also converts values to other types if specified. + * @param message UserManagedStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserManagedStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserManagedStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UserManagedStatus { + + /** Properties of a ReplicaStatus. */ + interface IReplicaStatus { + + /** ReplicaStatus location */ + location?: (string|null); + + /** ReplicaStatus customerManagedEncryption */ + customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null); + } + + /** Represents a ReplicaStatus. */ + class ReplicaStatus implements IReplicaStatus { + + /** + * Constructs a new ReplicaStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus); + + /** ReplicaStatus location. */ + public location: string; + + /** ReplicaStatus customerManagedEncryption. */ + public customerManagedEncryption?: (google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null); + + /** + * Creates a new ReplicaStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaStatus instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus; + + /** + * Encodes the specified ReplicaStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.verify|verify} messages. + * @param message ReplicaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.verify|verify} messages. + * @param message ReplicaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus; + + /** + * Decodes a ReplicaStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus; + + /** + * Verifies a ReplicaStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus; + + /** + * Creates a plain object from a ReplicaStatus message. Also converts values to other types if specified. + * @param message ReplicaStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a CustomerManagedEncryptionStatus. */ + interface ICustomerManagedEncryptionStatus { + + /** CustomerManagedEncryptionStatus kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + } + + /** Represents a CustomerManagedEncryptionStatus. */ + class CustomerManagedEncryptionStatus implements ICustomerManagedEncryptionStatus { + + /** + * Constructs a new CustomerManagedEncryptionStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus); + + /** CustomerManagedEncryptionStatus kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** + * Creates a new CustomerManagedEncryptionStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerManagedEncryptionStatus instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus): google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus; + + /** + * Encodes the specified CustomerManagedEncryptionStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.verify|verify} messages. + * @param message CustomerManagedEncryptionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerManagedEncryptionStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.verify|verify} messages. + * @param message CustomerManagedEncryptionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerManagedEncryptionStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerManagedEncryptionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus; + + /** + * Decodes a CustomerManagedEncryptionStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerManagedEncryptionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus; + + /** + * Verifies a CustomerManagedEncryptionStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerManagedEncryptionStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerManagedEncryptionStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus; + + /** + * Creates a plain object from a CustomerManagedEncryptionStatus message. Also converts values to other types if specified. + * @param message CustomerManagedEncryptionStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerManagedEncryptionStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerManagedEncryptionStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Topic. */ + interface ITopic { + + /** Topic name */ + name?: (string|null); + } + + /** Represents a Topic. */ + class Topic implements ITopic { + + /** + * Constructs a new Topic. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ITopic); + + /** Topic name. */ + public name: string; + + /** + * Creates a new Topic instance using the specified properties. + * @param [properties] Properties to set + * @returns Topic instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ITopic): google.cloud.secretmanager.v1beta2.Topic; + + /** + * Encodes the specified Topic message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Topic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.Topic; + + /** + * Decodes a Topic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.Topic; + + /** + * Verifies a Topic message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Topic + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.Topic; + + /** + * Creates a plain object from a Topic message. Also converts values to other types if specified. + * @param message Topic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.Topic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Topic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Topic + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Rotation. */ + interface IRotation { + + /** Rotation nextRotationTime */ + nextRotationTime?: (google.protobuf.ITimestamp|null); + + /** Rotation rotationPeriod */ + rotationPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a Rotation. */ + class Rotation implements IRotation { + + /** + * Constructs a new Rotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IRotation); + + /** Rotation nextRotationTime. */ + public nextRotationTime?: (google.protobuf.ITimestamp|null); + + /** Rotation rotationPeriod. */ + public rotationPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new Rotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Rotation instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IRotation): google.cloud.secretmanager.v1beta2.Rotation; + + /** + * Encodes the specified Rotation message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Rotation.verify|verify} messages. + * @param message Rotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IRotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rotation message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Rotation.verify|verify} messages. + * @param message Rotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IRotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.Rotation; + + /** + * Decodes a Rotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.Rotation; + + /** + * Verifies a Rotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.Rotation; + + /** + * Creates a plain object from a Rotation message. Also converts values to other types if specified. + * @param message Rotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.Rotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecretPayload. */ + interface ISecretPayload { + + /** SecretPayload data */ + data?: (Uint8Array|string|null); + + /** SecretPayload dataCrc32c */ + dataCrc32c?: (number|Long|string|null); + } + + /** Represents a SecretPayload. */ + class SecretPayload implements ISecretPayload { + + /** + * Constructs a new SecretPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ISecretPayload); + + /** SecretPayload data. */ + public data: (Uint8Array|string); + + /** SecretPayload dataCrc32c. */ + public dataCrc32c?: (number|Long|string|null); + + /** SecretPayload _dataCrc32c. */ + public _dataCrc32c?: "dataCrc32c"; + + /** + * Creates a new SecretPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretPayload instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ISecretPayload): google.cloud.secretmanager.v1beta2.SecretPayload; + + /** + * Encodes the specified SecretPayload message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretPayload.verify|verify} messages. + * @param message SecretPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ISecretPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretPayload message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretPayload.verify|verify} messages. + * @param message SecretPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ISecretPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.SecretPayload; + + /** + * Decodes a SecretPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.SecretPayload; + + /** + * Verifies a SecretPayload message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecretPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretPayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.SecretPayload; + + /** + * Creates a plain object from a SecretPayload message. Also converts values to other types if specified. + * @param message SecretPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.SecretPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SecretManagerService */ + class SecretManagerService extends $protobuf.rpc.Service { + + /** + * Constructs a new SecretManagerService 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 SecretManagerService 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): SecretManagerService; + + /** + * Calls ListSecrets. + * @param request ListSecretsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecretsResponse + */ + public listSecrets(request: google.cloud.secretmanager.v1beta2.IListSecretsRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretsCallback): void; + + /** + * Calls ListSecrets. + * @param request ListSecretsRequest message or plain object + * @returns Promise + */ + public listSecrets(request: google.cloud.secretmanager.v1beta2.IListSecretsRequest): Promise; + + /** + * Calls CreateSecret. + * @param request CreateSecretRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Secret + */ + public createSecret(request: google.cloud.secretmanager.v1beta2.ICreateSecretRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.CreateSecretCallback): void; + + /** + * Calls CreateSecret. + * @param request CreateSecretRequest message or plain object + * @returns Promise + */ + public createSecret(request: google.cloud.secretmanager.v1beta2.ICreateSecretRequest): Promise; + + /** + * Calls AddSecretVersion. + * @param request AddSecretVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecretVersion + */ + public addSecretVersion(request: google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersionCallback): void; + + /** + * Calls AddSecretVersion. + * @param request AddSecretVersionRequest message or plain object + * @returns Promise + */ + public addSecretVersion(request: google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest): Promise; + + /** + * Calls GetSecret. + * @param request GetSecretRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Secret + */ + public getSecret(request: google.cloud.secretmanager.v1beta2.IGetSecretRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretCallback): void; + + /** + * Calls GetSecret. + * @param request GetSecretRequest message or plain object + * @returns Promise + */ + public getSecret(request: google.cloud.secretmanager.v1beta2.IGetSecretRequest): Promise; + + /** + * Calls UpdateSecret. + * @param request UpdateSecretRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Secret + */ + public updateSecret(request: google.cloud.secretmanager.v1beta2.IUpdateSecretRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.UpdateSecretCallback): void; + + /** + * Calls UpdateSecret. + * @param request UpdateSecretRequest message or plain object + * @returns Promise + */ + public updateSecret(request: google.cloud.secretmanager.v1beta2.IUpdateSecretRequest): Promise; + + /** + * Calls DeleteSecret. + * @param request DeleteSecretRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSecret(request: google.cloud.secretmanager.v1beta2.IDeleteSecretRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.DeleteSecretCallback): void; + + /** + * Calls DeleteSecret. + * @param request DeleteSecretRequest message or plain object + * @returns Promise + */ + public deleteSecret(request: google.cloud.secretmanager.v1beta2.IDeleteSecretRequest): Promise; + + /** + * Calls ListSecretVersions. + * @param request ListSecretVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecretVersionsResponse + */ + public listSecretVersions(request: google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersionsCallback): void; + + /** + * Calls ListSecretVersions. + * @param request ListSecretVersionsRequest message or plain object + * @returns Promise + */ + public listSecretVersions(request: google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest): Promise; + + /** + * Calls GetSecretVersion. + * @param request GetSecretVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecretVersion + */ + public getSecretVersion(request: google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretVersionCallback): void; + + /** + * Calls GetSecretVersion. + * @param request GetSecretVersionRequest message or plain object + * @returns Promise + */ + public getSecretVersion(request: google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest): Promise; + + /** + * Calls AccessSecretVersion. + * @param request AccessSecretVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AccessSecretVersionResponse + */ + public accessSecretVersion(request: google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersionCallback): void; + + /** + * Calls AccessSecretVersion. + * @param request AccessSecretVersionRequest message or plain object + * @returns Promise + */ + public accessSecretVersion(request: google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest): Promise; + + /** + * Calls DisableSecretVersion. + * @param request DisableSecretVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecretVersion + */ + public disableSecretVersion(request: google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.DisableSecretVersionCallback): void; + + /** + * Calls DisableSecretVersion. + * @param request DisableSecretVersionRequest message or plain object + * @returns Promise + */ + public disableSecretVersion(request: google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest): Promise; + + /** + * Calls EnableSecretVersion. + * @param request EnableSecretVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecretVersion + */ + public enableSecretVersion(request: google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.EnableSecretVersionCallback): void; + + /** + * Calls EnableSecretVersion. + * @param request EnableSecretVersionRequest message or plain object + * @returns Promise + */ + public enableSecretVersion(request: google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest): Promise; + + /** + * Calls DestroySecretVersion. + * @param request DestroySecretVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecretVersion + */ + public destroySecretVersion(request: google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.DestroySecretVersionCallback): void; + + /** + * Calls DestroySecretVersion. + * @param request DestroySecretVersionRequest message or plain object + * @returns Promise + */ + public destroySecretVersion(request: google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.secretmanager.v1beta2.SecretManagerService.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace SecretManagerService { + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|listSecrets}. + * @param error Error, if any + * @param [response] ListSecretsResponse + */ + type ListSecretsCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.ListSecretsResponse) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|createSecret}. + * @param error Error, if any + * @param [response] Secret + */ + type CreateSecretCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.Secret) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|addSecretVersion}. + * @param error Error, if any + * @param [response] SecretVersion + */ + type AddSecretVersionCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.SecretVersion) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|getSecret}. + * @param error Error, if any + * @param [response] Secret + */ + type GetSecretCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.Secret) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|updateSecret}. + * @param error Error, if any + * @param [response] Secret + */ + type UpdateSecretCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.Secret) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|deleteSecret}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSecretCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|listSecretVersions}. + * @param error Error, if any + * @param [response] ListSecretVersionsResponse + */ + type ListSecretVersionsCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|getSecretVersion}. + * @param error Error, if any + * @param [response] SecretVersion + */ + type GetSecretVersionCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.SecretVersion) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|accessSecretVersion}. + * @param error Error, if any + * @param [response] AccessSecretVersionResponse + */ + type AccessSecretVersionCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|disableSecretVersion}. + * @param error Error, if any + * @param [response] SecretVersion + */ + type DisableSecretVersionCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.SecretVersion) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|enableSecretVersion}. + * @param error Error, if any + * @param [response] SecretVersion + */ + type EnableSecretVersionCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.SecretVersion) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|destroySecretVersion}. + * @param error Error, if any + * @param [response] SecretVersion + */ + type DestroySecretVersionCallback = (error: (Error|null), response?: google.cloud.secretmanager.v1beta2.SecretVersion) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a ListSecretsRequest. */ + interface IListSecretsRequest { + + /** ListSecretsRequest parent */ + parent?: (string|null); + + /** ListSecretsRequest pageSize */ + pageSize?: (number|null); + + /** ListSecretsRequest pageToken */ + pageToken?: (string|null); + + /** ListSecretsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSecretsRequest. */ + class ListSecretsRequest implements IListSecretsRequest { + + /** + * Constructs a new ListSecretsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IListSecretsRequest); + + /** ListSecretsRequest parent. */ + public parent: string; + + /** ListSecretsRequest pageSize. */ + public pageSize: number; + + /** ListSecretsRequest pageToken. */ + public pageToken: string; + + /** ListSecretsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSecretsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecretsRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IListSecretsRequest): google.cloud.secretmanager.v1beta2.ListSecretsRequest; + + /** + * Encodes the specified ListSecretsRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsRequest.verify|verify} messages. + * @param message ListSecretsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IListSecretsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecretsRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsRequest.verify|verify} messages. + * @param message ListSecretsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IListSecretsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecretsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecretsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ListSecretsRequest; + + /** + * Decodes a ListSecretsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecretsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ListSecretsRequest; + + /** + * Verifies a ListSecretsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecretsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecretsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ListSecretsRequest; + + /** + * Creates a plain object from a ListSecretsRequest message. Also converts values to other types if specified. + * @param message ListSecretsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ListSecretsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecretsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecretsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecretsResponse. */ + interface IListSecretsResponse { + + /** ListSecretsResponse secrets */ + secrets?: (google.cloud.secretmanager.v1beta2.ISecret[]|null); + + /** ListSecretsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListSecretsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListSecretsResponse. */ + class ListSecretsResponse implements IListSecretsResponse { + + /** + * Constructs a new ListSecretsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IListSecretsResponse); + + /** ListSecretsResponse secrets. */ + public secrets: google.cloud.secretmanager.v1beta2.ISecret[]; + + /** ListSecretsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListSecretsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListSecretsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecretsResponse instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IListSecretsResponse): google.cloud.secretmanager.v1beta2.ListSecretsResponse; + + /** + * Encodes the specified ListSecretsResponse message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsResponse.verify|verify} messages. + * @param message ListSecretsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IListSecretsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecretsResponse message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsResponse.verify|verify} messages. + * @param message ListSecretsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IListSecretsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecretsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecretsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ListSecretsResponse; + + /** + * Decodes a ListSecretsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecretsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ListSecretsResponse; + + /** + * Verifies a ListSecretsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecretsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecretsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ListSecretsResponse; + + /** + * Creates a plain object from a ListSecretsResponse message. Also converts values to other types if specified. + * @param message ListSecretsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ListSecretsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecretsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecretsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecretRequest. */ + interface ICreateSecretRequest { + + /** CreateSecretRequest parent */ + parent?: (string|null); + + /** CreateSecretRequest secretId */ + secretId?: (string|null); + + /** CreateSecretRequest secret */ + secret?: (google.cloud.secretmanager.v1beta2.ISecret|null); + } + + /** Represents a CreateSecretRequest. */ + class CreateSecretRequest implements ICreateSecretRequest { + + /** + * Constructs a new CreateSecretRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.ICreateSecretRequest); + + /** CreateSecretRequest parent. */ + public parent: string; + + /** CreateSecretRequest secretId. */ + public secretId: string; + + /** CreateSecretRequest secret. */ + public secret?: (google.cloud.secretmanager.v1beta2.ISecret|null); + + /** + * Creates a new CreateSecretRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecretRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.ICreateSecretRequest): google.cloud.secretmanager.v1beta2.CreateSecretRequest; + + /** + * Encodes the specified CreateSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CreateSecretRequest.verify|verify} messages. + * @param message CreateSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.ICreateSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CreateSecretRequest.verify|verify} messages. + * @param message CreateSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.ICreateSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecretRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.CreateSecretRequest; + + /** + * Decodes a CreateSecretRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.CreateSecretRequest; + + /** + * Verifies a CreateSecretRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecretRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecretRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.CreateSecretRequest; + + /** + * Creates a plain object from a CreateSecretRequest message. Also converts values to other types if specified. + * @param message CreateSecretRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.CreateSecretRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecretRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecretRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddSecretVersionRequest. */ + interface IAddSecretVersionRequest { + + /** AddSecretVersionRequest parent */ + parent?: (string|null); + + /** AddSecretVersionRequest payload */ + payload?: (google.cloud.secretmanager.v1beta2.ISecretPayload|null); + } + + /** Represents an AddSecretVersionRequest. */ + class AddSecretVersionRequest implements IAddSecretVersionRequest { + + /** + * Constructs a new AddSecretVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest); + + /** AddSecretVersionRequest parent. */ + public parent: string; + + /** AddSecretVersionRequest payload. */ + public payload?: (google.cloud.secretmanager.v1beta2.ISecretPayload|null); + + /** + * Creates a new AddSecretVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddSecretVersionRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest): google.cloud.secretmanager.v1beta2.AddSecretVersionRequest; + + /** + * Encodes the specified AddSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AddSecretVersionRequest.verify|verify} messages. + * @param message AddSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AddSecretVersionRequest.verify|verify} messages. + * @param message AddSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddSecretVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.AddSecretVersionRequest; + + /** + * Decodes an AddSecretVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.AddSecretVersionRequest; + + /** + * Verifies an AddSecretVersionRequest message. + * @param message Plain 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 AddSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddSecretVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.AddSecretVersionRequest; + + /** + * Creates a plain object from an AddSecretVersionRequest message. Also converts values to other types if specified. + * @param message AddSecretVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.AddSecretVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddSecretVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddSecretVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSecretRequest. */ + interface IGetSecretRequest { + + /** GetSecretRequest name */ + name?: (string|null); + } + + /** Represents a GetSecretRequest. */ + class GetSecretRequest implements IGetSecretRequest { + + /** + * Constructs a new GetSecretRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IGetSecretRequest); + + /** GetSecretRequest name. */ + public name: string; + + /** + * Creates a new GetSecretRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecretRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IGetSecretRequest): google.cloud.secretmanager.v1beta2.GetSecretRequest; + + /** + * Encodes the specified GetSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretRequest.verify|verify} messages. + * @param message GetSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IGetSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretRequest.verify|verify} messages. + * @param message GetSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IGetSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSecretRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.GetSecretRequest; + + /** + * Decodes a GetSecretRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.GetSecretRequest; + + /** + * Verifies a GetSecretRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSecretRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecretRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.GetSecretRequest; + + /** + * Creates a plain object from a GetSecretRequest message. Also converts values to other types if specified. + * @param message GetSecretRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.GetSecretRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSecretRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSecretRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecretVersionsRequest. */ + interface IListSecretVersionsRequest { + + /** ListSecretVersionsRequest parent */ + parent?: (string|null); + + /** ListSecretVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSecretVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListSecretVersionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSecretVersionsRequest. */ + class ListSecretVersionsRequest implements IListSecretVersionsRequest { + + /** + * Constructs a new ListSecretVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest); + + /** ListSecretVersionsRequest parent. */ + public parent: string; + + /** ListSecretVersionsRequest pageSize. */ + public pageSize: number; + + /** ListSecretVersionsRequest pageToken. */ + public pageToken: string; + + /** ListSecretVersionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSecretVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecretVersionsRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest): google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest; + + /** + * Encodes the specified ListSecretVersionsRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest.verify|verify} messages. + * @param message ListSecretVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecretVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest.verify|verify} messages. + * @param message ListSecretVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecretVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecretVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest; + + /** + * Decodes a ListSecretVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecretVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest; + + /** + * Verifies a ListSecretVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecretVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecretVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest; + + /** + * Creates a plain object from a ListSecretVersionsRequest message. Also converts values to other types if specified. + * @param message ListSecretVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecretVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecretVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecretVersionsResponse. */ + interface IListSecretVersionsResponse { + + /** ListSecretVersionsResponse versions */ + versions?: (google.cloud.secretmanager.v1beta2.ISecretVersion[]|null); + + /** ListSecretVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListSecretVersionsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListSecretVersionsResponse. */ + class ListSecretVersionsResponse implements IListSecretVersionsResponse { + + /** + * Constructs a new ListSecretVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse); + + /** ListSecretVersionsResponse versions. */ + public versions: google.cloud.secretmanager.v1beta2.ISecretVersion[]; + + /** ListSecretVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListSecretVersionsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListSecretVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecretVersionsResponse instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse): google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse; + + /** + * Encodes the specified ListSecretVersionsResponse message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse.verify|verify} messages. + * @param message ListSecretVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecretVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse.verify|verify} messages. + * @param message ListSecretVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecretVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecretVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse; + + /** + * Decodes a ListSecretVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecretVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse; + + /** + * Verifies a ListSecretVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecretVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecretVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse; + + /** + * Creates a plain object from a ListSecretVersionsResponse message. Also converts values to other types if specified. + * @param message ListSecretVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecretVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecretVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSecretVersionRequest. */ + interface IGetSecretVersionRequest { + + /** GetSecretVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetSecretVersionRequest. */ + class GetSecretVersionRequest implements IGetSecretVersionRequest { + + /** + * Constructs a new GetSecretVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest); + + /** GetSecretVersionRequest name. */ + public name: string; + + /** + * Creates a new GetSecretVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecretVersionRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest): google.cloud.secretmanager.v1beta2.GetSecretVersionRequest; + + /** + * Encodes the specified GetSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretVersionRequest.verify|verify} messages. + * @param message GetSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretVersionRequest.verify|verify} messages. + * @param message GetSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSecretVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.GetSecretVersionRequest; + + /** + * Decodes a GetSecretVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.GetSecretVersionRequest; + + /** + * Verifies a GetSecretVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecretVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.GetSecretVersionRequest; + + /** + * Creates a plain object from a GetSecretVersionRequest message. Also converts values to other types if specified. + * @param message GetSecretVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.GetSecretVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSecretVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSecretVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSecretRequest. */ + interface IUpdateSecretRequest { + + /** UpdateSecretRequest secret */ + secret?: (google.cloud.secretmanager.v1beta2.ISecret|null); + + /** UpdateSecretRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSecretRequest. */ + class UpdateSecretRequest implements IUpdateSecretRequest { + + /** + * Constructs a new UpdateSecretRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IUpdateSecretRequest); + + /** UpdateSecretRequest secret. */ + public secret?: (google.cloud.secretmanager.v1beta2.ISecret|null); + + /** UpdateSecretRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSecretRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecretRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IUpdateSecretRequest): google.cloud.secretmanager.v1beta2.UpdateSecretRequest; + + /** + * Encodes the specified UpdateSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.UpdateSecretRequest.verify|verify} messages. + * @param message UpdateSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IUpdateSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.UpdateSecretRequest.verify|verify} messages. + * @param message UpdateSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IUpdateSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecretRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.UpdateSecretRequest; + + /** + * Decodes an UpdateSecretRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.UpdateSecretRequest; + + /** + * Verifies an UpdateSecretRequest message. + * @param message Plain 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 UpdateSecretRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecretRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.UpdateSecretRequest; + + /** + * Creates a plain object from an UpdateSecretRequest message. Also converts values to other types if specified. + * @param message UpdateSecretRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.UpdateSecretRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecretRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecretRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessSecretVersionRequest. */ + interface IAccessSecretVersionRequest { + + /** AccessSecretVersionRequest name */ + name?: (string|null); + } + + /** Represents an AccessSecretVersionRequest. */ + class AccessSecretVersionRequest implements IAccessSecretVersionRequest { + + /** + * Constructs a new AccessSecretVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest); + + /** AccessSecretVersionRequest name. */ + public name: string; + + /** + * Creates a new AccessSecretVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessSecretVersionRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest): google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest; + + /** + * Encodes the specified AccessSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest.verify|verify} messages. + * @param message AccessSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest.verify|verify} messages. + * @param message AccessSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessSecretVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest; + + /** + * Decodes an AccessSecretVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest; + + /** + * Verifies an AccessSecretVersionRequest message. + * @param message Plain 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 AccessSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessSecretVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest; + + /** + * Creates a plain object from an AccessSecretVersionRequest message. Also converts values to other types if specified. + * @param message AccessSecretVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessSecretVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessSecretVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessSecretVersionResponse. */ + interface IAccessSecretVersionResponse { + + /** AccessSecretVersionResponse name */ + name?: (string|null); + + /** AccessSecretVersionResponse payload */ + payload?: (google.cloud.secretmanager.v1beta2.ISecretPayload|null); + } + + /** Represents an AccessSecretVersionResponse. */ + class AccessSecretVersionResponse implements IAccessSecretVersionResponse { + + /** + * Constructs a new AccessSecretVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse); + + /** AccessSecretVersionResponse name. */ + public name: string; + + /** AccessSecretVersionResponse payload. */ + public payload?: (google.cloud.secretmanager.v1beta2.ISecretPayload|null); + + /** + * Creates a new AccessSecretVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessSecretVersionResponse instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse): google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse; + + /** + * Encodes the specified AccessSecretVersionResponse message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse.verify|verify} messages. + * @param message AccessSecretVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessSecretVersionResponse message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse.verify|verify} messages. + * @param message AccessSecretVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessSecretVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessSecretVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse; + + /** + * Decodes an AccessSecretVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessSecretVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse; + + /** + * Verifies an AccessSecretVersionResponse message. + * @param message Plain 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 AccessSecretVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessSecretVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse; + + /** + * Creates a plain object from an AccessSecretVersionResponse message. Also converts values to other types if specified. + * @param message AccessSecretVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessSecretVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessSecretVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSecretRequest. */ + interface IDeleteSecretRequest { + + /** DeleteSecretRequest name */ + name?: (string|null); + + /** DeleteSecretRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteSecretRequest. */ + class DeleteSecretRequest implements IDeleteSecretRequest { + + /** + * Constructs a new DeleteSecretRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IDeleteSecretRequest); + + /** DeleteSecretRequest name. */ + public name: string; + + /** DeleteSecretRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteSecretRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSecretRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IDeleteSecretRequest): google.cloud.secretmanager.v1beta2.DeleteSecretRequest; + + /** + * Encodes the specified DeleteSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DeleteSecretRequest.verify|verify} messages. + * @param message DeleteSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IDeleteSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DeleteSecretRequest.verify|verify} messages. + * @param message DeleteSecretRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IDeleteSecretRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSecretRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.DeleteSecretRequest; + + /** + * Decodes a DeleteSecretRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.DeleteSecretRequest; + + /** + * Verifies a DeleteSecretRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSecretRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSecretRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.DeleteSecretRequest; + + /** + * Creates a plain object from a DeleteSecretRequest message. Also converts values to other types if specified. + * @param message DeleteSecretRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.DeleteSecretRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSecretRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSecretRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableSecretVersionRequest. */ + interface IDisableSecretVersionRequest { + + /** DisableSecretVersionRequest name */ + name?: (string|null); + + /** DisableSecretVersionRequest etag */ + etag?: (string|null); + } + + /** Represents a DisableSecretVersionRequest. */ + class DisableSecretVersionRequest implements IDisableSecretVersionRequest { + + /** + * Constructs a new DisableSecretVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest); + + /** DisableSecretVersionRequest name. */ + public name: string; + + /** DisableSecretVersionRequest etag. */ + public etag: string; + + /** + * Creates a new DisableSecretVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableSecretVersionRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest): google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest; + + /** + * Encodes the specified DisableSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest.verify|verify} messages. + * @param message DisableSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest.verify|verify} messages. + * @param message DisableSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableSecretVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest; + + /** + * Decodes a DisableSecretVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest; + + /** + * Verifies a DisableSecretVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableSecretVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest; + + /** + * Creates a plain object from a DisableSecretVersionRequest message. Also converts values to other types if specified. + * @param message DisableSecretVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableSecretVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableSecretVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableSecretVersionRequest. */ + interface IEnableSecretVersionRequest { + + /** EnableSecretVersionRequest name */ + name?: (string|null); + + /** EnableSecretVersionRequest etag */ + etag?: (string|null); + } + + /** Represents an EnableSecretVersionRequest. */ + class EnableSecretVersionRequest implements IEnableSecretVersionRequest { + + /** + * Constructs a new EnableSecretVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest); + + /** EnableSecretVersionRequest name. */ + public name: string; + + /** EnableSecretVersionRequest etag. */ + public etag: string; + + /** + * Creates a new EnableSecretVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableSecretVersionRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest): google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest; + + /** + * Encodes the specified EnableSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest.verify|verify} messages. + * @param message EnableSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest.verify|verify} messages. + * @param message EnableSecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableSecretVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest; + + /** + * Decodes an EnableSecretVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest; + + /** + * Verifies an EnableSecretVersionRequest message. + * @param message Plain 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 EnableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableSecretVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest; + + /** + * Creates a plain object from an EnableSecretVersionRequest message. Also converts values to other types if specified. + * @param message EnableSecretVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableSecretVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableSecretVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DestroySecretVersionRequest. */ + interface IDestroySecretVersionRequest { + + /** DestroySecretVersionRequest name */ + name?: (string|null); + + /** DestroySecretVersionRequest etag */ + etag?: (string|null); + } + + /** Represents a DestroySecretVersionRequest. */ + class DestroySecretVersionRequest implements IDestroySecretVersionRequest { + + /** + * Constructs a new DestroySecretVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest); + + /** DestroySecretVersionRequest name. */ + public name: string; + + /** DestroySecretVersionRequest etag. */ + public etag: string; + + /** + * Creates a new DestroySecretVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DestroySecretVersionRequest instance + */ + public static create(properties?: google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest): google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest; + + /** + * Encodes the specified DestroySecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest.verify|verify} messages. + * @param message DestroySecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestroySecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest.verify|verify} messages. + * @param message DestroySecretVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestroySecretVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestroySecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest; + + /** + * Decodes a DestroySecretVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestroySecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest; + + /** + * Verifies a DestroySecretVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DestroySecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestroySecretVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest; + + /** + * Creates a plain object from a DestroySecretVersionRequest message. Also converts values to other types if specified. + * @param message DestroySecretVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestroySecretVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestroySecretVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } /** Namespace secrets. */ @@ -6186,7 +9744,8 @@ export namespace google { INPUT_ONLY = 4, IMMUTABLE = 5, UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7 + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 } /** Properties of a ResourceDescriptor. */ @@ -7090,6 +10649,9 @@ export namespace google { /** Publishing librarySettings */ librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); } /** Represents a Publishing. */ @@ -7128,6 +10690,9 @@ export namespace google { /** Publishing librarySettings. */ public librarySettings: google.api.IClientLibrarySettings[]; + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + /** * Creates a new Publishing instance using the specified properties. * @param [properties] Properties to set @@ -7708,6 +11273,21 @@ export namespace google { /** 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. */ @@ -7722,6 +11302,21 @@ export namespace google { /** 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 @@ -8002,6 +11597,9 @@ export namespace google { /** MethodSettings longRunning */ longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); } /** Represents a MethodSettings. */ @@ -8019,6 +11617,9 @@ export namespace google { /** 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 @@ -8221,7 +11822,10 @@ export namespace google { CLOUD = 1, ADS = 2, PHOTOS = 3, - STREET_VIEW = 4 + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 } /** ClientLibraryDestination enum. */ @@ -8344,6 +11948,21 @@ export namespace google { 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 { @@ -8384,7 +12003,7 @@ export namespace google { syntax?: (string|null); /** FileDescriptorProto edition */ - edition?: (string|null); + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); } /** Represents a FileDescriptorProto. */ @@ -8433,7 +12052,7 @@ export namespace google { public syntax: string; /** FileDescriptorProto edition. */ - public edition: string; + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); /** * Creates a new FileDescriptorProto instance using the specified properties. @@ -8884,6 +12503,15 @@ export namespace google { /** 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. */ @@ -8898,6 +12526,15 @@ export namespace google { /** 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 @@ -8976,6 +12613,136 @@ export namespace google { 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 { @@ -9160,8 +12927,8 @@ export namespace google { /** Label enum. */ enum Label { LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 } } @@ -9873,9 +13640,6 @@ export namespace google { /** FileOptions pyGenericServices */ pyGenericServices?: (boolean|null); - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); - /** FileOptions deprecated */ deprecated?: (boolean|null); @@ -9903,6 +13667,9 @@ export namespace google { /** FileOptions rubyPackage */ rubyPackage?: (string|null); + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -9949,9 +13716,6 @@ export namespace google { /** FileOptions pyGenericServices. */ public pyGenericServices: boolean; - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; - /** FileOptions deprecated. */ public deprecated: boolean; @@ -9979,6 +13743,9 @@ export namespace google { /** FileOptions rubyPackage. */ public rubyPackage: string; + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** FileOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -10088,6 +13855,9 @@ export namespace google { /** MessageOptions deprecatedLegacyJsonFieldConflicts */ deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -10119,6 +13889,9 @@ export namespace google { /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ public deprecatedLegacyJsonFieldConflicts: boolean; + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** MessageOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -10230,8 +14003,14 @@ export namespace google { /** FieldOptions retention */ retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - /** FieldOptions target */ - target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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); @@ -10279,8 +14058,14 @@ export namespace google { /** FieldOptions retention. */ public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - /** FieldOptions target. */ - public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + /** 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[]; @@ -10386,24 +14171,130 @@ export namespace google { 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 + /** 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); } @@ -10417,6 +14308,9 @@ export namespace google { */ constructor(properties?: google.protobuf.IOneofOptions); + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** OneofOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -10510,6 +14404,9 @@ export namespace google { /** EnumOptions deprecatedLegacyJsonFieldConflicts */ deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** EnumOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -10532,6 +14429,9 @@ export namespace google { /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ public deprecatedLegacyJsonFieldConflicts: boolean; + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** EnumOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -10619,6 +14519,12 @@ export namespace google { /** EnumValueOptions deprecated */ deprecated?: (boolean|null); + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -10635,6 +14541,12 @@ export namespace google { /** 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[]; @@ -10719,6 +14631,9 @@ export namespace google { /** Properties of a ServiceOptions. */ interface IServiceOptions { + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** ServiceOptions deprecated */ deprecated?: (boolean|null); @@ -10741,6 +14656,9 @@ export namespace google { */ constructor(properties?: google.protobuf.IServiceOptions); + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** ServiceOptions deprecated. */ public deprecated: boolean; @@ -10834,6 +14752,9 @@ export namespace google { /** 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); @@ -10859,6 +14780,9 @@ export namespace google { /** 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[]; @@ -11189,6 +15113,394 @@ export namespace google { } } + /** 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 { diff --git a/packages/google-cloud-secretmanager/protos/protos.js b/packages/google-cloud-secretmanager/protos/protos.js index 013745c7c94..4ede8be49ea 100644 --- a/packages/google-cloud-secretmanager/protos/protos.js +++ b/packages/google-cloud-secretmanager/protos/protos.js @@ -8151,49 +8151,49 @@ return v1; })(); - return secretmanager; - })(); - - cloud.secrets = (function() { - - /** - * Namespace secrets. - * @memberof google.cloud - * @namespace - */ - var secrets = {}; - - secrets.v1beta1 = (function() { + secretmanager.v1beta2 = (function() { /** - * Namespace v1beta1. - * @memberof google.cloud.secrets + * Namespace v1beta2. + * @memberof google.cloud.secretmanager * @namespace */ - var v1beta1 = {}; + var v1beta2 = {}; - v1beta1.Secret = (function() { + v1beta2.Secret = (function() { /** * Properties of a Secret. - * @memberof google.cloud.secrets.v1beta1 + * @memberof google.cloud.secretmanager.v1beta2 * @interface ISecret * @property {string|null} [name] Secret name - * @property {google.cloud.secrets.v1beta1.IReplication|null} [replication] Secret replication + * @property {google.cloud.secretmanager.v1beta2.IReplication|null} [replication] Secret replication * @property {google.protobuf.ITimestamp|null} [createTime] Secret createTime * @property {Object.|null} [labels] Secret labels + * @property {Array.|null} [topics] Secret topics + * @property {google.protobuf.ITimestamp|null} [expireTime] Secret expireTime + * @property {google.protobuf.IDuration|null} [ttl] Secret ttl + * @property {string|null} [etag] Secret etag + * @property {google.cloud.secretmanager.v1beta2.IRotation|null} [rotation] Secret rotation + * @property {Object.|null} [versionAliases] Secret versionAliases + * @property {Object.|null} [annotations] Secret annotations + * @property {google.protobuf.IDuration|null} [versionDestroyTtl] Secret versionDestroyTtl + * @property {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null} [customerManagedEncryption] Secret customerManagedEncryption */ /** * Constructs a new Secret. - * @memberof google.cloud.secrets.v1beta1 + * @memberof google.cloud.secretmanager.v1beta2 * @classdesc Represents a Secret. * @implements ISecret * @constructor - * @param {google.cloud.secrets.v1beta1.ISecret=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.ISecret=} [properties] Properties to set */ function Secret(properties) { this.labels = {}; + this.topics = []; + this.versionAliases = {}; + this.annotations = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8203,15 +8203,15 @@ /** * Secret name. * @member {string} name - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @instance */ Secret.prototype.name = ""; /** * Secret replication. - * @member {google.cloud.secrets.v1beta1.IReplication|null|undefined} replication - * @memberof google.cloud.secrets.v1beta1.Secret + * @member {google.cloud.secretmanager.v1beta2.IReplication|null|undefined} replication + * @memberof google.cloud.secretmanager.v1beta2.Secret * @instance */ Secret.prototype.replication = null; @@ -8219,7 +8219,7 @@ /** * Secret createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @instance */ Secret.prototype.createTime = null; @@ -8227,29 +8227,115 @@ /** * Secret labels. * @member {Object.} labels - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @instance */ Secret.prototype.labels = $util.emptyObject; + /** + * Secret topics. + * @member {Array.} topics + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.topics = $util.emptyArray; + + /** + * Secret expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.expireTime = null; + + /** + * Secret ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.ttl = null; + + /** + * Secret etag. + * @member {string} etag + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.etag = ""; + + /** + * Secret rotation. + * @member {google.cloud.secretmanager.v1beta2.IRotation|null|undefined} rotation + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.rotation = null; + + /** + * Secret versionAliases. + * @member {Object.} versionAliases + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.versionAliases = $util.emptyObject; + + /** + * Secret annotations. + * @member {Object.} annotations + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.annotations = $util.emptyObject; + + /** + * Secret versionDestroyTtl. + * @member {google.protobuf.IDuration|null|undefined} versionDestroyTtl + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.versionDestroyTtl = null; + + /** + * Secret customerManagedEncryption. + * @member {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null|undefined} customerManagedEncryption + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Secret.prototype.customerManagedEncryption = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Secret expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @instance + */ + Object.defineProperty(Secret.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Secret instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static - * @param {google.cloud.secrets.v1beta1.ISecret=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.Secret} Secret instance + * @param {google.cloud.secretmanager.v1beta2.ISecret=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.Secret} Secret instance */ Secret.create = function create(properties) { return new Secret(properties); }; /** - * Encodes the specified Secret message. Does not implicitly {@link google.cloud.secrets.v1beta1.Secret.verify|verify} messages. + * Encodes the specified Secret message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Secret.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static - * @param {google.cloud.secrets.v1beta1.ISecret} message Secret message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ISecret} message Secret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -8259,21 +8345,42 @@ if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.replication != null && Object.hasOwnProperty.call(message, "replication")) - $root.google.cloud.secrets.v1beta1.Replication.encode(message.replication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.secretmanager.v1beta2.Replication.encode(message.replication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); 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.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.topics != null && message.topics.length) + for (var i = 0; i < message.topics.length; ++i) + $root.google.cloud.secretmanager.v1beta2.Topic.encode(message.topics[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + if (message.rotation != null && Object.hasOwnProperty.call(message, "rotation")) + $root.google.cloud.secretmanager.v1beta2.Rotation.encode(message.rotation, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.versionAliases != null && Object.hasOwnProperty.call(message, "versionAliases")) + for (var keys = Object.keys(message.versionAliases), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.versionAliases[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.versionDestroyTtl != null && Object.hasOwnProperty.call(message, "versionDestroyTtl")) + $root.google.protobuf.Duration.encode(message.versionDestroyTtl, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.customerManagedEncryption != null && Object.hasOwnProperty.call(message, "customerManagedEncryption")) + $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.encode(message.customerManagedEncryption, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; /** - * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Secret.verify|verify} messages. + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Secret.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static - * @param {google.cloud.secrets.v1beta1.ISecret} message Secret message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ISecret} message Secret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -8284,18 +8391,18 @@ /** * Decodes a Secret message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.Secret} Secret + * @returns {google.cloud.secretmanager.v1beta2.Secret} Secret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Secret.decode = function 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.secrets.v1beta1.Secret(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.Secret(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8304,7 +8411,7 @@ break; } case 2: { - message.replication = $root.google.cloud.secrets.v1beta1.Replication.decode(reader, reader.uint32()); + message.replication = $root.google.cloud.secretmanager.v1beta2.Replication.decode(reader, reader.uint32()); break; } case 3: { @@ -8334,6 +8441,82 @@ message.labels[key] = value; break; } + case 5: { + if (!(message.topics && message.topics.length)) + message.topics = []; + message.topics.push($root.google.cloud.secretmanager.v1beta2.Topic.decode(reader, reader.uint32())); + break; + } + case 6: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + case 9: { + message.rotation = $root.google.cloud.secretmanager.v1beta2.Rotation.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.versionAliases === $util.emptyObject) + message.versionAliases = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.versionAliases[key] = value; + break; + } + case 13: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 14: { + message.versionDestroyTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 15: { + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8345,10 +8528,10 @@ /** * Decodes a Secret message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.Secret} Secret + * @returns {google.cloud.secretmanager.v1beta2.Secret} Secret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -8361,7 +8544,7 @@ /** * Verifies a Secret message. * @function verify - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -8369,11 +8552,12 @@ Secret.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.replication != null && message.hasOwnProperty("replication")) { - var error = $root.google.cloud.secrets.v1beta1.Replication.verify(message.replication); + var error = $root.google.cloud.secretmanager.v1beta2.Replication.verify(message.replication); if (error) return "replication." + error; } @@ -8390,49 +8574,168 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - return null; - }; - - /** - * Creates a Secret message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.secrets.v1beta1.Secret - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.Secret} Secret - */ - Secret.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.Secret) - return object; - var message = new $root.google.cloud.secrets.v1beta1.Secret(); - if (object.name != null) - message.name = String(object.name); - if (object.replication != null) { - if (typeof object.replication !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.Secret.replication: object expected"); - message.replication = $root.google.cloud.secrets.v1beta1.Replication.fromObject(object.replication); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.Secret.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + if (message.topics != null && message.hasOwnProperty("topics")) { + if (!Array.isArray(message.topics)) + return "topics: array expected"; + for (var i = 0; i < message.topics.length; ++i) { + var error = $root.google.cloud.secretmanager.v1beta2.Topic.verify(message.topics[i]); + if (error) + return "topics." + error; + } } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.Secret.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 (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } } - return message; - }; - + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.rotation != null && message.hasOwnProperty("rotation")) { + var error = $root.google.cloud.secretmanager.v1beta2.Rotation.verify(message.rotation); + if (error) + return "rotation." + error; + } + if (message.versionAliases != null && message.hasOwnProperty("versionAliases")) { + if (!$util.isObject(message.versionAliases)) + return "versionAliases: object expected"; + var key = Object.keys(message.versionAliases); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.versionAliases[key[i]]) && !(message.versionAliases[key[i]] && $util.isInteger(message.versionAliases[key[i]].low) && $util.isInteger(message.versionAliases[key[i]].high))) + return "versionAliases: integer|Long{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.versionDestroyTtl != null && message.hasOwnProperty("versionDestroyTtl")) { + var error = $root.google.protobuf.Duration.verify(message.versionDestroyTtl); + if (error) + return "versionDestroyTtl." + error; + } + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) { + var error = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.verify(message.customerManagedEncryption); + if (error) + return "customerManagedEncryption." + error; + } + return null; + }; + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.Secret + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.Secret} Secret + */ + Secret.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.Secret) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.Secret(); + if (object.name != null) + message.name = String(object.name); + if (object.replication != null) { + if (typeof object.replication !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.replication: object expected"); + message.replication = $root.google.cloud.secretmanager.v1beta2.Replication.fromObject(object.replication); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.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.topics) { + if (!Array.isArray(object.topics)) + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.topics: array expected"); + message.topics = []; + for (var i = 0; i < object.topics.length; ++i) { + if (typeof object.topics[i] !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.topics: object expected"); + message.topics[i] = $root.google.cloud.secretmanager.v1beta2.Topic.fromObject(object.topics[i]); + } + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.rotation != null) { + if (typeof object.rotation !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.rotation: object expected"); + message.rotation = $root.google.cloud.secretmanager.v1beta2.Rotation.fromObject(object.rotation); + } + if (object.versionAliases) { + if (typeof object.versionAliases !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.versionAliases: object expected"); + message.versionAliases = {}; + for (var keys = Object.keys(object.versionAliases), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.versionAliases[keys[i]] = $util.Long.fromValue(object.versionAliases[keys[i]])).unsigned = false; + else if (typeof object.versionAliases[keys[i]] === "string") + message.versionAliases[keys[i]] = parseInt(object.versionAliases[keys[i]], 10); + else if (typeof object.versionAliases[keys[i]] === "number") + message.versionAliases[keys[i]] = object.versionAliases[keys[i]]; + else if (typeof object.versionAliases[keys[i]] === "object") + message.versionAliases[keys[i]] = new $util.LongBits(object.versionAliases[keys[i]].low >>> 0, object.versionAliases[keys[i]].high >>> 0).toNumber(); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.versionDestroyTtl != null) { + if (typeof object.versionDestroyTtl !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.versionDestroyTtl: object expected"); + message.versionDestroyTtl = $root.google.protobuf.Duration.fromObject(object.versionDestroyTtl); + } + if (object.customerManagedEncryption != null) { + if (typeof object.customerManagedEncryption !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Secret.customerManagedEncryption: object expected"); + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.fromObject(object.customerManagedEncryption); + } + return message; + }; + /** * Creates a plain object from a Secret message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static - * @param {google.cloud.secrets.v1beta1.Secret} message Secret + * @param {google.cloud.secretmanager.v1beta2.Secret} message Secret * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -8440,17 +8743,26 @@ if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) + if (options.arrays || options.defaults) + object.topics = []; + if (options.objects || options.defaults) { object.labels = {}; + object.versionAliases = {}; + object.annotations = {}; + } if (options.defaults) { object.name = ""; object.replication = null; object.createTime = null; + object.etag = ""; + object.rotation = null; + object.versionDestroyTtl = null; + object.customerManagedEncryption = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.replication != null && message.hasOwnProperty("replication")) - object.replication = $root.google.cloud.secrets.v1beta1.Replication.toObject(message.replication, options); + object.replication = $root.google.cloud.secretmanager.v1beta2.Replication.toObject(message.replication, options); if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); var keys2; @@ -8459,13 +8771,49 @@ for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.topics && message.topics.length) { + object.topics = []; + for (var j = 0; j < message.topics.length; ++j) + object.topics[j] = $root.google.cloud.secretmanager.v1beta2.Topic.toObject(message.topics[j], options); + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.rotation != null && message.hasOwnProperty("rotation")) + object.rotation = $root.google.cloud.secretmanager.v1beta2.Rotation.toObject(message.rotation, options); + if (message.versionAliases && (keys2 = Object.keys(message.versionAliases)).length) { + object.versionAliases = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.versionAliases[keys2[j]] === "number") + object.versionAliases[keys2[j]] = options.longs === String ? String(message.versionAliases[keys2[j]]) : message.versionAliases[keys2[j]]; + else + object.versionAliases[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.versionAliases[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.versionAliases[keys2[j]].low >>> 0, message.versionAliases[keys2[j]].high >>> 0).toNumber() : message.versionAliases[keys2[j]]; + } + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.versionDestroyTtl != null && message.hasOwnProperty("versionDestroyTtl")) + object.versionDestroyTtl = $root.google.protobuf.Duration.toObject(message.versionDestroyTtl, options); + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) + object.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.toObject(message.customerManagedEncryption, options); return object; }; /** * Converts this Secret to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @instance * @returns {Object.} JSON object */ @@ -8476,7 +8824,7 @@ /** * Gets the default type url for Secret * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.Secret + * @memberof google.cloud.secretmanager.v1beta2.Secret * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -8485,31 +8833,36 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Secret"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.Secret"; }; return Secret; })(); - v1beta1.SecretVersion = (function() { + v1beta2.SecretVersion = (function() { /** * Properties of a SecretVersion. - * @memberof google.cloud.secrets.v1beta1 + * @memberof google.cloud.secretmanager.v1beta2 * @interface ISecretVersion * @property {string|null} [name] SecretVersion name * @property {google.protobuf.ITimestamp|null} [createTime] SecretVersion createTime * @property {google.protobuf.ITimestamp|null} [destroyTime] SecretVersion destroyTime - * @property {google.cloud.secrets.v1beta1.SecretVersion.State|null} [state] SecretVersion state + * @property {google.cloud.secretmanager.v1beta2.SecretVersion.State|null} [state] SecretVersion state + * @property {google.cloud.secretmanager.v1beta2.IReplicationStatus|null} [replicationStatus] SecretVersion replicationStatus + * @property {string|null} [etag] SecretVersion etag + * @property {boolean|null} [clientSpecifiedPayloadChecksum] SecretVersion clientSpecifiedPayloadChecksum + * @property {google.protobuf.ITimestamp|null} [scheduledDestroyTime] SecretVersion scheduledDestroyTime + * @property {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null} [customerManagedEncryption] SecretVersion customerManagedEncryption */ /** * Constructs a new SecretVersion. - * @memberof google.cloud.secrets.v1beta1 + * @memberof google.cloud.secretmanager.v1beta2 * @classdesc Represents a SecretVersion. * @implements ISecretVersion * @constructor - * @param {google.cloud.secrets.v1beta1.ISecretVersion=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.ISecretVersion=} [properties] Properties to set */ function SecretVersion(properties) { if (properties) @@ -8521,7 +8874,7 @@ /** * SecretVersion name. * @member {string} name - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @instance */ SecretVersion.prototype.name = ""; @@ -8529,7 +8882,7 @@ /** * SecretVersion createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @instance */ SecretVersion.prototype.createTime = null; @@ -8537,37 +8890,77 @@ /** * SecretVersion destroyTime. * @member {google.protobuf.ITimestamp|null|undefined} destroyTime - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @instance */ SecretVersion.prototype.destroyTime = null; /** * SecretVersion state. - * @member {google.cloud.secrets.v1beta1.SecretVersion.State} state - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @member {google.cloud.secretmanager.v1beta2.SecretVersion.State} state + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @instance */ SecretVersion.prototype.state = 0; + /** + * SecretVersion replicationStatus. + * @member {google.cloud.secretmanager.v1beta2.IReplicationStatus|null|undefined} replicationStatus + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion + * @instance + */ + SecretVersion.prototype.replicationStatus = null; + + /** + * SecretVersion etag. + * @member {string} etag + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion + * @instance + */ + SecretVersion.prototype.etag = ""; + + /** + * SecretVersion clientSpecifiedPayloadChecksum. + * @member {boolean} clientSpecifiedPayloadChecksum + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion + * @instance + */ + SecretVersion.prototype.clientSpecifiedPayloadChecksum = false; + + /** + * SecretVersion scheduledDestroyTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduledDestroyTime + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion + * @instance + */ + SecretVersion.prototype.scheduledDestroyTime = null; + + /** + * SecretVersion customerManagedEncryption. + * @member {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null|undefined} customerManagedEncryption + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion + * @instance + */ + SecretVersion.prototype.customerManagedEncryption = null; + /** * Creates a new SecretVersion instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static - * @param {google.cloud.secrets.v1beta1.ISecretVersion=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion instance + * @param {google.cloud.secretmanager.v1beta2.ISecretVersion=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.SecretVersion} SecretVersion instance */ SecretVersion.create = function create(properties) { return new SecretVersion(properties); }; /** - * Encodes the specified SecretVersion message. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretVersion.verify|verify} messages. + * Encodes the specified SecretVersion message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretVersion.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static - * @param {google.cloud.secrets.v1beta1.ISecretVersion} message SecretVersion message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ISecretVersion} message SecretVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -8582,15 +8975,25 @@ $root.google.protobuf.Timestamp.encode(message.destroyTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.replicationStatus != null && Object.hasOwnProperty.call(message, "replicationStatus")) + $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.encode(message.replicationStatus, 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.clientSpecifiedPayloadChecksum != null && Object.hasOwnProperty.call(message, "clientSpecifiedPayloadChecksum")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.clientSpecifiedPayloadChecksum); + if (message.scheduledDestroyTime != null && Object.hasOwnProperty.call(message, "scheduledDestroyTime")) + $root.google.protobuf.Timestamp.encode(message.scheduledDestroyTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.customerManagedEncryption != null && Object.hasOwnProperty.call(message, "customerManagedEncryption")) + $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.encode(message.customerManagedEncryption, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; /** - * Encodes the specified SecretVersion message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretVersion.verify|verify} messages. + * Encodes the specified SecretVersion message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretVersion.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static - * @param {google.cloud.secrets.v1beta1.ISecretVersion} message SecretVersion message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ISecretVersion} message SecretVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -8601,18 +9004,18 @@ /** * Decodes a SecretVersion message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion + * @returns {google.cloud.secretmanager.v1beta2.SecretVersion} SecretVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SecretVersion.decode = function 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.secrets.v1beta1.SecretVersion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.SecretVersion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8632,6 +9035,26 @@ message.state = reader.int32(); break; } + case 5: { + message.replicationStatus = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + case 7: { + message.clientSpecifiedPayloadChecksum = reader.bool(); + break; + } + case 8: { + message.scheduledDestroyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8643,10 +9066,10 @@ /** * Decodes a SecretVersion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion + * @returns {google.cloud.secretmanager.v1beta2.SecretVersion} SecretVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -8659,7 +9082,7 @@ /** * Verifies a SecretVersion message. * @function verify - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -8690,31 +9113,52 @@ case 3: break; } + if (message.replicationStatus != null && message.hasOwnProperty("replicationStatus")) { + var error = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.verify(message.replicationStatus); + if (error) + return "replicationStatus." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.clientSpecifiedPayloadChecksum != null && message.hasOwnProperty("clientSpecifiedPayloadChecksum")) + if (typeof message.clientSpecifiedPayloadChecksum !== "boolean") + return "clientSpecifiedPayloadChecksum: boolean expected"; + if (message.scheduledDestroyTime != null && message.hasOwnProperty("scheduledDestroyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduledDestroyTime); + if (error) + return "scheduledDestroyTime." + error; + } + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) { + var error = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.verify(message.customerManagedEncryption); + if (error) + return "customerManagedEncryption." + error; + } return null; }; /** * Creates a SecretVersion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion + * @returns {google.cloud.secretmanager.v1beta2.SecretVersion} SecretVersion */ SecretVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.SecretVersion) + if (object instanceof $root.google.cloud.secretmanager.v1beta2.SecretVersion) return object; - var message = new $root.google.cloud.secrets.v1beta1.SecretVersion(); + var message = new $root.google.cloud.secretmanager.v1beta2.SecretVersion(); if (object.name != null) message.name = String(object.name); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.SecretVersion.createTime: object expected"); + throw TypeError(".google.cloud.secretmanager.v1beta2.SecretVersion.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.destroyTime != null) { if (typeof object.destroyTime !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.SecretVersion.destroyTime: object expected"); + throw TypeError(".google.cloud.secretmanager.v1beta2.SecretVersion.destroyTime: object expected"); message.destroyTime = $root.google.protobuf.Timestamp.fromObject(object.destroyTime); } switch (object.state) { @@ -8741,15 +9185,34 @@ message.state = 3; break; } - return message; - }; - - /** - * Creates a plain object from a SecretVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.secrets.v1beta1.SecretVersion + if (object.replicationStatus != null) { + if (typeof object.replicationStatus !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.SecretVersion.replicationStatus: object expected"); + message.replicationStatus = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.fromObject(object.replicationStatus); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.clientSpecifiedPayloadChecksum != null) + message.clientSpecifiedPayloadChecksum = Boolean(object.clientSpecifiedPayloadChecksum); + if (object.scheduledDestroyTime != null) { + if (typeof object.scheduledDestroyTime !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.SecretVersion.scheduledDestroyTime: object expected"); + message.scheduledDestroyTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledDestroyTime); + } + if (object.customerManagedEncryption != null) { + if (typeof object.customerManagedEncryption !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.SecretVersion.customerManagedEncryption: object expected"); + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.fromObject(object.customerManagedEncryption); + } + return message; + }; + + /** + * Creates a plain object from a SecretVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static - * @param {google.cloud.secrets.v1beta1.SecretVersion} message SecretVersion + * @param {google.cloud.secretmanager.v1beta2.SecretVersion} message SecretVersion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -8762,6 +9225,11 @@ object.createTime = null; object.destroyTime = null; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.replicationStatus = null; + object.etag = ""; + object.clientSpecifiedPayloadChecksum = false; + object.scheduledDestroyTime = null; + object.customerManagedEncryption = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8770,14 +9238,24 @@ if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) object.destroyTime = $root.google.protobuf.Timestamp.toObject(message.destroyTime, options); if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.secrets.v1beta1.SecretVersion.State[message.state] === undefined ? message.state : $root.google.cloud.secrets.v1beta1.SecretVersion.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.secretmanager.v1beta2.SecretVersion.State[message.state] === undefined ? message.state : $root.google.cloud.secretmanager.v1beta2.SecretVersion.State[message.state] : message.state; + if (message.replicationStatus != null && message.hasOwnProperty("replicationStatus")) + object.replicationStatus = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.toObject(message.replicationStatus, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.clientSpecifiedPayloadChecksum != null && message.hasOwnProperty("clientSpecifiedPayloadChecksum")) + object.clientSpecifiedPayloadChecksum = message.clientSpecifiedPayloadChecksum; + if (message.scheduledDestroyTime != null && message.hasOwnProperty("scheduledDestroyTime")) + object.scheduledDestroyTime = $root.google.protobuf.Timestamp.toObject(message.scheduledDestroyTime, options); + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) + object.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.toObject(message.customerManagedEncryption, options); return object; }; /** * Converts this SecretVersion to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @instance * @returns {Object.} JSON object */ @@ -8788,7 +9266,7 @@ /** * Gets the default type url for SecretVersion * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretVersion * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -8797,12 +9275,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.SecretVersion"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.SecretVersion"; }; /** * State enum. - * @name google.cloud.secrets.v1beta1.SecretVersion.State + * @name google.cloud.secretmanager.v1beta2.SecretVersion.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} ENABLED=1 ENABLED value @@ -8821,23 +9299,23 @@ return SecretVersion; })(); - v1beta1.Replication = (function() { + v1beta2.Replication = (function() { /** * Properties of a Replication. - * @memberof google.cloud.secrets.v1beta1 + * @memberof google.cloud.secretmanager.v1beta2 * @interface IReplication - * @property {google.cloud.secrets.v1beta1.Replication.IAutomatic|null} [automatic] Replication automatic - * @property {google.cloud.secrets.v1beta1.Replication.IUserManaged|null} [userManaged] Replication userManaged + * @property {google.cloud.secretmanager.v1beta2.Replication.IAutomatic|null} [automatic] Replication automatic + * @property {google.cloud.secretmanager.v1beta2.Replication.IUserManaged|null} [userManaged] Replication userManaged */ /** * Constructs a new Replication. - * @memberof google.cloud.secrets.v1beta1 + * @memberof google.cloud.secretmanager.v1beta2 * @classdesc Represents a Replication. * @implements IReplication * @constructor - * @param {google.cloud.secrets.v1beta1.IReplication=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IReplication=} [properties] Properties to set */ function Replication(properties) { if (properties) @@ -8848,16 +9326,16 @@ /** * Replication automatic. - * @member {google.cloud.secrets.v1beta1.Replication.IAutomatic|null|undefined} automatic - * @memberof google.cloud.secrets.v1beta1.Replication + * @member {google.cloud.secretmanager.v1beta2.Replication.IAutomatic|null|undefined} automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication * @instance */ Replication.prototype.automatic = null; /** * Replication userManaged. - * @member {google.cloud.secrets.v1beta1.Replication.IUserManaged|null|undefined} userManaged - * @memberof google.cloud.secrets.v1beta1.Replication + * @member {google.cloud.secretmanager.v1beta2.Replication.IUserManaged|null|undefined} userManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication * @instance */ Replication.prototype.userManaged = null; @@ -8868,7 +9346,7 @@ /** * Replication replication. * @member {"automatic"|"userManaged"|undefined} replication - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @instance */ Object.defineProperty(Replication.prototype, "replication", { @@ -8879,21 +9357,21 @@ /** * Creates a new Replication instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static - * @param {google.cloud.secrets.v1beta1.IReplication=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.Replication} Replication instance + * @param {google.cloud.secretmanager.v1beta2.IReplication=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.Replication} Replication instance */ Replication.create = function create(properties) { return new Replication(properties); }; /** - * Encodes the specified Replication message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.verify|verify} messages. + * Encodes the specified Replication message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static - * @param {google.cloud.secrets.v1beta1.IReplication} message Replication message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IReplication} message Replication message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -8901,18 +9379,18 @@ if (!writer) writer = $Writer.create(); if (message.automatic != null && Object.hasOwnProperty.call(message, "automatic")) - $root.google.cloud.secrets.v1beta1.Replication.Automatic.encode(message.automatic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.secretmanager.v1beta2.Replication.Automatic.encode(message.automatic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.userManaged != null && Object.hasOwnProperty.call(message, "userManaged")) - $root.google.cloud.secrets.v1beta1.Replication.UserManaged.encode(message.userManaged, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.encode(message.userManaged, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Replication message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.verify|verify} messages. + * Encodes the specified Replication message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static - * @param {google.cloud.secrets.v1beta1.IReplication} message Replication message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IReplication} message Replication message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -8923,27 +9401,27 @@ /** * Decodes a Replication message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.Replication} Replication + * @returns {google.cloud.secretmanager.v1beta2.Replication} Replication * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Replication.decode = function 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.secrets.v1beta1.Replication(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.Replication(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.automatic = $root.google.cloud.secrets.v1beta1.Replication.Automatic.decode(reader, reader.uint32()); + message.automatic = $root.google.cloud.secretmanager.v1beta2.Replication.Automatic.decode(reader, reader.uint32()); break; } case 2: { - message.userManaged = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.decode(reader, reader.uint32()); + message.userManaged = $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.decode(reader, reader.uint32()); break; } default: @@ -8957,10 +9435,10 @@ /** * Decodes a Replication message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.Replication} Replication + * @returns {google.cloud.secretmanager.v1beta2.Replication} Replication * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -8973,7 +9451,7 @@ /** * Verifies a Replication message. * @function verify - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -8985,7 +9463,7 @@ if (message.automatic != null && message.hasOwnProperty("automatic")) { properties.replication = 1; { - var error = $root.google.cloud.secrets.v1beta1.Replication.Automatic.verify(message.automatic); + var error = $root.google.cloud.secretmanager.v1beta2.Replication.Automatic.verify(message.automatic); if (error) return "automatic." + error; } @@ -8995,7 +9473,7 @@ return "replication: multiple values"; properties.replication = 1; { - var error = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.verify(message.userManaged); + var error = $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.verify(message.userManaged); if (error) return "userManaged." + error; } @@ -9006,24 +9484,24 @@ /** * Creates a Replication message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.Replication} Replication + * @returns {google.cloud.secretmanager.v1beta2.Replication} Replication */ Replication.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.Replication) + if (object instanceof $root.google.cloud.secretmanager.v1beta2.Replication) return object; - var message = new $root.google.cloud.secrets.v1beta1.Replication(); + var message = new $root.google.cloud.secretmanager.v1beta2.Replication(); if (object.automatic != null) { if (typeof object.automatic !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.Replication.automatic: object expected"); - message.automatic = $root.google.cloud.secrets.v1beta1.Replication.Automatic.fromObject(object.automatic); + throw TypeError(".google.cloud.secretmanager.v1beta2.Replication.automatic: object expected"); + message.automatic = $root.google.cloud.secretmanager.v1beta2.Replication.Automatic.fromObject(object.automatic); } if (object.userManaged != null) { if (typeof object.userManaged !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.Replication.userManaged: object expected"); - message.userManaged = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.fromObject(object.userManaged); + throw TypeError(".google.cloud.secretmanager.v1beta2.Replication.userManaged: object expected"); + message.userManaged = $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.fromObject(object.userManaged); } return message; }; @@ -9031,9 +9509,9 @@ /** * Creates a plain object from a Replication message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static - * @param {google.cloud.secrets.v1beta1.Replication} message Replication + * @param {google.cloud.secretmanager.v1beta2.Replication} message Replication * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -9042,12 +9520,12 @@ options = {}; var object = {}; if (message.automatic != null && message.hasOwnProperty("automatic")) { - object.automatic = $root.google.cloud.secrets.v1beta1.Replication.Automatic.toObject(message.automatic, options); + object.automatic = $root.google.cloud.secretmanager.v1beta2.Replication.Automatic.toObject(message.automatic, options); if (options.oneofs) object.replication = "automatic"; } if (message.userManaged != null && message.hasOwnProperty("userManaged")) { - object.userManaged = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.toObject(message.userManaged, options); + object.userManaged = $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.toObject(message.userManaged, options); if (options.oneofs) object.replication = "userManaged"; } @@ -9057,7 +9535,7 @@ /** * Converts this Replication to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @instance * @returns {Object.} JSON object */ @@ -9068,7 +9546,7 @@ /** * Gets the default type url for Replication * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -9077,24 +9555,25 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.Replication"; }; Replication.Automatic = (function() { /** * Properties of an Automatic. - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @interface IAutomatic + * @property {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null} [customerManagedEncryption] Automatic customerManagedEncryption */ /** * Constructs a new Automatic. - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @classdesc Represents an Automatic. * @implements IAutomatic * @constructor - * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.Replication.IAutomatic=} [properties] Properties to set */ function Automatic(properties) { if (properties) @@ -9103,39 +9582,49 @@ this[keys[i]] = properties[keys[i]]; } + /** + * Automatic customerManagedEncryption. + * @member {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null|undefined} customerManagedEncryption + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic + * @instance + */ + Automatic.prototype.customerManagedEncryption = null; + /** * Creates a new Automatic instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static - * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic instance + * @param {google.cloud.secretmanager.v1beta2.Replication.IAutomatic=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.Replication.Automatic} Automatic instance */ Automatic.create = function create(properties) { return new Automatic(properties); }; /** - * Encodes the specified Automatic message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.Automatic.verify|verify} messages. + * Encodes the specified Automatic message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.Automatic.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static - * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic} message Automatic message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.Replication.IAutomatic} message Automatic message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Automatic.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.customerManagedEncryption != null && Object.hasOwnProperty.call(message, "customerManagedEncryption")) + $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.encode(message.customerManagedEncryption, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Automatic message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.Automatic.verify|verify} messages. + * Encodes the specified Automatic message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.Automatic.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static - * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic} message Automatic message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.Replication.IAutomatic} message Automatic message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -9146,21 +9635,25 @@ /** * Decodes an Automatic message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic + * @returns {google.cloud.secretmanager.v1beta2.Replication.Automatic} Automatic * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Automatic.decode = function 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.secrets.v1beta1.Replication.Automatic(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.Replication.Automatic(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9172,10 +9665,10 @@ /** * Decodes an Automatic message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic + * @returns {google.cloud.secretmanager.v1beta2.Replication.Automatic} Automatic * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -9188,7 +9681,7 @@ /** * Verifies an Automatic message. * @function verify - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -9196,40 +9689,58 @@ Automatic.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) { + var error = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.verify(message.customerManagedEncryption); + if (error) + return "customerManagedEncryption." + error; + } return null; }; /** * Creates an Automatic message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic + * @returns {google.cloud.secretmanager.v1beta2.Replication.Automatic} Automatic */ Automatic.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.Replication.Automatic) + if (object instanceof $root.google.cloud.secretmanager.v1beta2.Replication.Automatic) return object; - return new $root.google.cloud.secrets.v1beta1.Replication.Automatic(); + var message = new $root.google.cloud.secretmanager.v1beta2.Replication.Automatic(); + if (object.customerManagedEncryption != null) { + if (typeof object.customerManagedEncryption !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Replication.Automatic.customerManagedEncryption: object expected"); + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.fromObject(object.customerManagedEncryption); + } + return message; }; /** * Creates a plain object from an Automatic message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static - * @param {google.cloud.secrets.v1beta1.Replication.Automatic} message Automatic + * @param {google.cloud.secretmanager.v1beta2.Replication.Automatic} message Automatic * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Automatic.toObject = function toObject() { - return {}; + Automatic.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.customerManagedEncryption = null; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) + object.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.toObject(message.customerManagedEncryption, options); + return object; }; /** * Converts this Automatic to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @instance * @returns {Object.} JSON object */ @@ -9240,7 +9751,7 @@ /** * Gets the default type url for Automatic * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @memberof google.cloud.secretmanager.v1beta2.Replication.Automatic * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -9249,7 +9760,7 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication.Automatic"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.Replication.Automatic"; }; return Automatic; @@ -9259,18 +9770,18 @@ /** * Properties of a UserManaged. - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @interface IUserManaged - * @property {Array.|null} [replicas] UserManaged replicas + * @property {Array.|null} [replicas] UserManaged replicas */ /** * Constructs a new UserManaged. - * @memberof google.cloud.secrets.v1beta1.Replication + * @memberof google.cloud.secretmanager.v1beta2.Replication * @classdesc Represents a UserManaged. * @implements IUserManaged * @constructor - * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.Replication.IUserManaged=} [properties] Properties to set */ function UserManaged(properties) { this.replicas = []; @@ -9282,8 +9793,8 @@ /** * UserManaged replicas. - * @member {Array.} replicas - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @member {Array.} replicas + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @instance */ UserManaged.prototype.replicas = $util.emptyArray; @@ -9291,21 +9802,21 @@ /** * Creates a new UserManaged instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static - * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged instance + * @param {google.cloud.secretmanager.v1beta2.Replication.IUserManaged=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged} UserManaged instance */ UserManaged.create = function create(properties) { return new UserManaged(properties); }; /** - * Encodes the specified UserManaged message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.verify|verify} messages. + * Encodes the specified UserManaged message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static - * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged} message UserManaged message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.Replication.IUserManaged} message UserManaged message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -9314,16 +9825,16 @@ writer = $Writer.create(); if (message.replicas != null && message.replicas.length) for (var i = 0; i < message.replicas.length; ++i) - $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.encode(message.replicas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.encode(message.replicas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UserManaged message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.verify|verify} messages. + * Encodes the specified UserManaged message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static - * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged} message UserManaged message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.Replication.IUserManaged} message UserManaged message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -9334,25 +9845,25 @@ /** * Decodes a UserManaged message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged} UserManaged * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UserManaged.decode = function 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.secrets.v1beta1.Replication.UserManaged(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.replicas && message.replicas.length)) message.replicas = []; - message.replicas.push($root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.decode(reader, reader.uint32())); + message.replicas.push($root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.decode(reader, reader.uint32())); break; } default: @@ -9366,10 +9877,10 @@ /** * Decodes a UserManaged message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged} UserManaged * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -9382,7 +9893,7 @@ /** * Verifies a UserManaged message. * @function verify - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -9394,7 +9905,7 @@ if (!Array.isArray(message.replicas)) return "replicas: array expected"; for (var i = 0; i < message.replicas.length; ++i) { - var error = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.verify(message.replicas[i]); + var error = $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.verify(message.replicas[i]); if (error) return "replicas." + error; } @@ -9405,23 +9916,23 @@ /** * Creates a UserManaged message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged} UserManaged */ UserManaged.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.Replication.UserManaged) + if (object instanceof $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged) return object; - var message = new $root.google.cloud.secrets.v1beta1.Replication.UserManaged(); + var message = new $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged(); if (object.replicas) { if (!Array.isArray(object.replicas)) - throw TypeError(".google.cloud.secrets.v1beta1.Replication.UserManaged.replicas: array expected"); + throw TypeError(".google.cloud.secretmanager.v1beta2.Replication.UserManaged.replicas: array expected"); message.replicas = []; for (var i = 0; i < object.replicas.length; ++i) { if (typeof object.replicas[i] !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.Replication.UserManaged.replicas: object expected"); - message.replicas[i] = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.fromObject(object.replicas[i]); + throw TypeError(".google.cloud.secretmanager.v1beta2.Replication.UserManaged.replicas: object expected"); + message.replicas[i] = $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.fromObject(object.replicas[i]); } } return message; @@ -9430,9 +9941,9 @@ /** * Creates a plain object from a UserManaged message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static - * @param {google.cloud.secrets.v1beta1.Replication.UserManaged} message UserManaged + * @param {google.cloud.secretmanager.v1beta2.Replication.UserManaged} message UserManaged * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -9445,7 +9956,7 @@ if (message.replicas && message.replicas.length) { object.replicas = []; for (var j = 0; j < message.replicas.length; ++j) - object.replicas[j] = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.toObject(message.replicas[j], options); + object.replicas[j] = $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.toObject(message.replicas[j], options); } return object; }; @@ -9453,7 +9964,7 @@ /** * Converts this UserManaged to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @instance * @returns {Object.} JSON object */ @@ -9464,7 +9975,7 @@ /** * Gets the default type url for UserManaged * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -9473,25 +9984,26 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication.UserManaged"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.Replication.UserManaged"; }; UserManaged.Replica = (function() { /** * Properties of a Replica. - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @interface IReplica * @property {string|null} [location] Replica location + * @property {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null} [customerManagedEncryption] Replica customerManagedEncryption */ /** * Constructs a new Replica. - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged * @classdesc Represents a Replica. * @implements IReplica * @constructor - * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica=} [properties] Properties to set */ function Replica(properties) { if (properties) @@ -9503,29 +10015,37 @@ /** * Replica location. * @member {string} location - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @instance */ Replica.prototype.location = ""; + /** + * Replica customerManagedEncryption. + * @member {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption|null|undefined} customerManagedEncryption + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica + * @instance + */ + Replica.prototype.customerManagedEncryption = null; + /** * Creates a new Replica instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static - * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica instance + * @param {google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica} Replica instance */ Replica.create = function create(properties) { return new Replica(properties); }; /** - * Encodes the specified Replica message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.verify|verify} messages. + * Encodes the specified Replica message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static - * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica} message Replica message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica} message Replica message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -9534,15 +10054,17 @@ writer = $Writer.create(); if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.customerManagedEncryption != null && Object.hasOwnProperty.call(message, "customerManagedEncryption")) + $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.encode(message.customerManagedEncryption, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Replica message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.verify|verify} messages. + * Encodes the specified Replica message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static - * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica} message Replica message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.Replication.UserManaged.IReplica} message Replica message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -9553,18 +10075,18 @@ /** * Decodes a Replica message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica} Replica * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Replica.decode = function 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.secrets.v1beta1.Replication.UserManaged.Replica(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9572,6 +10094,10 @@ message.location = reader.string(); break; } + case 2: { + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9583,10 +10109,10 @@ /** * Decodes a Replica message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica} Replica * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -9599,7 +10125,7 @@ /** * Verifies a Replica message. * @function verify - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -9610,32 +10136,42 @@ if (message.location != null && message.hasOwnProperty("location")) if (!$util.isString(message.location)) return "location: string expected"; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) { + var error = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.verify(message.customerManagedEncryption); + if (error) + return "customerManagedEncryption." + error; + } return null; }; /** * Creates a Replica message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica + * @returns {google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica} Replica */ Replica.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica) + if (object instanceof $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica) return object; - var message = new $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica(); + var message = new $root.google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica(); if (object.location != null) message.location = String(object.location); + if (object.customerManagedEncryption != null) { + if (typeof object.customerManagedEncryption !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica.customerManagedEncryption: object expected"); + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.fromObject(object.customerManagedEncryption); + } return message; }; /** * Creates a plain object from a Replica message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static - * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} message Replica + * @param {google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica} message Replica * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -9643,17 +10179,21 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.location = ""; + object.customerManagedEncryption = null; + } if (message.location != null && message.hasOwnProperty("location")) object.location = message.location; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) + object.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.toObject(message.customerManagedEncryption, options); return object; }; /** * Converts this Replica to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @instance * @returns {Object.} JSON object */ @@ -9664,7 +10204,7 @@ /** * Gets the default type url for Replica * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @memberof google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -9673,7 +10213,7 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication.UserManaged.Replica"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica"; }; return Replica; @@ -9685,24 +10225,24 @@ return Replication; })(); - v1beta1.SecretPayload = (function() { + v1beta2.CustomerManagedEncryption = (function() { /** - * Properties of a SecretPayload. - * @memberof google.cloud.secrets.v1beta1 - * @interface ISecretPayload - * @property {Uint8Array|null} [data] SecretPayload data + * Properties of a CustomerManagedEncryption. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface ICustomerManagedEncryption + * @property {string|null} [kmsKeyName] CustomerManagedEncryption kmsKeyName */ /** - * Constructs a new SecretPayload. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a SecretPayload. - * @implements ISecretPayload + * Constructs a new CustomerManagedEncryption. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a CustomerManagedEncryption. + * @implements ICustomerManagedEncryption * @constructor - * @param {google.cloud.secrets.v1beta1.ISecretPayload=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption=} [properties] Properties to set */ - function SecretPayload(properties) { + function CustomerManagedEncryption(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9710,75 +10250,75 @@ } /** - * SecretPayload data. - * @member {Uint8Array} data - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * CustomerManagedEncryption kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @instance */ - SecretPayload.prototype.data = $util.newBuffer([]); + CustomerManagedEncryption.prototype.kmsKeyName = ""; /** - * Creates a new SecretPayload instance using the specified properties. + * Creates a new CustomerManagedEncryption instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static - * @param {google.cloud.secrets.v1beta1.ISecretPayload=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload instance + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryption} CustomerManagedEncryption instance */ - SecretPayload.create = function create(properties) { - return new SecretPayload(properties); + CustomerManagedEncryption.create = function create(properties) { + return new CustomerManagedEncryption(properties); }; /** - * Encodes the specified SecretPayload message. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretPayload.verify|verify} messages. + * Encodes the specified CustomerManagedEncryption message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static - * @param {google.cloud.secrets.v1beta1.ISecretPayload} message SecretPayload message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption} message CustomerManagedEncryption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecretPayload.encode = function encode(message, writer) { + CustomerManagedEncryption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); return writer; }; /** - * Encodes the specified SecretPayload message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretPayload.verify|verify} messages. + * Encodes the specified CustomerManagedEncryption message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryption.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static - * @param {google.cloud.secrets.v1beta1.ISecretPayload} message SecretPayload message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryption} message CustomerManagedEncryption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecretPayload.encodeDelimited = function encodeDelimited(message, writer) { + CustomerManagedEncryption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SecretPayload message from the specified reader or buffer. + * Decodes a CustomerManagedEncryption message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryption} CustomerManagedEncryption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecretPayload.decode = function decode(reader, length) { + CustomerManagedEncryption.decode = function 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.secrets.v1beta1.SecretPayload(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.data = reader.bytes(); + message.kmsKeyName = reader.string(); break; } default: @@ -9790,663 +10330,1048 @@ }; /** - * Decodes a SecretPayload message from the specified reader or buffer, length delimited. + * Decodes a CustomerManagedEncryption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryption} CustomerManagedEncryption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecretPayload.decodeDelimited = function decodeDelimited(reader) { + CustomerManagedEncryption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SecretPayload message. + * Verifies a CustomerManagedEncryption message. * @function verify - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SecretPayload.verify = function verify(message) { + CustomerManagedEncryption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; /** - * Creates a SecretPayload message from a plain object. Also converts values to their respective internal types. + * Creates a CustomerManagedEncryption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryption} CustomerManagedEncryption */ - SecretPayload.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.SecretPayload) + CustomerManagedEncryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption) return object; - var message = new $root.google.cloud.secrets.v1beta1.SecretPayload(); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; + var message = new $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryption(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; /** - * Creates a plain object from a SecretPayload message. Also converts values to other types if specified. + * Creates a plain object from a CustomerManagedEncryption message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static - * @param {google.cloud.secrets.v1beta1.SecretPayload} message SecretPayload + * @param {google.cloud.secretmanager.v1beta2.CustomerManagedEncryption} message CustomerManagedEncryption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SecretPayload.toObject = function toObject(message, options) { + CustomerManagedEncryption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; return object; }; /** - * Converts this SecretPayload to JSON. + * Converts this CustomerManagedEncryption to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @instance * @returns {Object.} JSON object */ - SecretPayload.prototype.toJSON = function toJSON() { + CustomerManagedEncryption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SecretPayload + * Gets the default type url for CustomerManagedEncryption * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryption * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SecretPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CustomerManagedEncryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.SecretPayload"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.CustomerManagedEncryption"; }; - return SecretPayload; + return CustomerManagedEncryption; })(); - v1beta1.SecretManagerService = (function() { - - /** - * Constructs a new SecretManagerService service. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a SecretManagerService - * @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 SecretManagerService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SecretManagerService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecretManagerService; + v1beta2.ReplicationStatus = (function() { /** - * Creates new SecretManagerService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @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 {SecretManagerService} RPC service. Useful where requests and/or responses are streamed. + * Properties of a ReplicationStatus. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IReplicationStatus + * @property {google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus|null} [automatic] ReplicationStatus automatic + * @property {google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus|null} [userManaged] ReplicationStatus userManaged */ - SecretManagerService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|listSecrets}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef ListSecretsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.ListSecretsResponse} [response] ListSecretsResponse + * Constructs a new ReplicationStatus. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a ReplicationStatus. + * @implements IReplicationStatus + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IReplicationStatus=} [properties] Properties to set */ + function ReplicationStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListSecrets. - * @function listSecrets - * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * ReplicationStatus automatic. + * @member {google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus|null|undefined} automatic + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus * @instance - * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} request ListSecretsRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.ListSecretsCallback} callback Node-style callback called with the error, if any, and ListSecretsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecretManagerService.prototype.listSecrets = function listSecrets(request, callback) { - return this.rpcCall(listSecrets, $root.google.cloud.secrets.v1beta1.ListSecretsRequest, $root.google.cloud.secrets.v1beta1.ListSecretsResponse, request, callback); - }, "name", { value: "ListSecrets" }); + ReplicationStatus.prototype.automatic = null; /** - * Calls ListSecrets. - * @function listSecrets - * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * ReplicationStatus userManaged. + * @member {google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus|null|undefined} userManaged + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus * @instance - * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} request ListSecretsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ReplicationStatus.prototype.userManaged = null; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|createSecret}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef CreateSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.Secret} [response] Secret - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls CreateSecret. - * @function createSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * ReplicationStatus replicationStatus. + * @member {"automatic"|"userManaged"|undefined} replicationStatus + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus * @instance - * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} request CreateSecretRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.CreateSecretCallback} callback Node-style callback called with the error, if any, and Secret - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecretManagerService.prototype.createSecret = function createSecret(request, callback) { - return this.rpcCall(createSecret, $root.google.cloud.secrets.v1beta1.CreateSecretRequest, $root.google.cloud.secrets.v1beta1.Secret, request, callback); - }, "name", { value: "CreateSecret" }); + Object.defineProperty(ReplicationStatus.prototype, "replicationStatus", { + get: $util.oneOfGetter($oneOfFields = ["automatic", "userManaged"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Calls CreateSecret. - * @function createSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} request CreateSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new ReplicationStatus instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.IReplicationStatus=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus} ReplicationStatus instance */ + ReplicationStatus.create = function create(properties) { + return new ReplicationStatus(properties); + }; /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|addSecretVersion}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef AddSecretVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion + * Encodes the specified ReplicationStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.IReplicationStatus} message ReplicationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ReplicationStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.automatic != null && Object.hasOwnProperty.call(message, "automatic")) + $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.encode(message.automatic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.userManaged != null && Object.hasOwnProperty.call(message, "userManaged")) + $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.encode(message.userManaged, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls AddSecretVersion. - * @function addSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} request AddSecretVersionRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.AddSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion - * @returns {undefined} - * @variation 1 + * Encodes the specified ReplicationStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.IReplicationStatus} message ReplicationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecretManagerService.prototype.addSecretVersion = function addSecretVersion(request, callback) { - return this.rpcCall(addSecretVersion, $root.google.cloud.secrets.v1beta1.AddSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); - }, "name", { value: "AddSecretVersion" }); + ReplicationStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls AddSecretVersion. - * @function addSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} request AddSecretVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a ReplicationStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus} ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ReplicationStatus.decode = function 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.secretmanager.v1beta2.ReplicationStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.automatic = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.decode(reader, reader.uint32()); + break; + } + case 2: { + message.userManaged = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|getSecret}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef GetSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.Secret} [response] Secret + * Decodes a ReplicationStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus} ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ReplicationStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetSecret. - * @function getSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} request GetSecretRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.GetSecretCallback} callback Node-style callback called with the error, if any, and Secret - * @returns {undefined} - * @variation 1 + * Verifies a ReplicationStatus message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecretManagerService.prototype.getSecret = function getSecret(request, callback) { - return this.rpcCall(getSecret, $root.google.cloud.secrets.v1beta1.GetSecretRequest, $root.google.cloud.secrets.v1beta1.Secret, request, callback); - }, "name", { value: "GetSecret" }); + ReplicationStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.automatic != null && message.hasOwnProperty("automatic")) { + properties.replicationStatus = 1; + { + var error = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.verify(message.automatic); + if (error) + return "automatic." + error; + } + } + if (message.userManaged != null && message.hasOwnProperty("userManaged")) { + if (properties.replicationStatus === 1) + return "replicationStatus: multiple values"; + properties.replicationStatus = 1; + { + var error = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.verify(message.userManaged); + if (error) + return "userManaged." + error; + } + } + return null; + }; /** - * Calls GetSecret. - * @function getSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} request GetSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a ReplicationStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus} ReplicationStatus */ + ReplicationStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ReplicationStatus) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.ReplicationStatus(); + if (object.automatic != null) { + if (typeof object.automatic !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.ReplicationStatus.automatic: object expected"); + message.automatic = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.fromObject(object.automatic); + } + if (object.userManaged != null) { + if (typeof object.userManaged !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.ReplicationStatus.userManaged: object expected"); + message.userManaged = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.fromObject(object.userManaged); + } + return message; + }; /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|updateSecret}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef UpdateSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.Secret} [response] Secret + * Creates a plain object from a ReplicationStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus} message ReplicationStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + ReplicationStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.automatic != null && message.hasOwnProperty("automatic")) { + object.automatic = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.toObject(message.automatic, options); + if (options.oneofs) + object.replicationStatus = "automatic"; + } + if (message.userManaged != null && message.hasOwnProperty("userManaged")) { + object.userManaged = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.toObject(message.userManaged, options); + if (options.oneofs) + object.replicationStatus = "userManaged"; + } + return object; + }; /** - * Calls UpdateSecret. - * @function updateSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * Converts this ReplicationStatus to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus * @instance - * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} request UpdateSecretRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.UpdateSecretCallback} callback Node-style callback called with the error, if any, and Secret - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecretManagerService.prototype.updateSecret = function updateSecret(request, callback) { - return this.rpcCall(updateSecret, $root.google.cloud.secrets.v1beta1.UpdateSecretRequest, $root.google.cloud.secrets.v1beta1.Secret, request, callback); - }, "name", { value: "UpdateSecret" }); + ReplicationStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls UpdateSecret. - * @function updateSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} request UpdateSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for ReplicationStatus + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + ReplicationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ReplicationStatus"; + }; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|deleteSecret}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef DeleteSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + ReplicationStatus.AutomaticStatus = (function() { - /** - * Calls DeleteSecret. - * @function deleteSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} request DeleteSecretRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.DeleteSecretCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.deleteSecret = function deleteSecret(request, callback) { - return this.rpcCall(deleteSecret, $root.google.cloud.secrets.v1beta1.DeleteSecretRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSecret" }); + /** + * Properties of an AutomaticStatus. + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @interface IAutomaticStatus + * @property {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null} [customerManagedEncryption] AutomaticStatus customerManagedEncryption + */ - /** - * Calls DeleteSecret. - * @function deleteSecret - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} request DeleteSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Constructs a new AutomaticStatus. + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @classdesc Represents an AutomaticStatus. + * @implements IAutomaticStatus + * @constructor + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus=} [properties] Properties to set + */ + function AutomaticStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|listSecretVersions}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef ListSecretVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} [response] ListSecretVersionsResponse - */ + /** + * AutomaticStatus customerManagedEncryption. + * @member {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null|undefined} customerManagedEncryption + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @instance + */ + AutomaticStatus.prototype.customerManagedEncryption = null; - /** - * Calls ListSecretVersions. - * @function listSecretVersions - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} request ListSecretVersionsRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersionsCallback} callback Node-style callback called with the error, if any, and ListSecretVersionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.listSecretVersions = function listSecretVersions(request, callback) { - return this.rpcCall(listSecretVersions, $root.google.cloud.secrets.v1beta1.ListSecretVersionsRequest, $root.google.cloud.secrets.v1beta1.ListSecretVersionsResponse, request, callback); - }, "name", { value: "ListSecretVersions" }); + /** + * Creates a new AutomaticStatus instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus} AutomaticStatus instance + */ + AutomaticStatus.create = function create(properties) { + return new AutomaticStatus(properties); + }; - /** - * Calls ListSecretVersions. - * @function listSecretVersions - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} request ListSecretVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified AutomaticStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus} message AutomaticStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerManagedEncryption != null && Object.hasOwnProperty.call(message, "customerManagedEncryption")) + $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.encode(message.customerManagedEncryption, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|getSecretVersion}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef GetSecretVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion - */ + /** + * Encodes the specified AutomaticStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IAutomaticStatus} message AutomaticStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls GetSecretVersion. - * @function getSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} request GetSecretVersionRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.GetSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.getSecretVersion = function getSecretVersion(request, callback) { - return this.rpcCall(getSecretVersion, $root.google.cloud.secrets.v1beta1.GetSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); - }, "name", { value: "GetSecretVersion" }); + /** + * Decodes an AutomaticStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus} AutomaticStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticStatus.decode = function 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.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls GetSecretVersion. - * @function getSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} request GetSecretVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes an AutomaticStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus} AutomaticStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|accessSecretVersion}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef AccessSecretVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} [response] AccessSecretVersionResponse - */ + /** + * Verifies an AutomaticStatus message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomaticStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) { + var error = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.verify(message.customerManagedEncryption); + if (error) + return "customerManagedEncryption." + error; + } + return null; + }; - /** - * Calls AccessSecretVersion. - * @function accessSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} request AccessSecretVersionRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersionCallback} callback Node-style callback called with the error, if any, and AccessSecretVersionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.accessSecretVersion = function accessSecretVersion(request, callback) { - return this.rpcCall(accessSecretVersion, $root.google.cloud.secrets.v1beta1.AccessSecretVersionRequest, $root.google.cloud.secrets.v1beta1.AccessSecretVersionResponse, request, callback); - }, "name", { value: "AccessSecretVersion" }); + /** + * Creates an AutomaticStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus} AutomaticStatus + */ + AutomaticStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus(); + if (object.customerManagedEncryption != null) { + if (typeof object.customerManagedEncryption !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus.customerManagedEncryption: object expected"); + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.fromObject(object.customerManagedEncryption); + } + return message; + }; - /** - * Calls AccessSecretVersion. - * @function accessSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} request AccessSecretVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from an AutomaticStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus} message AutomaticStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomaticStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.customerManagedEncryption = null; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) + object.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.toObject(message.customerManagedEncryption, options); + return object; + }; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|disableSecretVersion}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef DisableSecretVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion - */ + /** + * Converts this AutomaticStatus to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @instance + * @returns {Object.} JSON object + */ + AutomaticStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls DisableSecretVersion. - * @function disableSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} request DisableSecretVersionRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.DisableSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.disableSecretVersion = function disableSecretVersion(request, callback) { - return this.rpcCall(disableSecretVersion, $root.google.cloud.secrets.v1beta1.DisableSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); - }, "name", { value: "DisableSecretVersion" }); + /** + * Gets the default type url for AutomaticStatus + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomaticStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus"; + }; - /** - * Calls DisableSecretVersion. - * @function disableSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} request DisableSecretVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return AutomaticStatus; + })(); - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|enableSecretVersion}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef EnableSecretVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion - */ + ReplicationStatus.UserManagedStatus = (function() { - /** - * Calls EnableSecretVersion. - * @function enableSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} request EnableSecretVersionRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.EnableSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.enableSecretVersion = function enableSecretVersion(request, callback) { - return this.rpcCall(enableSecretVersion, $root.google.cloud.secrets.v1beta1.EnableSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); - }, "name", { value: "EnableSecretVersion" }); + /** + * Properties of a UserManagedStatus. + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @interface IUserManagedStatus + * @property {Array.|null} [replicas] UserManagedStatus replicas + */ - /** - * Calls EnableSecretVersion. - * @function enableSecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} request EnableSecretVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Constructs a new UserManagedStatus. + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus + * @classdesc Represents a UserManagedStatus. + * @implements IUserManagedStatus + * @constructor + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus=} [properties] Properties to set + */ + function UserManagedStatus(properties) { + this.replicas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|destroySecretVersion}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef DestroySecretVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion - */ + /** + * UserManagedStatus replicas. + * @member {Array.} replicas + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @instance + */ + UserManagedStatus.prototype.replicas = $util.emptyArray; - /** - * Calls DestroySecretVersion. - * @function destroySecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} request DestroySecretVersionRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.DestroySecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.destroySecretVersion = function destroySecretVersion(request, callback) { - return this.rpcCall(destroySecretVersion, $root.google.cloud.secrets.v1beta1.DestroySecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); - }, "name", { value: "DestroySecretVersion" }); + /** + * Creates a new UserManagedStatus instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus} UserManagedStatus instance + */ + UserManagedStatus.create = function create(properties) { + return new UserManagedStatus(properties); + }; - /** - * Calls DestroySecretVersion. - * @function destroySecretVersion - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} request DestroySecretVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified UserManagedStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus} message UserManagedStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserManagedStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicas != null && message.replicas.length) + for (var i = 0; i < message.replicas.length; ++i) + $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.encode(message.replicas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|setIamPolicy}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ + /** + * Encodes the specified UserManagedStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.IUserManagedStatus} message UserManagedStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserManagedStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + /** + * Decodes a UserManagedStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus} UserManagedStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserManagedStatus.decode = function 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.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.replicas && message.replicas.length)) + message.replicas = []; + message.replicas.push($root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a UserManagedStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus} UserManagedStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserManagedStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|getIamPolicy}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ + /** + * Verifies a UserManagedStatus message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserManagedStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicas != null && message.hasOwnProperty("replicas")) { + if (!Array.isArray(message.replicas)) + return "replicas: array expected"; + for (var i = 0; i < message.replicas.length; ++i) { + var error = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.verify(message.replicas[i]); + if (error) + return "replicas." + error; + } + } + return null; + }; - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + /** + * Creates a UserManagedStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus} UserManagedStatus + */ + UserManagedStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus(); + if (object.replicas) { + if (!Array.isArray(object.replicas)) + throw TypeError(".google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.replicas: array expected"); + message.replicas = []; + for (var i = 0; i < object.replicas.length; ++i) { + if (typeof object.replicas[i] !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.replicas: object expected"); + message.replicas[i] = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.fromObject(object.replicas[i]); + } + } + return message; + }; - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from a UserManagedStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus} message UserManagedStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserManagedStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicas = []; + if (message.replicas && message.replicas.length) { + object.replicas = []; + for (var j = 0; j < message.replicas.length; ++j) + object.replicas[j] = $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.toObject(message.replicas[j], options); + } + return object; + }; - /** - * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|testIamPermissions}. - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ + /** + * Converts this UserManagedStatus to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @instance + * @returns {Object.} JSON object + */ + UserManagedStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.secrets.v1beta1.SecretManagerService.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecretManagerService.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + /** + * Gets the default type url for UserManagedStatus + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserManagedStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus"; + }; - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.secrets.v1beta1.SecretManagerService - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + UserManagedStatus.ReplicaStatus = (function() { - return SecretManagerService; - })(); + /** + * Properties of a ReplicaStatus. + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @interface IReplicaStatus + * @property {string|null} [location] ReplicaStatus location + * @property {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null} [customerManagedEncryption] ReplicaStatus customerManagedEncryption + */ - v1beta1.ListSecretsRequest = (function() { + /** + * Constructs a new ReplicaStatus. + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus + * @classdesc Represents a ReplicaStatus. + * @implements IReplicaStatus + * @constructor + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus=} [properties] Properties to set + */ + function ReplicaStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaStatus location. + * @member {string} location + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @instance + */ + ReplicaStatus.prototype.location = ""; + + /** + * ReplicaStatus customerManagedEncryption. + * @member {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus|null|undefined} customerManagedEncryption + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @instance + */ + ReplicaStatus.prototype.customerManagedEncryption = null; + + /** + * Creates a new ReplicaStatus instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus} ReplicaStatus instance + */ + ReplicaStatus.create = function create(properties) { + return new ReplicaStatus(properties); + }; + + /** + * Encodes the specified ReplicaStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus} message ReplicaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.customerManagedEncryption != null && Object.hasOwnProperty.call(message, "customerManagedEncryption")) + $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.encode(message.customerManagedEncryption, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplicaStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.IReplicaStatus} message ReplicaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus} ReplicaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaStatus.decode = function 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.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus} ReplicaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaStatus message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) { + var error = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.verify(message.customerManagedEncryption); + if (error) + return "customerManagedEncryption." + error; + } + return null; + }; + + /** + * Creates a ReplicaStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus} ReplicaStatus + */ + ReplicaStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus(); + if (object.location != null) + message.location = String(object.location); + if (object.customerManagedEncryption != null) { + if (typeof object.customerManagedEncryption !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus.customerManagedEncryption: object expected"); + message.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.fromObject(object.customerManagedEncryption); + } + return message; + }; + + /** + * Creates a plain object from a ReplicaStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus} message ReplicaStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.customerManagedEncryption = null; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.customerManagedEncryption != null && message.hasOwnProperty("customerManagedEncryption")) + object.customerManagedEncryption = $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.toObject(message.customerManagedEncryption, options); + return object; + }; + + /** + * Converts this ReplicaStatus to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @instance + * @returns {Object.} JSON object + */ + ReplicaStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaStatus + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus"; + }; + + return ReplicaStatus; + })(); + + return UserManagedStatus; + })(); + + return ReplicationStatus; + })(); + + v1beta2.CustomerManagedEncryptionStatus = (function() { /** - * Properties of a ListSecretsRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IListSecretsRequest - * @property {string|null} [parent] ListSecretsRequest parent - * @property {number|null} [pageSize] ListSecretsRequest pageSize - * @property {string|null} [pageToken] ListSecretsRequest pageToken + * Properties of a CustomerManagedEncryptionStatus. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface ICustomerManagedEncryptionStatus + * @property {string|null} [kmsKeyVersionName] CustomerManagedEncryptionStatus kmsKeyVersionName */ /** - * Constructs a new ListSecretsRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a ListSecretsRequest. - * @implements IListSecretsRequest + * Constructs a new CustomerManagedEncryptionStatus. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a CustomerManagedEncryptionStatus. + * @implements ICustomerManagedEncryptionStatus * @constructor - * @param {google.cloud.secrets.v1beta1.IListSecretsRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus=} [properties] Properties to set */ - function ListSecretsRequest(properties) { + function CustomerManagedEncryptionStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10454,103 +11379,75 @@ } /** - * ListSecretsRequest parent. - * @member {string} parent - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest - * @instance - */ - ListSecretsRequest.prototype.parent = ""; - - /** - * ListSecretsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest - * @instance - */ - ListSecretsRequest.prototype.pageSize = 0; - - /** - * ListSecretsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * CustomerManagedEncryptionStatus kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @instance */ - ListSecretsRequest.prototype.pageToken = ""; + CustomerManagedEncryptionStatus.prototype.kmsKeyVersionName = ""; /** - * Creates a new ListSecretsRequest instance using the specified properties. + * Creates a new CustomerManagedEncryptionStatus instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static - * @param {google.cloud.secrets.v1beta1.IListSecretsRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest instance + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus} CustomerManagedEncryptionStatus instance */ - ListSecretsRequest.create = function create(properties) { - return new ListSecretsRequest(properties); + CustomerManagedEncryptionStatus.create = function create(properties) { + return new CustomerManagedEncryptionStatus(properties); }; /** - * Encodes the specified ListSecretsRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsRequest.verify|verify} messages. + * Encodes the specified CustomerManagedEncryptionStatus message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static - * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} message ListSecretsRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus} message CustomerManagedEncryptionStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSecretsRequest.encode = function encode(message, writer) { + CustomerManagedEncryptionStatus.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.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyVersionName); return writer; }; /** - * Encodes the specified ListSecretsRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsRequest.verify|verify} messages. + * Encodes the specified CustomerManagedEncryptionStatus message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static - * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} message ListSecretsRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ICustomerManagedEncryptionStatus} message CustomerManagedEncryptionStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSecretsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CustomerManagedEncryptionStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSecretsRequest message from the specified reader or buffer. + * Decodes a CustomerManagedEncryptionStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus} CustomerManagedEncryptionStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSecretsRequest.decode = function decode(reader, length) { + CustomerManagedEncryptionStatus.decode = function 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.secrets.v1beta1.ListSecretsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); + message.kmsKeyVersionName = reader.string(); break; } default: @@ -10562,142 +11459,122 @@ }; /** - * Decodes a ListSecretsRequest message from the specified reader or buffer, length delimited. + * Decodes a CustomerManagedEncryptionStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus} CustomerManagedEncryptionStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSecretsRequest.decodeDelimited = function decodeDelimited(reader) { + CustomerManagedEncryptionStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSecretsRequest message. + * Verifies a CustomerManagedEncryptionStatus message. * @function verify - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSecretsRequest.verify = function verify(message) { + CustomerManagedEncryptionStatus.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.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.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; return null; }; /** - * Creates a ListSecretsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CustomerManagedEncryptionStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest + * @returns {google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus} CustomerManagedEncryptionStatus */ - ListSecretsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretsRequest) + CustomerManagedEncryptionStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus) return object; - var message = new $root.google.cloud.secrets.v1beta1.ListSecretsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus(); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); return message; }; /** - * Creates a plain object from a ListSecretsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CustomerManagedEncryptionStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static - * @param {google.cloud.secrets.v1beta1.ListSecretsRequest} message ListSecretsRequest + * @param {google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus} message CustomerManagedEncryptionStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSecretsRequest.toObject = function toObject(message, options) { + CustomerManagedEncryptionStatus.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - 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 (options.defaults) + object.kmsKeyVersionName = ""; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; return object; }; /** - * Converts this ListSecretsRequest to JSON. + * Converts this CustomerManagedEncryptionStatus to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @instance * @returns {Object.} JSON object */ - ListSecretsRequest.prototype.toJSON = function toJSON() { + CustomerManagedEncryptionStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSecretsRequest + * Gets the default type url for CustomerManagedEncryptionStatus * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @memberof google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSecretsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CustomerManagedEncryptionStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretsRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus"; }; - return ListSecretsRequest; + return CustomerManagedEncryptionStatus; })(); - v1beta1.ListSecretsResponse = (function() { + v1beta2.Topic = (function() { /** - * Properties of a ListSecretsResponse. - * @memberof google.cloud.secrets.v1beta1 - * @interface IListSecretsResponse - * @property {Array.|null} [secrets] ListSecretsResponse secrets - * @property {string|null} [nextPageToken] ListSecretsResponse nextPageToken - * @property {number|null} [totalSize] ListSecretsResponse totalSize + * Properties of a Topic. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface ITopic + * @property {string|null} [name] Topic name */ /** - * Constructs a new ListSecretsResponse. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a ListSecretsResponse. - * @implements IListSecretsResponse + * Constructs a new Topic. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a Topic. + * @implements ITopic * @constructor - * @param {google.cloud.secrets.v1beta1.IListSecretsResponse=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.ITopic=} [properties] Properties to set */ - function ListSecretsResponse(properties) { - this.secrets = []; + function Topic(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10705,106 +11582,75 @@ } /** - * ListSecretsResponse secrets. - * @member {Array.} secrets - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse - * @instance - */ - ListSecretsResponse.prototype.secrets = $util.emptyArray; - - /** - * ListSecretsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse - * @instance - */ - ListSecretsResponse.prototype.nextPageToken = ""; - - /** - * ListSecretsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * Topic name. + * @member {string} name + * @memberof google.cloud.secretmanager.v1beta2.Topic * @instance */ - ListSecretsResponse.prototype.totalSize = 0; + Topic.prototype.name = ""; /** - * Creates a new ListSecretsResponse instance using the specified properties. + * Creates a new Topic instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static - * @param {google.cloud.secrets.v1beta1.IListSecretsResponse=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse instance + * @param {google.cloud.secretmanager.v1beta2.ITopic=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.Topic} Topic instance */ - ListSecretsResponse.create = function create(properties) { - return new ListSecretsResponse(properties); + Topic.create = function create(properties) { + return new Topic(properties); }; /** - * Encodes the specified ListSecretsResponse message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsResponse.verify|verify} messages. + * Encodes the specified Topic message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Topic.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static - * @param {google.cloud.secrets.v1beta1.IListSecretsResponse} message ListSecretsResponse message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ITopic} message Topic message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSecretsResponse.encode = function encode(message, writer) { + Topic.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.secrets != null && message.secrets.length) - for (var i = 0; i < message.secrets.length; ++i) - $root.google.cloud.secrets.v1beta1.Secret.encode(message.secrets[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); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListSecretsResponse message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsResponse.verify|verify} messages. + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Topic.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static - * @param {google.cloud.secrets.v1beta1.IListSecretsResponse} message ListSecretsResponse message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ITopic} message Topic message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSecretsResponse.encodeDelimited = function encodeDelimited(message, writer) { + Topic.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSecretsResponse message from the specified reader or buffer. + * Decodes a Topic message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse + * @returns {google.cloud.secretmanager.v1beta2.Topic} Topic * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSecretsResponse.decode = function decode(reader, length) { + Topic.decode = function 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.secrets.v1beta1.ListSecretsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.Topic(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.secrets && message.secrets.length)) - message.secrets = []; - message.secrets.push($root.google.cloud.secrets.v1beta1.Secret.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); + message.name = reader.string(); break; } default: @@ -10816,159 +11662,123 @@ }; /** - * Decodes a ListSecretsResponse message from the specified reader or buffer, length delimited. + * Decodes a Topic message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse + * @returns {google.cloud.secretmanager.v1beta2.Topic} Topic * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSecretsResponse.decodeDelimited = function decodeDelimited(reader) { + Topic.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSecretsResponse message. + * Verifies a Topic message. * @function verify - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSecretsResponse.verify = function verify(message) { + Topic.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.secrets != null && message.hasOwnProperty("secrets")) { - if (!Array.isArray(message.secrets)) - return "secrets: array expected"; - for (var i = 0; i < message.secrets.length; ++i) { - var error = $root.google.cloud.secrets.v1beta1.Secret.verify(message.secrets[i]); - if (error) - return "secrets." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListSecretsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Topic message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse + * @returns {google.cloud.secretmanager.v1beta2.Topic} Topic */ - ListSecretsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretsResponse) + Topic.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.Topic) return object; - var message = new $root.google.cloud.secrets.v1beta1.ListSecretsResponse(); - if (object.secrets) { - if (!Array.isArray(object.secrets)) - throw TypeError(".google.cloud.secrets.v1beta1.ListSecretsResponse.secrets: array expected"); - message.secrets = []; - for (var i = 0; i < object.secrets.length; ++i) { - if (typeof object.secrets[i] !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.ListSecretsResponse.secrets: object expected"); - message.secrets[i] = $root.google.cloud.secrets.v1beta1.Secret.fromObject(object.secrets[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + var message = new $root.google.cloud.secretmanager.v1beta2.Topic(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListSecretsResponse message. Also converts values to other types if specified. + * Creates a plain object from a Topic message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static - * @param {google.cloud.secrets.v1beta1.ListSecretsResponse} message ListSecretsResponse + * @param {google.cloud.secretmanager.v1beta2.Topic} message Topic * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSecretsResponse.toObject = function toObject(message, options) { + Topic.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.secrets = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.secrets && message.secrets.length) { - object.secrets = []; - for (var j = 0; j < message.secrets.length; ++j) - object.secrets[j] = $root.google.cloud.secrets.v1beta1.Secret.toObject(message.secrets[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListSecretsResponse to JSON. + * Converts this Topic to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @instance * @returns {Object.} JSON object */ - ListSecretsResponse.prototype.toJSON = function toJSON() { + Topic.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSecretsResponse + * Gets the default type url for Topic * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @memberof google.cloud.secretmanager.v1beta2.Topic * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSecretsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Topic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretsResponse"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.Topic"; }; - return ListSecretsResponse; + return Topic; })(); - v1beta1.CreateSecretRequest = (function() { + v1beta2.Rotation = (function() { /** - * Properties of a CreateSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface ICreateSecretRequest - * @property {string|null} [parent] CreateSecretRequest parent - * @property {string|null} [secretId] CreateSecretRequest secretId - * @property {google.cloud.secrets.v1beta1.ISecret|null} [secret] CreateSecretRequest secret + * Properties of a Rotation. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IRotation + * @property {google.protobuf.ITimestamp|null} [nextRotationTime] Rotation nextRotationTime + * @property {google.protobuf.IDuration|null} [rotationPeriod] Rotation rotationPeriod */ /** - * Constructs a new CreateSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a CreateSecretRequest. - * @implements ICreateSecretRequest + * Constructs a new Rotation. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a Rotation. + * @implements IRotation * @constructor - * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IRotation=} [properties] Properties to set */ - function CreateSecretRequest(properties) { + function Rotation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10976,103 +11786,89 @@ } /** - * CreateSecretRequest parent. - * @member {string} parent - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest - * @instance - */ - CreateSecretRequest.prototype.parent = ""; - - /** - * CreateSecretRequest secretId. - * @member {string} secretId - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * Rotation nextRotationTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRotationTime + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @instance */ - CreateSecretRequest.prototype.secretId = ""; + Rotation.prototype.nextRotationTime = null; /** - * CreateSecretRequest secret. - * @member {google.cloud.secrets.v1beta1.ISecret|null|undefined} secret - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * Rotation rotationPeriod. + * @member {google.protobuf.IDuration|null|undefined} rotationPeriod + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @instance */ - CreateSecretRequest.prototype.secret = null; + Rotation.prototype.rotationPeriod = null; /** - * Creates a new CreateSecretRequest instance using the specified properties. + * Creates a new Rotation instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static - * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest instance + * @param {google.cloud.secretmanager.v1beta2.IRotation=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.Rotation} Rotation instance */ - CreateSecretRequest.create = function create(properties) { - return new CreateSecretRequest(properties); + Rotation.create = function create(properties) { + return new Rotation(properties); }; /** - * Encodes the specified CreateSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.CreateSecretRequest.verify|verify} messages. + * Encodes the specified Rotation message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Rotation.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static - * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} message CreateSecretRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IRotation} message Rotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecretRequest.encode = function encode(message, writer) { + Rotation.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.secretId != null && Object.hasOwnProperty.call(message, "secretId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretId); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - $root.google.cloud.secrets.v1beta1.Secret.encode(message.secret, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.nextRotationTime != null && Object.hasOwnProperty.call(message, "nextRotationTime")) + $root.google.protobuf.Timestamp.encode(message.nextRotationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rotationPeriod != null && Object.hasOwnProperty.call(message, "rotationPeriod")) + $root.google.protobuf.Duration.encode(message.rotationPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.CreateSecretRequest.verify|verify} messages. + * Encodes the specified Rotation message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.Rotation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static - * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} message CreateSecretRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IRotation} message Rotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + Rotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSecretRequest message from the specified reader or buffer. + * Decodes a Rotation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.Rotation} Rotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecretRequest.decode = function decode(reader, length) { + Rotation.decode = function 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.secrets.v1beta1.CreateSecretRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.Rotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.secretId = reader.string(); - break; - } - case 3: { - message.secret = $root.google.cloud.secrets.v1beta1.Secret.decode(reader, reader.uint32()); + message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } default: @@ -11084,145 +11880,142 @@ }; /** - * Decodes a CreateSecretRequest message from the specified reader or buffer, length delimited. + * Decodes a Rotation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.Rotation} Rotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecretRequest.decodeDelimited = function decodeDelimited(reader) { + Rotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSecretRequest message. + * Verifies a Rotation message. * @function verify - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSecretRequest.verify = function verify(message) { + Rotation.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.secretId != null && message.hasOwnProperty("secretId")) - if (!$util.isString(message.secretId)) - return "secretId: string expected"; - if (message.secret != null && message.hasOwnProperty("secret")) { - var error = $root.google.cloud.secrets.v1beta1.Secret.verify(message.secret); + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRotationTime); if (error) - return "secret." + error; + return "nextRotationTime." + error; + } + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.rotationPeriod); + if (error) + return "rotationPeriod." + error; } return null; }; /** - * Creates a CreateSecretRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Rotation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.Rotation} Rotation */ - CreateSecretRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.CreateSecretRequest) + Rotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.Rotation) return object; - var message = new $root.google.cloud.secrets.v1beta1.CreateSecretRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.secretId != null) - message.secretId = String(object.secretId); - if (object.secret != null) { - if (typeof object.secret !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.CreateSecretRequest.secret: object expected"); - message.secret = $root.google.cloud.secrets.v1beta1.Secret.fromObject(object.secret); + var message = new $root.google.cloud.secretmanager.v1beta2.Rotation(); + if (object.nextRotationTime != null) { + if (typeof object.nextRotationTime !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Rotation.nextRotationTime: object expected"); + message.nextRotationTime = $root.google.protobuf.Timestamp.fromObject(object.nextRotationTime); + } + if (object.rotationPeriod != null) { + if (typeof object.rotationPeriod !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.Rotation.rotationPeriod: object expected"); + message.rotationPeriod = $root.google.protobuf.Duration.fromObject(object.rotationPeriod); } return message; }; /** - * Creates a plain object from a CreateSecretRequest message. Also converts values to other types if specified. + * Creates a plain object from a Rotation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static - * @param {google.cloud.secrets.v1beta1.CreateSecretRequest} message CreateSecretRequest + * @param {google.cloud.secretmanager.v1beta2.Rotation} message Rotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSecretRequest.toObject = function toObject(message, options) { + Rotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.secretId = ""; - object.secret = null; + object.nextRotationTime = null; + object.rotationPeriod = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.secretId != null && message.hasOwnProperty("secretId")) - object.secretId = message.secretId; - if (message.secret != null && message.hasOwnProperty("secret")) - object.secret = $root.google.cloud.secrets.v1beta1.Secret.toObject(message.secret, options); + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) + object.nextRotationTime = $root.google.protobuf.Timestamp.toObject(message.nextRotationTime, options); + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) + object.rotationPeriod = $root.google.protobuf.Duration.toObject(message.rotationPeriod, options); return object; }; /** - * Converts this CreateSecretRequest to JSON. + * Converts this Rotation to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @instance * @returns {Object.} JSON object */ - CreateSecretRequest.prototype.toJSON = function toJSON() { + Rotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSecretRequest + * Gets the default type url for Rotation * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.Rotation * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Rotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.CreateSecretRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.Rotation"; }; - return CreateSecretRequest; + return Rotation; })(); - v1beta1.AddSecretVersionRequest = (function() { + v1beta2.SecretPayload = (function() { /** - * Properties of an AddSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IAddSecretVersionRequest - * @property {string|null} [parent] AddSecretVersionRequest parent - * @property {google.cloud.secrets.v1beta1.ISecretPayload|null} [payload] AddSecretVersionRequest payload + * Properties of a SecretPayload. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface ISecretPayload + * @property {Uint8Array|null} [data] SecretPayload data + * @property {number|Long|null} [dataCrc32c] SecretPayload dataCrc32c */ /** - * Constructs a new AddSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents an AddSecretVersionRequest. - * @implements IAddSecretVersionRequest + * Constructs a new SecretPayload. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a SecretPayload. + * @implements ISecretPayload * @constructor - * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.ISecretPayload=} [properties] Properties to set */ - function AddSecretVersionRequest(properties) { + function SecretPayload(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11230,89 +12023,103 @@ } /** - * AddSecretVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * SecretPayload data. + * @member {Uint8Array} data + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @instance */ - AddSecretVersionRequest.prototype.parent = ""; + SecretPayload.prototype.data = $util.newBuffer([]); /** - * AddSecretVersionRequest payload. - * @member {google.cloud.secrets.v1beta1.ISecretPayload|null|undefined} payload - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * SecretPayload dataCrc32c. + * @member {number|Long|null|undefined} dataCrc32c + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @instance */ - AddSecretVersionRequest.prototype.payload = null; + SecretPayload.prototype.dataCrc32c = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new AddSecretVersionRequest instance using the specified properties. + * SecretPayload _dataCrc32c. + * @member {"dataCrc32c"|undefined} _dataCrc32c + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload + * @instance + */ + Object.defineProperty(SecretPayload.prototype, "_dataCrc32c", { + get: $util.oneOfGetter($oneOfFields = ["dataCrc32c"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecretPayload instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static - * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest instance + * @param {google.cloud.secretmanager.v1beta2.ISecretPayload=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.SecretPayload} SecretPayload instance */ - AddSecretVersionRequest.create = function create(properties) { - return new AddSecretVersionRequest(properties); + SecretPayload.create = function create(properties) { + return new SecretPayload(properties); }; /** - * Encodes the specified AddSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.AddSecretVersionRequest.verify|verify} messages. + * Encodes the specified SecretPayload message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretPayload.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static - * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} message AddSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ISecretPayload} message SecretPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddSecretVersionRequest.encode = function encode(message, writer) { + SecretPayload.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.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.cloud.secrets.v1beta1.SecretPayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.dataCrc32c != null && Object.hasOwnProperty.call(message, "dataCrc32c")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.dataCrc32c); return writer; }; /** - * Encodes the specified AddSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.AddSecretVersionRequest.verify|verify} messages. + * Encodes the specified SecretPayload message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.SecretPayload.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static - * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} message AddSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ISecretPayload} message SecretPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + SecretPayload.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddSecretVersionRequest message from the specified reader or buffer. + * Decodes a SecretPayload message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.SecretPayload} SecretPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddSecretVersionRequest.decode = function decode(reader, length) { + SecretPayload.decode = function 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.secrets.v1beta1.AddSecretVersionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.SecretPayload(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.data = reader.bytes(); break; } case 2: { - message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.decode(reader, reader.uint32()); + message.dataCrc32c = reader.int64(); break; } default: @@ -11324,861 +12131,687 @@ }; /** - * Decodes an AddSecretVersionRequest message from the specified reader or buffer, length delimited. + * Decodes a SecretPayload message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.SecretPayload} SecretPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + SecretPayload.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddSecretVersionRequest message. + * Verifies a SecretPayload message. * @function verify - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddSecretVersionRequest.verify = function verify(message) { + SecretPayload.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.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.cloud.secrets.v1beta1.SecretPayload.verify(message.payload); - if (error) - return "payload." + error; + var properties = {}; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.dataCrc32c != null && message.hasOwnProperty("dataCrc32c")) { + properties._dataCrc32c = 1; + if (!$util.isInteger(message.dataCrc32c) && !(message.dataCrc32c && $util.isInteger(message.dataCrc32c.low) && $util.isInteger(message.dataCrc32c.high))) + return "dataCrc32c: integer|Long expected"; } return null; }; /** - * Creates an AddSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SecretPayload message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.SecretPayload} SecretPayload */ - AddSecretVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.AddSecretVersionRequest) + SecretPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.SecretPayload) return object; - var message = new $root.google.cloud.secrets.v1beta1.AddSecretVersionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.AddSecretVersionRequest.payload: object expected"); - message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.fromObject(object.payload); - } + var message = new $root.google.cloud.secretmanager.v1beta2.SecretPayload(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.dataCrc32c != null) + if ($util.Long) + (message.dataCrc32c = $util.Long.fromValue(object.dataCrc32c)).unsigned = false; + else if (typeof object.dataCrc32c === "string") + message.dataCrc32c = parseInt(object.dataCrc32c, 10); + else if (typeof object.dataCrc32c === "number") + message.dataCrc32c = object.dataCrc32c; + else if (typeof object.dataCrc32c === "object") + message.dataCrc32c = new $util.LongBits(object.dataCrc32c.low >>> 0, object.dataCrc32c.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an AddSecretVersionRequest message. Also converts values to other types if specified. + * Creates a plain object from a SecretPayload message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static - * @param {google.cloud.secrets.v1beta1.AddSecretVersionRequest} message AddSecretVersionRequest + * @param {google.cloud.secretmanager.v1beta2.SecretPayload} message SecretPayload * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddSecretVersionRequest.toObject = function toObject(message, options) { + SecretPayload.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.payload = null; + if (options.defaults) + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.dataCrc32c != null && message.hasOwnProperty("dataCrc32c")) { + if (typeof message.dataCrc32c === "number") + object.dataCrc32c = options.longs === String ? String(message.dataCrc32c) : message.dataCrc32c; + else + object.dataCrc32c = options.longs === String ? $util.Long.prototype.toString.call(message.dataCrc32c) : options.longs === Number ? new $util.LongBits(message.dataCrc32c.low >>> 0, message.dataCrc32c.high >>> 0).toNumber() : message.dataCrc32c; + if (options.oneofs) + object._dataCrc32c = "dataCrc32c"; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.toObject(message.payload, options); return object; }; /** - * Converts this AddSecretVersionRequest to JSON. + * Converts this SecretPayload to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @instance * @returns {Object.} JSON object */ - AddSecretVersionRequest.prototype.toJSON = function toJSON() { + SecretPayload.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddSecretVersionRequest + * Gets the default type url for SecretPayload * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretPayload * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SecretPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.AddSecretVersionRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.SecretPayload"; }; - return AddSecretVersionRequest; + return SecretPayload; })(); - v1beta1.GetSecretRequest = (function() { - - /** - * Properties of a GetSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IGetSecretRequest - * @property {string|null} [name] GetSecretRequest name - */ + v1beta2.SecretManagerService = (function() { /** - * Constructs a new GetSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a GetSecretRequest. - * @implements IGetSecretRequest + * Constructs a new SecretManagerService service. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a SecretManagerService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.secrets.v1beta1.IGetSecretRequest=} [properties] Properties to set + * @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 GetSecretRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function SecretManagerService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * GetSecretRequest name. - * @member {string} name - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @instance - */ - GetSecretRequest.prototype.name = ""; + (SecretManagerService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecretManagerService; /** - * Creates a new GetSecretRequest instance using the specified properties. + * Creates new SecretManagerService service using the specified rpc implementation. * @function create - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @static - * @param {google.cloud.secrets.v1beta1.IGetSecretRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest instance + * @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 {SecretManagerService} RPC service. Useful where requests and/or responses are streamed. */ - GetSecretRequest.create = function create(properties) { - return new GetSecretRequest(properties); + SecretManagerService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified GetSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} message GetSecretRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|listSecrets}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef ListSecretsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.ListSecretsResponse} [response] ListSecretsResponse */ - GetSecretRequest.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 GetSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} message GetSecretRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListSecrets. + * @function listSecrets + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretsRequest} request ListSecretsRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretsCallback} callback Node-style callback called with the error, if any, and ListSecretsResponse + * @returns {undefined} + * @variation 1 */ - GetSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(SecretManagerService.prototype.listSecrets = function listSecrets(request, callback) { + return this.rpcCall(listSecrets, $root.google.cloud.secretmanager.v1beta2.ListSecretsRequest, $root.google.cloud.secretmanager.v1beta2.ListSecretsResponse, request, callback); + }, "name", { value: "ListSecrets" }); /** - * Decodes a GetSecretRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListSecrets. + * @function listSecrets + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretsRequest} request ListSecretsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetSecretRequest.decode = function 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.secrets.v1beta1.GetSecretRequest(); - 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 GetSecretRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|createSecret}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef CreateSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.Secret} [response] Secret */ - GetSecretRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a GetSecretRequest message. - * @function verify - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateSecret. + * @function createSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.ICreateSecretRequest} request CreateSecretRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.CreateSecretCallback} callback Node-style callback called with the error, if any, and Secret + * @returns {undefined} + * @variation 1 */ - GetSecretRequest.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; - }; + Object.defineProperty(SecretManagerService.prototype.createSecret = function createSecret(request, callback) { + return this.rpcCall(createSecret, $root.google.cloud.secretmanager.v1beta2.CreateSecretRequest, $root.google.cloud.secretmanager.v1beta2.Secret, request, callback); + }, "name", { value: "CreateSecret" }); /** - * Creates a GetSecretRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest + * Calls CreateSecret. + * @function createSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.ICreateSecretRequest} request CreateSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetSecretRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.GetSecretRequest) - return object; - var message = new $root.google.cloud.secrets.v1beta1.GetSecretRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a GetSecretRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {google.cloud.secrets.v1beta1.GetSecretRequest} message GetSecretRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|addSecretVersion}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef AddSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.SecretVersion} [response] SecretVersion */ - GetSecretRequest.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 GetSecretRequest to JSON. - * @function toJSON - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * Calls AddSecretVersion. + * @function addSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest} request AddSecretVersionRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 */ - GetSecretRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(SecretManagerService.prototype.addSecretVersion = function addSecretVersion(request, callback) { + return this.rpcCall(addSecretVersion, $root.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest, $root.google.cloud.secretmanager.v1beta2.SecretVersion, request, callback); + }, "name", { value: "AddSecretVersion" }); /** - * Gets the default type url for GetSecretRequest - * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.GetSecretRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls AddSecretVersion. + * @function addSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest} request AddSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.GetSecretRequest"; - }; - - return GetSecretRequest; - })(); - - v1beta1.ListSecretVersionsRequest = (function() { /** - * Properties of a ListSecretVersionsRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IListSecretVersionsRequest - * @property {string|null} [parent] ListSecretVersionsRequest parent - * @property {number|null} [pageSize] ListSecretVersionsRequest pageSize - * @property {string|null} [pageToken] ListSecretVersionsRequest pageToken + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|getSecret}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef GetSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.Secret} [response] Secret */ /** - * Constructs a new ListSecretVersionsRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a ListSecretVersionsRequest. - * @implements IListSecretVersionsRequest - * @constructor - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest=} [properties] Properties to set + * Calls GetSecret. + * @function getSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IGetSecretRequest} request GetSecretRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretCallback} callback Node-style callback called with the error, if any, and Secret + * @returns {undefined} + * @variation 1 */ - function ListSecretVersionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(SecretManagerService.prototype.getSecret = function getSecret(request, callback) { + return this.rpcCall(getSecret, $root.google.cloud.secretmanager.v1beta2.GetSecretRequest, $root.google.cloud.secretmanager.v1beta2.Secret, request, callback); + }, "name", { value: "GetSecret" }); /** - * ListSecretVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * Calls GetSecret. + * @function getSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance + * @param {google.cloud.secretmanager.v1beta2.IGetSecretRequest} request GetSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsRequest.prototype.parent = ""; /** - * ListSecretVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|updateSecret}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef UpdateSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.Secret} [response] Secret + */ + + /** + * Calls UpdateSecret. + * @function updateSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance + * @param {google.cloud.secretmanager.v1beta2.IUpdateSecretRequest} request UpdateSecretRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.UpdateSecretCallback} callback Node-style callback called with the error, if any, and Secret + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsRequest.prototype.pageSize = 0; + Object.defineProperty(SecretManagerService.prototype.updateSecret = function updateSecret(request, callback) { + return this.rpcCall(updateSecret, $root.google.cloud.secretmanager.v1beta2.UpdateSecretRequest, $root.google.cloud.secretmanager.v1beta2.Secret, request, callback); + }, "name", { value: "UpdateSecret" }); /** - * ListSecretVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * Calls UpdateSecret. + * @function updateSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance + * @param {google.cloud.secretmanager.v1beta2.IUpdateSecretRequest} request UpdateSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsRequest.prototype.pageToken = ""; /** - * Creates a new ListSecretVersionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest instance + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|deleteSecret}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef DeleteSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - ListSecretVersionsRequest.create = function create(properties) { - return new ListSecretVersionsRequest(properties); - }; /** - * Encodes the specified ListSecretVersionsRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} message ListSecretVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteSecret. + * @function deleteSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IDeleteSecretRequest} request DeleteSecretRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.DeleteSecretCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsRequest.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); - return writer; - }; + Object.defineProperty(SecretManagerService.prototype.deleteSecret = function deleteSecret(request, callback) { + return this.rpcCall(deleteSecret, $root.google.cloud.secretmanager.v1beta2.DeleteSecretRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSecret" }); /** - * Encodes the specified ListSecretVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} message ListSecretVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteSecret. + * @function deleteSecret + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IDeleteSecretRequest} request DeleteSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListSecretVersionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|listSecretVersions}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef ListSecretVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse} [response] ListSecretVersionsResponse */ - ListSecretVersionsRequest.decode = function 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.secrets.v1beta1.ListSecretVersionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = 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 ListSecretVersionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListSecretVersions. + * @function listSecretVersions + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest} request ListSecretVersionsRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersionsCallback} callback Node-style callback called with the error, if any, and ListSecretVersionsResponse + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(SecretManagerService.prototype.listSecretVersions = function listSecretVersions(request, callback) { + return this.rpcCall(listSecretVersions, $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest, $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse, request, callback); + }, "name", { value: "ListSecretVersions" }); /** - * Verifies a ListSecretVersionsRequest message. - * @function verify - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListSecretVersions. + * @function listSecretVersions + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest} request ListSecretVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsRequest.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.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 ListSecretVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|getSecretVersion}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef GetSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.SecretVersion} [response] SecretVersion */ - ListSecretVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretVersionsRequest) - return object; - var message = new $root.google.cloud.secrets.v1beta1.ListSecretVersionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListSecretVersionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} message ListSecretVersionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls GetSecretVersion. + * @function getSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest} request GetSecretVersionRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - 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; - return object; - }; + Object.defineProperty(SecretManagerService.prototype.getSecretVersion = function getSecretVersion(request, callback) { + return this.rpcCall(getSecretVersion, $root.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest, $root.google.cloud.secretmanager.v1beta2.SecretVersion, request, callback); + }, "name", { value: "GetSecretVersion" }); /** - * Converts this ListSecretVersionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * Calls GetSecretVersion. + * @function getSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest} request GetSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListSecretVersionsRequest - * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|accessSecretVersion}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef AccessSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse} [response] AccessSecretVersionResponse */ - ListSecretVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretVersionsRequest"; - }; - return ListSecretVersionsRequest; - })(); + /** + * Calls AccessSecretVersion. + * @function accessSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest} request AccessSecretVersionRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersionCallback} callback Node-style callback called with the error, if any, and AccessSecretVersionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.accessSecretVersion = function accessSecretVersion(request, callback) { + return this.rpcCall(accessSecretVersion, $root.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest, $root.google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse, request, callback); + }, "name", { value: "AccessSecretVersion" }); - v1beta1.ListSecretVersionsResponse = (function() { + /** + * Calls AccessSecretVersion. + * @function accessSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest} request AccessSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Properties of a ListSecretVersionsResponse. - * @memberof google.cloud.secrets.v1beta1 - * @interface IListSecretVersionsResponse - * @property {Array.|null} [versions] ListSecretVersionsResponse versions - * @property {string|null} [nextPageToken] ListSecretVersionsResponse nextPageToken - * @property {number|null} [totalSize] ListSecretVersionsResponse totalSize + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|disableSecretVersion}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef DisableSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.SecretVersion} [response] SecretVersion */ /** - * Constructs a new ListSecretVersionsResponse. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a ListSecretVersionsResponse. - * @implements IListSecretVersionsResponse - * @constructor - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse=} [properties] Properties to set + * Calls DisableSecretVersion. + * @function disableSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest} request DisableSecretVersionRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.DisableSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 */ - function ListSecretVersionsResponse(properties) { - this.versions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(SecretManagerService.prototype.disableSecretVersion = function disableSecretVersion(request, callback) { + return this.rpcCall(disableSecretVersion, $root.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest, $root.google.cloud.secretmanager.v1beta2.SecretVersion, request, callback); + }, "name", { value: "DisableSecretVersion" }); /** - * ListSecretVersionsResponse versions. - * @member {Array.} versions - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * Calls DisableSecretVersion. + * @function disableSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance + * @param {google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest} request DisableSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsResponse.prototype.versions = $util.emptyArray; /** - * ListSecretVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|enableSecretVersion}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef EnableSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.SecretVersion} [response] SecretVersion + */ + + /** + * Calls EnableSecretVersion. + * @function enableSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance + * @param {google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest} request EnableSecretVersionRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.EnableSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsResponse.prototype.nextPageToken = ""; + Object.defineProperty(SecretManagerService.prototype.enableSecretVersion = function enableSecretVersion(request, callback) { + return this.rpcCall(enableSecretVersion, $root.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest, $root.google.cloud.secretmanager.v1beta2.SecretVersion, request, callback); + }, "name", { value: "EnableSecretVersion" }); /** - * ListSecretVersionsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * Calls EnableSecretVersion. + * @function enableSecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance + * @param {google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest} request EnableSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsResponse.prototype.totalSize = 0; /** - * Creates a new ListSecretVersionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse instance + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|destroySecretVersion}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef DestroySecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secretmanager.v1beta2.SecretVersion} [response] SecretVersion */ - ListSecretVersionsResponse.create = function create(properties) { - return new ListSecretVersionsResponse(properties); - }; /** - * Encodes the specified ListSecretVersionsResponse message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse} message ListSecretVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DestroySecretVersion. + * @function destroySecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest} request DestroySecretVersionRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.DestroySecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && message.versions.length) - for (var i = 0; i < message.versions.length; ++i) - $root.google.cloud.secrets.v1beta1.SecretVersion.encode(message.versions[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); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - return writer; - }; + Object.defineProperty(SecretManagerService.prototype.destroySecretVersion = function destroySecretVersion(request, callback) { + return this.rpcCall(destroySecretVersion, $root.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest, $root.google.cloud.secretmanager.v1beta2.SecretVersion, request, callback); + }, "name", { value: "DestroySecretVersion" }); /** - * Encodes the specified ListSecretVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse} message ListSecretVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DestroySecretVersion. + * @function destroySecretVersion + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest} request DestroySecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListSecretVersionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|setIamPolicy}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - ListSecretVersionsResponse.decode = function 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.secrets.v1beta1.ListSecretVersionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.google.cloud.secrets.v1beta1.SecretVersion.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListSecretVersionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(SecretManagerService.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); /** - * Verifies a ListSecretVersionsResponse message. - * @function verify - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (var i = 0; i < message.versions.length; ++i) { - var error = $root.google.cloud.secrets.v1beta1.SecretVersion.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - return null; - }; /** - * Creates a ListSecretVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|getIamPolicy}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - ListSecretVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretVersionsResponse) - return object; - var message = new $root.google.cloud.secrets.v1beta1.ListSecretVersionsResponse(); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".google.cloud.secrets.v1beta1.ListSecretVersionsResponse.versions: array expected"); - message.versions = []; - for (var i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.ListSecretVersionsResponse.versions: object expected"); - message.versions[i] = $root.google.cloud.secrets.v1beta1.SecretVersion.fromObject(object.versions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - return message; - }; /** - * Creates a plain object from a ListSecretVersionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} message ListSecretVersionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - ListSecretVersionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.versions && message.versions.length) { - object.versions = []; - for (var j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.google.cloud.secrets.v1beta1.SecretVersion.toObject(message.versions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; - }; + Object.defineProperty(SecretManagerService.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); /** - * Converts this ListSecretVersionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService * @instance - * @returns {Object.} JSON object + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSecretVersionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListSecretVersionsResponse - * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.secretmanager.v1beta2.SecretManagerService|testIamPermissions}. + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse */ - ListSecretVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretVersionsResponse"; - }; - return ListSecretVersionsResponse; + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.secretmanager.v1beta2.SecretManagerService.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.secretmanager.v1beta2.SecretManagerService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecretManagerService; })(); - v1beta1.GetSecretVersionRequest = (function() { + v1beta2.ListSecretsRequest = (function() { /** - * Properties of a GetSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IGetSecretVersionRequest - * @property {string|null} [name] GetSecretVersionRequest name + * Properties of a ListSecretsRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IListSecretsRequest + * @property {string|null} [parent] ListSecretsRequest parent + * @property {number|null} [pageSize] ListSecretsRequest pageSize + * @property {string|null} [pageToken] ListSecretsRequest pageToken + * @property {string|null} [filter] ListSecretsRequest filter */ /** - * Constructs a new GetSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a GetSecretVersionRequest. - * @implements IGetSecretVersionRequest + * Constructs a new ListSecretsRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a ListSecretsRequest. + * @implements IListSecretsRequest * @constructor - * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IListSecretsRequest=} [properties] Properties to set */ - function GetSecretVersionRequest(properties) { + function ListSecretsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12186,75 +12819,117 @@ } /** - * GetSecretVersionRequest name. - * @member {string} name - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * ListSecretsRequest parent. + * @member {string} parent + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @instance */ - GetSecretVersionRequest.prototype.name = ""; + ListSecretsRequest.prototype.parent = ""; /** - * Creates a new GetSecretVersionRequest instance using the specified properties. + * ListSecretsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest + * @instance + */ + ListSecretsRequest.prototype.pageSize = 0; + + /** + * ListSecretsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest + * @instance + */ + ListSecretsRequest.prototype.pageToken = ""; + + /** + * ListSecretsRequest filter. + * @member {string} filter + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest + * @instance + */ + ListSecretsRequest.prototype.filter = ""; + + /** + * Creates a new ListSecretsRequest instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static - * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretsRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsRequest} ListSecretsRequest instance */ - GetSecretVersionRequest.create = function create(properties) { - return new GetSecretVersionRequest(properties); + ListSecretsRequest.create = function create(properties) { + return new ListSecretsRequest(properties); }; /** - * Encodes the specified GetSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretVersionRequest.verify|verify} messages. + * Encodes the specified ListSecretsRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static - * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} message GetSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretsRequest} message ListSecretsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSecretVersionRequest.encode = function encode(message, writer) { + ListSecretsRequest.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 GetSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretVersionRequest.verify|verify} messages. + 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 ListSecretsRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static - * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} message GetSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretsRequest} message ListSecretsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSecretsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSecretVersionRequest message from the specified reader or buffer. + * Decodes a ListSecretsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsRequest} ListSecretsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSecretVersionRequest.decode = function decode(reader, length) { + ListSecretsRequest.decode = function 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.secrets.v1beta1.GetSecretVersionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.ListSecretsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); break; } default: @@ -12266,123 +12941,150 @@ }; /** - * Decodes a GetSecretVersionRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSecretsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsRequest} ListSecretsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + ListSecretsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSecretVersionRequest message. + * Verifies a ListSecretsRequest message. * @function verify - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSecretVersionRequest.verify = function verify(message) { + ListSecretsRequest.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.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 GetSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecretsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsRequest} ListSecretsRequest */ - GetSecretVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.GetSecretVersionRequest) + ListSecretsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ListSecretsRequest) return object; - var message = new $root.google.cloud.secrets.v1beta1.GetSecretVersionRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.secretmanager.v1beta2.ListSecretsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 GetSecretVersionRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSecretsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static - * @param {google.cloud.secrets.v1beta1.GetSecretVersionRequest} message GetSecretVersionRequest + * @param {google.cloud.secretmanager.v1beta2.ListSecretsRequest} message ListSecretsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSecretVersionRequest.toObject = function toObject(message, options) { + ListSecretsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.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 GetSecretVersionRequest to JSON. + * Converts this ListSecretsRequest to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @instance * @returns {Object.} JSON object */ - GetSecretVersionRequest.prototype.toJSON = function toJSON() { + ListSecretsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSecretVersionRequest + * Gets the default type url for ListSecretsRequest * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecretsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.GetSecretVersionRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ListSecretsRequest"; }; - return GetSecretVersionRequest; + return ListSecretsRequest; })(); - v1beta1.UpdateSecretRequest = (function() { + v1beta2.ListSecretsResponse = (function() { /** - * Properties of an UpdateSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IUpdateSecretRequest - * @property {google.cloud.secrets.v1beta1.ISecret|null} [secret] UpdateSecretRequest secret - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecretRequest updateMask + * Properties of a ListSecretsResponse. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IListSecretsResponse + * @property {Array.|null} [secrets] ListSecretsResponse secrets + * @property {string|null} [nextPageToken] ListSecretsResponse nextPageToken + * @property {number|null} [totalSize] ListSecretsResponse totalSize */ /** - * Constructs a new UpdateSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents an UpdateSecretRequest. - * @implements IUpdateSecretRequest + * Constructs a new ListSecretsResponse. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a ListSecretsResponse. + * @implements IListSecretsResponse * @constructor - * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IListSecretsResponse=} [properties] Properties to set */ - function UpdateSecretRequest(properties) { + function ListSecretsResponse(properties) { + this.secrets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12390,89 +13092,106 @@ } /** - * UpdateSecretRequest secret. - * @member {google.cloud.secrets.v1beta1.ISecret|null|undefined} secret - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * ListSecretsResponse secrets. + * @member {Array.} secrets + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @instance */ - UpdateSecretRequest.prototype.secret = null; + ListSecretsResponse.prototype.secrets = $util.emptyArray; /** - * UpdateSecretRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * ListSecretsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @instance */ - UpdateSecretRequest.prototype.updateMask = null; + ListSecretsResponse.prototype.nextPageToken = ""; /** - * Creates a new UpdateSecretRequest instance using the specified properties. + * ListSecretsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse + * @instance + */ + ListSecretsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListSecretsResponse instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static - * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretsResponse=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsResponse} ListSecretsResponse instance */ - UpdateSecretRequest.create = function create(properties) { - return new UpdateSecretRequest(properties); + ListSecretsResponse.create = function create(properties) { + return new ListSecretsResponse(properties); }; /** - * Encodes the specified UpdateSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.UpdateSecretRequest.verify|verify} messages. + * Encodes the specified ListSecretsResponse message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static - * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} message UpdateSecretRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretsResponse} message ListSecretsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecretRequest.encode = function encode(message, writer) { + ListSecretsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - $root.google.cloud.secrets.v1beta1.Secret.encode(message.secret, 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(); + if (message.secrets != null && message.secrets.length) + for (var i = 0; i < message.secrets.length; ++i) + $root.google.cloud.secretmanager.v1beta2.Secret.encode(message.secrets[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); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); return writer; }; /** - * Encodes the specified UpdateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.UpdateSecretRequest.verify|verify} messages. + * Encodes the specified ListSecretsResponse message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static - * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} message UpdateSecretRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretsResponse} message ListSecretsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSecretsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSecretRequest message from the specified reader or buffer. + * Decodes a ListSecretsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsResponse} ListSecretsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecretRequest.decode = function decode(reader, length) { + ListSecretsResponse.decode = function 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.secrets.v1beta1.UpdateSecretRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.ListSecretsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.secret = $root.google.cloud.secrets.v1beta1.Secret.decode(reader, reader.uint32()); + if (!(message.secrets && message.secrets.length)) + message.secrets = []; + message.secrets.push($root.google.cloud.secretmanager.v1beta2.Secret.decode(reader, reader.uint32())); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); break; } default: @@ -12484,141 +13203,159 @@ }; /** - * Decodes an UpdateSecretRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSecretsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsResponse} ListSecretsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecretRequest.decodeDelimited = function decodeDelimited(reader) { + ListSecretsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSecretRequest message. + * Verifies a ListSecretsResponse message. * @function verify - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSecretRequest.verify = function verify(message) { + ListSecretsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.secret != null && message.hasOwnProperty("secret")) { - var error = $root.google.cloud.secrets.v1beta1.Secret.verify(message.secret); - if (error) - return "secret." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.secrets != null && message.hasOwnProperty("secrets")) { + if (!Array.isArray(message.secrets)) + return "secrets: array expected"; + for (var i = 0; i < message.secrets.length; ++i) { + var error = $root.google.cloud.secretmanager.v1beta2.Secret.verify(message.secrets[i]); + if (error) + return "secrets." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates an UpdateSecretRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecretsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretsResponse} ListSecretsResponse */ - UpdateSecretRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.UpdateSecretRequest) + ListSecretsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ListSecretsResponse) return object; - var message = new $root.google.cloud.secrets.v1beta1.UpdateSecretRequest(); - if (object.secret != null) { - if (typeof object.secret !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.UpdateSecretRequest.secret: object expected"); - message.secret = $root.google.cloud.secrets.v1beta1.Secret.fromObject(object.secret); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.UpdateSecretRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.secretmanager.v1beta2.ListSecretsResponse(); + if (object.secrets) { + if (!Array.isArray(object.secrets)) + throw TypeError(".google.cloud.secretmanager.v1beta2.ListSecretsResponse.secrets: array expected"); + message.secrets = []; + for (var i = 0; i < object.secrets.length; ++i) { + if (typeof object.secrets[i] !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.ListSecretsResponse.secrets: object expected"); + message.secrets[i] = $root.google.cloud.secretmanager.v1beta2.Secret.fromObject(object.secrets[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from an UpdateSecretRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSecretsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static - * @param {google.cloud.secrets.v1beta1.UpdateSecretRequest} message UpdateSecretRequest + * @param {google.cloud.secretmanager.v1beta2.ListSecretsResponse} message ListSecretsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSecretRequest.toObject = function toObject(message, options) { + ListSecretsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.secrets = []; if (options.defaults) { - object.secret = null; - object.updateMask = null; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.secret != null && message.hasOwnProperty("secret")) - object.secret = $root.google.cloud.secrets.v1beta1.Secret.toObject(message.secret, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.secrets && message.secrets.length) { + object.secrets = []; + for (var j = 0; j < message.secrets.length; ++j) + object.secrets[j] = $root.google.cloud.secretmanager.v1beta2.Secret.toObject(message.secrets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this UpdateSecretRequest to JSON. + * Converts this ListSecretsResponse to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @instance * @returns {Object.} JSON object */ - UpdateSecretRequest.prototype.toJSON = function toJSON() { + ListSecretsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSecretRequest + * Gets the default type url for ListSecretsResponse * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecretsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.UpdateSecretRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ListSecretsResponse"; }; - return UpdateSecretRequest; + return ListSecretsResponse; })(); - v1beta1.AccessSecretVersionRequest = (function() { + v1beta2.CreateSecretRequest = (function() { /** - * Properties of an AccessSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IAccessSecretVersionRequest - * @property {string|null} [name] AccessSecretVersionRequest name + * Properties of a CreateSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface ICreateSecretRequest + * @property {string|null} [parent] CreateSecretRequest parent + * @property {string|null} [secretId] CreateSecretRequest secretId + * @property {google.cloud.secretmanager.v1beta2.ISecret|null} [secret] CreateSecretRequest secret */ /** - * Constructs a new AccessSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents an AccessSecretVersionRequest. - * @implements IAccessSecretVersionRequest + * Constructs a new CreateSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a CreateSecretRequest. + * @implements ICreateSecretRequest * @constructor - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.ICreateSecretRequest=} [properties] Properties to set */ - function AccessSecretVersionRequest(properties) { + function CreateSecretRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12626,75 +13363,103 @@ } /** - * AccessSecretVersionRequest name. - * @member {string} name - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * CreateSecretRequest parent. + * @member {string} parent + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @instance */ - AccessSecretVersionRequest.prototype.name = ""; + CreateSecretRequest.prototype.parent = ""; /** - * Creates a new AccessSecretVersionRequest instance using the specified properties. + * CreateSecretRequest secretId. + * @member {string} secretId + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest + * @instance + */ + CreateSecretRequest.prototype.secretId = ""; + + /** + * CreateSecretRequest secret. + * @member {google.cloud.secretmanager.v1beta2.ISecret|null|undefined} secret + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest + * @instance + */ + CreateSecretRequest.prototype.secret = null; + + /** + * Creates a new CreateSecretRequest instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest instance + * @param {google.cloud.secretmanager.v1beta2.ICreateSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.CreateSecretRequest} CreateSecretRequest instance */ - AccessSecretVersionRequest.create = function create(properties) { - return new AccessSecretVersionRequest(properties); + CreateSecretRequest.create = function create(properties) { + return new CreateSecretRequest(properties); }; /** - * Encodes the specified AccessSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionRequest.verify|verify} messages. + * Encodes the specified CreateSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CreateSecretRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} message AccessSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ICreateSecretRequest} message CreateSecretRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessSecretVersionRequest.encode = function encode(message, writer) { + CreateSecretRequest.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 1, wireType 2 =*/10).string(message.parent); + if (message.secretId != null && Object.hasOwnProperty.call(message, "secretId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretId); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + $root.google.cloud.secretmanager.v1beta2.Secret.encode(message.secret, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified AccessSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionRequest.verify|verify} messages. + * Encodes the specified CreateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.CreateSecretRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} message AccessSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.ICreateSecretRequest} message CreateSecretRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AccessSecretVersionRequest message from the specified reader or buffer. + * Decodes a CreateSecretRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.CreateSecretRequest} CreateSecretRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessSecretVersionRequest.decode = function decode(reader, length) { + CreateSecretRequest.decode = function 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.secrets.v1beta1.AccessSecretVersionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.CreateSecretRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.secretId = reader.string(); + break; + } + case 3: { + message.secret = $root.google.cloud.secretmanager.v1beta2.Secret.decode(reader, reader.uint32()); break; } default: @@ -12706,123 +13471,145 @@ }; /** - * Decodes an AccessSecretVersionRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecretRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.CreateSecretRequest} CreateSecretRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSecretRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AccessSecretVersionRequest message. + * Verifies a CreateSecretRequest message. * @function verify - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AccessSecretVersionRequest.verify = function verify(message) { + CreateSecretRequest.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.secretId != null && message.hasOwnProperty("secretId")) + if (!$util.isString(message.secretId)) + return "secretId: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) { + var error = $root.google.cloud.secretmanager.v1beta2.Secret.verify(message.secret); + if (error) + return "secret." + error; + } return null; }; /** - * Creates an AccessSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecretRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.CreateSecretRequest} CreateSecretRequest */ - AccessSecretVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.AccessSecretVersionRequest) + CreateSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.CreateSecretRequest) return object; - var message = new $root.google.cloud.secrets.v1beta1.AccessSecretVersionRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.secretmanager.v1beta2.CreateSecretRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.secretId != null) + message.secretId = String(object.secretId); + if (object.secret != null) { + if (typeof object.secret !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.CreateSecretRequest.secret: object expected"); + message.secret = $root.google.cloud.secretmanager.v1beta2.Secret.fromObject(object.secret); + } return message; }; /** - * Creates a plain object from an AccessSecretVersionRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecretRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} message AccessSecretVersionRequest + * @param {google.cloud.secretmanager.v1beta2.CreateSecretRequest} message CreateSecretRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AccessSecretVersionRequest.toObject = function toObject(message, options) { + CreateSecretRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.secretId = ""; + object.secret = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.secretId != null && message.hasOwnProperty("secretId")) + object.secretId = message.secretId; + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = $root.google.cloud.secretmanager.v1beta2.Secret.toObject(message.secret, options); return object; }; /** - * Converts this AccessSecretVersionRequest to JSON. + * Converts this CreateSecretRequest to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @instance * @returns {Object.} JSON object */ - AccessSecretVersionRequest.prototype.toJSON = function toJSON() { + CreateSecretRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AccessSecretVersionRequest + * Gets the default type url for CreateSecretRequest * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.CreateSecretRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AccessSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.AccessSecretVersionRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.CreateSecretRequest"; }; - return AccessSecretVersionRequest; + return CreateSecretRequest; })(); - v1beta1.AccessSecretVersionResponse = (function() { + v1beta2.AddSecretVersionRequest = (function() { /** - * Properties of an AccessSecretVersionResponse. - * @memberof google.cloud.secrets.v1beta1 - * @interface IAccessSecretVersionResponse - * @property {string|null} [name] AccessSecretVersionResponse name - * @property {google.cloud.secrets.v1beta1.ISecretPayload|null} [payload] AccessSecretVersionResponse payload + * Properties of an AddSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IAddSecretVersionRequest + * @property {string|null} [parent] AddSecretVersionRequest parent + * @property {google.cloud.secretmanager.v1beta2.ISecretPayload|null} [payload] AddSecretVersionRequest payload */ /** - * Constructs a new AccessSecretVersionResponse. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents an AccessSecretVersionResponse. - * @implements IAccessSecretVersionResponse + * Constructs a new AddSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents an AddSecretVersionRequest. + * @implements IAddSecretVersionRequest * @constructor - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest=} [properties] Properties to set */ - function AccessSecretVersionResponse(properties) { + function AddSecretVersionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12830,89 +13617,89 @@ } /** - * AccessSecretVersionResponse name. - * @member {string} name - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * AddSecretVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @instance */ - AccessSecretVersionResponse.prototype.name = ""; + AddSecretVersionRequest.prototype.parent = ""; /** - * AccessSecretVersionResponse payload. - * @member {google.cloud.secrets.v1beta1.ISecretPayload|null|undefined} payload - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * AddSecretVersionRequest payload. + * @member {google.cloud.secretmanager.v1beta2.ISecretPayload|null|undefined} payload + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @instance */ - AccessSecretVersionResponse.prototype.payload = null; + AddSecretVersionRequest.prototype.payload = null; /** - * Creates a new AccessSecretVersionResponse instance using the specified properties. + * Creates a new AddSecretVersionRequest instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse instance + * @param {google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.AddSecretVersionRequest} AddSecretVersionRequest instance */ - AccessSecretVersionResponse.create = function create(properties) { - return new AccessSecretVersionResponse(properties); + AddSecretVersionRequest.create = function create(properties) { + return new AddSecretVersionRequest(properties); }; /** - * Encodes the specified AccessSecretVersionResponse message. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionResponse.verify|verify} messages. + * Encodes the specified AddSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AddSecretVersionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse} message AccessSecretVersionResponse message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest} message AddSecretVersionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessSecretVersionResponse.encode = function encode(message, writer) { + AddSecretVersionRequest.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 1, wireType 2 =*/10).string(message.parent); if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.cloud.secrets.v1beta1.SecretPayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.secretmanager.v1beta2.SecretPayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified AccessSecretVersionResponse message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionResponse.verify|verify} messages. + * Encodes the specified AddSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AddSecretVersionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse} message AccessSecretVersionResponse message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest} message AddSecretVersionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessSecretVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AccessSecretVersionResponse message from the specified reader or buffer. + * Decodes an AddSecretVersionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse + * @returns {google.cloud.secretmanager.v1beta2.AddSecretVersionRequest} AddSecretVersionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessSecretVersionResponse.decode = function decode(reader, length) { + AddSecretVersionRequest.decode = function 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.secrets.v1beta1.AccessSecretVersionResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.decode(reader, reader.uint32()); + message.payload = $root.google.cloud.secretmanager.v1beta2.SecretPayload.decode(reader, reader.uint32()); break; } default: @@ -12924,37 +13711,37 @@ }; /** - * Decodes an AccessSecretVersionResponse message from the specified reader or buffer, length delimited. + * Decodes an AddSecretVersionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse + * @returns {google.cloud.secretmanager.v1beta2.AddSecretVersionRequest} AddSecretVersionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessSecretVersionResponse.decodeDelimited = function decodeDelimited(reader) { + AddSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AccessSecretVersionResponse message. + * Verifies an AddSecretVersionRequest message. * @function verify - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AccessSecretVersionResponse.verify = function verify(message) { + AddSecretVersionRequest.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.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.cloud.secrets.v1beta1.SecretPayload.verify(message.payload); + var error = $root.google.cloud.secretmanager.v1beta2.SecretPayload.verify(message.payload); if (error) return "payload." + error; } @@ -12962,98 +13749,98 @@ }; /** - * Creates an AccessSecretVersionResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddSecretVersionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse + * @returns {google.cloud.secretmanager.v1beta2.AddSecretVersionRequest} AddSecretVersionRequest */ - AccessSecretVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.AccessSecretVersionResponse) + AddSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest) return object; - var message = new $root.google.cloud.secrets.v1beta1.AccessSecretVersionResponse(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); if (object.payload != null) { if (typeof object.payload !== "object") - throw TypeError(".google.cloud.secrets.v1beta1.AccessSecretVersionResponse.payload: object expected"); - message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.fromObject(object.payload); + throw TypeError(".google.cloud.secretmanager.v1beta2.AddSecretVersionRequest.payload: object expected"); + message.payload = $root.google.cloud.secretmanager.v1beta2.SecretPayload.fromObject(object.payload); } return message; }; /** - * Creates a plain object from an AccessSecretVersionResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddSecretVersionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} message AccessSecretVersionResponse + * @param {google.cloud.secretmanager.v1beta2.AddSecretVersionRequest} message AddSecretVersionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AccessSecretVersionResponse.toObject = function toObject(message, options) { + AddSecretVersionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.parent = ""; object.payload = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.toObject(message.payload, options); + object.payload = $root.google.cloud.secretmanager.v1beta2.SecretPayload.toObject(message.payload, options); return object; }; /** - * Converts this AccessSecretVersionResponse to JSON. + * Converts this AddSecretVersionRequest to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @instance * @returns {Object.} JSON object */ - AccessSecretVersionResponse.prototype.toJSON = function toJSON() { + AddSecretVersionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AccessSecretVersionResponse + * Gets the default type url for AddSecretVersionRequest * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @memberof google.cloud.secretmanager.v1beta2.AddSecretVersionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AccessSecretVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AddSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.AccessSecretVersionResponse"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.AddSecretVersionRequest"; }; - return AccessSecretVersionResponse; + return AddSecretVersionRequest; })(); - v1beta1.DeleteSecretRequest = (function() { + v1beta2.GetSecretRequest = (function() { /** - * Properties of a DeleteSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IDeleteSecretRequest - * @property {string|null} [name] DeleteSecretRequest name + * Properties of a GetSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IGetSecretRequest + * @property {string|null} [name] GetSecretRequest name */ /** - * Constructs a new DeleteSecretRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a DeleteSecretRequest. - * @implements IDeleteSecretRequest + * Constructs a new GetSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a GetSecretRequest. + * @implements IGetSecretRequest * @constructor - * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IGetSecretRequest=} [properties] Properties to set */ - function DeleteSecretRequest(properties) { + function GetSecretRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13061,35 +13848,35 @@ } /** - * DeleteSecretRequest name. + * GetSecretRequest name. * @member {string} name - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @instance */ - DeleteSecretRequest.prototype.name = ""; + GetSecretRequest.prototype.name = ""; /** - * Creates a new DeleteSecretRequest instance using the specified properties. + * Creates a new GetSecretRequest instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest instance + * @param {google.cloud.secretmanager.v1beta2.IGetSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.GetSecretRequest} GetSecretRequest instance */ - DeleteSecretRequest.create = function create(properties) { - return new DeleteSecretRequest(properties); + GetSecretRequest.create = function create(properties) { + return new GetSecretRequest(properties); }; /** - * Encodes the specified DeleteSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.DeleteSecretRequest.verify|verify} messages. + * Encodes the specified GetSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} message DeleteSecretRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IGetSecretRequest} message GetSecretRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSecretRequest.encode = function encode(message, writer) { + GetSecretRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -13098,33 +13885,33 @@ }; /** - * Encodes the specified DeleteSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.DeleteSecretRequest.verify|verify} messages. + * Encodes the specified GetSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} message DeleteSecretRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IGetSecretRequest} message GetSecretRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteSecretRequest message from the specified reader or buffer. + * Decodes a GetSecretRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.GetSecretRequest} GetSecretRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSecretRequest.decode = function decode(reader, length) { + GetSecretRequest.decode = function 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.secrets.v1beta1.DeleteSecretRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.GetSecretRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13141,30 +13928,30 @@ }; /** - * Decodes a DeleteSecretRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSecretRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.GetSecretRequest} GetSecretRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSecretRequest.decodeDelimited = function decodeDelimited(reader) { + GetSecretRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteSecretRequest message. + * Verifies a GetSecretRequest message. * @function verify - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteSecretRequest.verify = function verify(message) { + GetSecretRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -13174,32 +13961,32 @@ }; /** - * Creates a DeleteSecretRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSecretRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest + * @returns {google.cloud.secretmanager.v1beta2.GetSecretRequest} GetSecretRequest */ - DeleteSecretRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.DeleteSecretRequest) + GetSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.GetSecretRequest) return object; - var message = new $root.google.cloud.secrets.v1beta1.DeleteSecretRequest(); + var message = new $root.google.cloud.secretmanager.v1beta2.GetSecretRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteSecretRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSecretRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static - * @param {google.cloud.secrets.v1beta1.DeleteSecretRequest} message DeleteSecretRequest + * @param {google.cloud.secretmanager.v1beta2.GetSecretRequest} message GetSecretRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSecretRequest.toObject = function toObject(message, options) { + GetSecretRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -13211,52 +13998,55 @@ }; /** - * Converts this DeleteSecretRequest to JSON. + * Converts this GetSecretRequest to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @instance * @returns {Object.} JSON object */ - DeleteSecretRequest.prototype.toJSON = function toJSON() { + GetSecretRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteSecretRequest + * Gets the default type url for GetSecretRequest * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.DeleteSecretRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.GetSecretRequest"; }; - return DeleteSecretRequest; + return GetSecretRequest; })(); - v1beta1.DisableSecretVersionRequest = (function() { + v1beta2.ListSecretVersionsRequest = (function() { /** - * Properties of a DisableSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IDisableSecretVersionRequest - * @property {string|null} [name] DisableSecretVersionRequest name + * Properties of a ListSecretVersionsRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IListSecretVersionsRequest + * @property {string|null} [parent] ListSecretVersionsRequest parent + * @property {number|null} [pageSize] ListSecretVersionsRequest pageSize + * @property {string|null} [pageToken] ListSecretVersionsRequest pageToken + * @property {string|null} [filter] ListSecretVersionsRequest filter */ /** - * Constructs a new DisableSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a DisableSecretVersionRequest. - * @implements IDisableSecretVersionRequest + * Constructs a new ListSecretVersionsRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a ListSecretVersionsRequest. + * @implements IListSecretVersionsRequest * @constructor - * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest=} [properties] Properties to set */ - function DisableSecretVersionRequest(properties) { + function ListSecretVersionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13264,75 +14054,117 @@ } /** - * DisableSecretVersionRequest name. - * @member {string} name - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * ListSecretVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @instance */ - DisableSecretVersionRequest.prototype.name = ""; + ListSecretVersionsRequest.prototype.parent = ""; /** - * Creates a new DisableSecretVersionRequest instance using the specified properties. + * ListSecretVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest + * @instance + */ + ListSecretVersionsRequest.prototype.pageSize = 0; + + /** + * ListSecretVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest + * @instance + */ + ListSecretVersionsRequest.prototype.pageToken = ""; + + /** + * ListSecretVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest + * @instance + */ + ListSecretVersionsRequest.prototype.filter = ""; + + /** + * Creates a new ListSecretVersionsRequest instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static - * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest} ListSecretVersionsRequest instance */ - DisableSecretVersionRequest.create = function create(properties) { - return new DisableSecretVersionRequest(properties); + ListSecretVersionsRequest.create = function create(properties) { + return new ListSecretVersionsRequest(properties); }; /** - * Encodes the specified DisableSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.DisableSecretVersionRequest.verify|verify} messages. + * Encodes the specified ListSecretVersionsRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static - * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} message DisableSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest} message ListSecretVersionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisableSecretVersionRequest.encode = function encode(message, writer) { + ListSecretVersionsRequest.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 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 DisableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.DisableSecretVersionRequest.verify|verify} messages. + * Encodes the specified ListSecretVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static - * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} message DisableSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest} message ListSecretVersionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisableSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSecretVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DisableSecretVersionRequest message from the specified reader or buffer. + * Decodes a ListSecretVersionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest} ListSecretVersionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisableSecretVersionRequest.decode = function decode(reader, length) { + ListSecretVersionsRequest.decode = function 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.secrets.v1beta1.DisableSecretVersionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); break; } default: @@ -13344,122 +14176,150 @@ }; /** - * Decodes a DisableSecretVersionRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSecretVersionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest} ListSecretVersionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisableSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + ListSecretVersionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DisableSecretVersionRequest message. + * Verifies a ListSecretVersionsRequest message. * @function verify - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DisableSecretVersionRequest.verify = function verify(message) { + ListSecretVersionsRequest.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.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 DisableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecretVersionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest} ListSecretVersionsRequest */ - DisableSecretVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.DisableSecretVersionRequest) + ListSecretVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest) return object; - var message = new $root.google.cloud.secrets.v1beta1.DisableSecretVersionRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 DisableSecretVersionRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSecretVersionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static - * @param {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} message DisableSecretVersionRequest + * @param {google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest} message ListSecretVersionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DisableSecretVersionRequest.toObject = function toObject(message, options) { + ListSecretVersionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.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 DisableSecretVersionRequest to JSON. + * Converts this ListSecretVersionsRequest to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @instance * @returns {Object.} JSON object */ - DisableSecretVersionRequest.prototype.toJSON = function toJSON() { + ListSecretVersionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DisableSecretVersionRequest + * Gets the default type url for ListSecretVersionsRequest * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DisableSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecretVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.DisableSecretVersionRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest"; }; - return DisableSecretVersionRequest; + return ListSecretVersionsRequest; })(); - v1beta1.EnableSecretVersionRequest = (function() { + v1beta2.ListSecretVersionsResponse = (function() { /** - * Properties of an EnableSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IEnableSecretVersionRequest - * @property {string|null} [name] EnableSecretVersionRequest name + * Properties of a ListSecretVersionsResponse. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IListSecretVersionsResponse + * @property {Array.|null} [versions] ListSecretVersionsResponse versions + * @property {string|null} [nextPageToken] ListSecretVersionsResponse nextPageToken + * @property {number|null} [totalSize] ListSecretVersionsResponse totalSize */ /** - * Constructs a new EnableSecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents an EnableSecretVersionRequest. - * @implements IEnableSecretVersionRequest + * Constructs a new ListSecretVersionsResponse. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a ListSecretVersionsResponse. + * @implements IListSecretVersionsResponse * @constructor - * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse=} [properties] Properties to set */ - function EnableSecretVersionRequest(properties) { + function ListSecretVersionsResponse(properties) { + this.versions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13467,75 +14327,106 @@ } /** - * EnableSecretVersionRequest name. - * @member {string} name - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * ListSecretVersionsResponse versions. + * @member {Array.} versions + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @instance */ - EnableSecretVersionRequest.prototype.name = ""; + ListSecretVersionsResponse.prototype.versions = $util.emptyArray; /** - * Creates a new EnableSecretVersionRequest instance using the specified properties. + * ListSecretVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse + * @instance + */ + ListSecretVersionsResponse.prototype.nextPageToken = ""; + + /** + * ListSecretVersionsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse + * @instance + */ + ListSecretVersionsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListSecretVersionsResponse instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static - * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest instance + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse} ListSecretVersionsResponse instance */ - EnableSecretVersionRequest.create = function create(properties) { - return new EnableSecretVersionRequest(properties); + ListSecretVersionsResponse.create = function create(properties) { + return new ListSecretVersionsResponse(properties); }; /** - * Encodes the specified EnableSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.EnableSecretVersionRequest.verify|verify} messages. + * Encodes the specified ListSecretVersionsResponse message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static - * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} message EnableSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse} message ListSecretVersionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnableSecretVersionRequest.encode = function encode(message, writer) { + ListSecretVersionsResponse.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.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.cloud.secretmanager.v1beta2.SecretVersion.encode(message.versions[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); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); return writer; }; /** - * Encodes the specified EnableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.EnableSecretVersionRequest.verify|verify} messages. + * Encodes the specified ListSecretVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static - * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} message EnableSecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse} message ListSecretVersionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnableSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSecretVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnableSecretVersionRequest message from the specified reader or buffer. + * Decodes a ListSecretVersionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse} ListSecretVersionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnableSecretVersionRequest.decode = function decode(reader, length) { + ListSecretVersionsResponse.decode = function 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.secrets.v1beta1.EnableSecretVersionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.cloud.secretmanager.v1beta2.SecretVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); break; } default: @@ -13547,122 +14438,157 @@ }; /** - * Decodes an EnableSecretVersionRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSecretVersionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse} ListSecretVersionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnableSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + ListSecretVersionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnableSecretVersionRequest message. + * Verifies a ListSecretVersionsResponse message. * @function verify - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnableSecretVersionRequest.verify = function verify(message) { + ListSecretVersionsResponse.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.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.cloud.secretmanager.v1beta2.SecretVersion.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates an EnableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecretVersionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse} ListSecretVersionsResponse */ - EnableSecretVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.EnableSecretVersionRequest) + ListSecretVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse) return object; - var message = new $root.google.cloud.secrets.v1beta1.EnableSecretVersionRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse.versions: object expected"); + message.versions[i] = $root.google.cloud.secretmanager.v1beta2.SecretVersion.fromObject(object.versions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from an EnableSecretVersionRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSecretVersionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static - * @param {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} message EnableSecretVersionRequest + * @param {google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse} message ListSecretVersionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnableSecretVersionRequest.toObject = function toObject(message, options) { + ListSecretVersionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.cloud.secretmanager.v1beta2.SecretVersion.toObject(message.versions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this EnableSecretVersionRequest to JSON. + * Converts this ListSecretVersionsResponse to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @instance * @returns {Object.} JSON object */ - EnableSecretVersionRequest.prototype.toJSON = function toJSON() { + ListSecretVersionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnableSecretVersionRequest + * Gets the default type url for ListSecretVersionsResponse * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnableSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecretVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.EnableSecretVersionRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse"; }; - return EnableSecretVersionRequest; + return ListSecretVersionsResponse; })(); - v1beta1.DestroySecretVersionRequest = (function() { + v1beta2.GetSecretVersionRequest = (function() { /** - * Properties of a DestroySecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @interface IDestroySecretVersionRequest - * @property {string|null} [name] DestroySecretVersionRequest name + * Properties of a GetSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IGetSecretVersionRequest + * @property {string|null} [name] GetSecretVersionRequest name */ /** - * Constructs a new DestroySecretVersionRequest. - * @memberof google.cloud.secrets.v1beta1 - * @classdesc Represents a DestroySecretVersionRequest. - * @implements IDestroySecretVersionRequest + * Constructs a new GetSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a GetSecretVersionRequest. + * @implements IGetSecretVersionRequest * @constructor - * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest=} [properties] Properties to set + * @param {google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest=} [properties] Properties to set */ - function DestroySecretVersionRequest(properties) { + function GetSecretVersionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13670,35 +14596,35 @@ } /** - * DestroySecretVersionRequest name. + * GetSecretVersionRequest name. * @member {string} name - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @instance */ - DestroySecretVersionRequest.prototype.name = ""; + GetSecretVersionRequest.prototype.name = ""; /** - * Creates a new DestroySecretVersionRequest instance using the specified properties. + * Creates a new GetSecretVersionRequest instance using the specified properties. * @function create - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest=} [properties] Properties to set - * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest instance + * @param {google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.GetSecretVersionRequest} GetSecretVersionRequest instance */ - DestroySecretVersionRequest.create = function create(properties) { - return new DestroySecretVersionRequest(properties); + GetSecretVersionRequest.create = function create(properties) { + return new GetSecretVersionRequest(properties); }; /** - * Encodes the specified DestroySecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.DestroySecretVersionRequest.verify|verify} messages. + * Encodes the specified GetSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretVersionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} message DestroySecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest} message GetSecretVersionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DestroySecretVersionRequest.encode = function encode(message, writer) { + GetSecretVersionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -13707,33 +14633,33 @@ }; /** - * Encodes the specified DestroySecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.DestroySecretVersionRequest.verify|verify} messages. + * Encodes the specified GetSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.GetSecretVersionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} message DestroySecretVersionRequest message or plain object to encode + * @param {google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest} message GetSecretVersionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DestroySecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DestroySecretVersionRequest message from the specified reader or buffer. + * Decodes a GetSecretVersionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.GetSecretVersionRequest} GetSecretVersionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DestroySecretVersionRequest.decode = function decode(reader, length) { + GetSecretVersionRequest.decode = function 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.secrets.v1beta1.DestroySecretVersionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13750,30 +14676,30 @@ }; /** - * Decodes a DestroySecretVersionRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSecretVersionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.GetSecretVersionRequest} GetSecretVersionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DestroySecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + GetSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DestroySecretVersionRequest message. + * Verifies a GetSecretVersionRequest message. * @function verify - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DestroySecretVersionRequest.verify = function verify(message) { + GetSecretVersionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -13783,32 +14709,32 @@ }; /** - * Creates a DestroySecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSecretVersionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest + * @returns {google.cloud.secretmanager.v1beta2.GetSecretVersionRequest} GetSecretVersionRequest */ - DestroySecretVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.secrets.v1beta1.DestroySecretVersionRequest) + GetSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest) return object; - var message = new $root.google.cloud.secrets.v1beta1.DestroySecretVersionRequest(); + var message = new $root.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DestroySecretVersionRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSecretVersionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static - * @param {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} message DestroySecretVersionRequest + * @param {google.cloud.secretmanager.v1beta2.GetSecretVersionRequest} message GetSecretVersionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DestroySecretVersionRequest.toObject = function toObject(message, options) { + GetSecretVersionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -13820,295 +14746,7577 @@ }; /** - * Converts this DestroySecretVersionRequest to JSON. + * Converts this GetSecretVersionRequest to JSON. * @function toJSON - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @instance * @returns {Object.} JSON object */ - DestroySecretVersionRequest.prototype.toJSON = function toJSON() { + GetSecretVersionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DestroySecretVersionRequest + * Gets the default type url for GetSecretVersionRequest * @function getTypeUrl - * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @memberof google.cloud.secretmanager.v1beta2.GetSecretVersionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DestroySecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.secrets.v1beta1.DestroySecretVersionRequest"; + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.GetSecretVersionRequest"; }; - return DestroySecretVersionRequest; + return GetSecretVersionRequest; })(); - return v1beta1; - })(); - - return secrets; - })(); - - return cloud; - })(); + v1beta2.UpdateSecretRequest = (function() { - google.api = (function() { + /** + * Properties of an UpdateSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IUpdateSecretRequest + * @property {google.cloud.secretmanager.v1beta2.ISecret|null} [secret] UpdateSecretRequest secret + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecretRequest updateMask + */ - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Constructs a new UpdateSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents an UpdateSecretRequest. + * @implements IUpdateSecretRequest + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IUpdateSecretRequest=} [properties] Properties to set + */ + function UpdateSecretRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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 - */ - 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; - return values; - })(); + /** + * UpdateSecretRequest secret. + * @member {google.cloud.secretmanager.v1beta2.ISecret|null|undefined} secret + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @instance + */ + UpdateSecretRequest.prototype.secret = null; - api.ResourceDescriptor = (function() { + /** + * UpdateSecretRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @instance + */ + UpdateSecretRequest.prototype.updateMask = null; - /** - * 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 - */ + /** + * Creates a new UpdateSecretRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IUpdateSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.UpdateSecretRequest} UpdateSecretRequest instance + */ + UpdateSecretRequest.create = function create(properties) { + return new UpdateSecretRequest(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified UpdateSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.UpdateSecretRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IUpdateSecretRequest} message UpdateSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecretRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + $root.google.cloud.secretmanager.v1beta2.Secret.encode(message.secret, 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; + }; - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; + /** + * Encodes the specified UpdateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.UpdateSecretRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IUpdateSecretRequest} message UpdateSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + /** + * Decodes an UpdateSecretRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.UpdateSecretRequest} UpdateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecretRequest.decode = function 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.secretmanager.v1beta2.UpdateSecretRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.secret = $root.google.cloud.secretmanager.v1beta2.Secret.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; + }; - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; + /** + * Decodes an UpdateSecretRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.UpdateSecretRequest} UpdateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecretRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; + /** + * Verifies an UpdateSecretRequest message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecretRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secret != null && message.hasOwnProperty("secret")) { + var error = $root.google.cloud.secretmanager.v1beta2.Secret.verify(message.secret); + if (error) + return "secret." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; + /** + * Creates an UpdateSecretRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.UpdateSecretRequest} UpdateSecretRequest + */ + UpdateSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.UpdateSecretRequest) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.UpdateSecretRequest(); + if (object.secret != null) { + if (typeof object.secret !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.UpdateSecretRequest.secret: object expected"); + message.secret = $root.google.cloud.secretmanager.v1beta2.Secret.fromObject(object.secret); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.UpdateSecretRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; + /** + * Creates a plain object from an UpdateSecretRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.UpdateSecretRequest} message UpdateSecretRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecretRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.secret = null; + object.updateMask = null; + } + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = $root.google.cloud.secretmanager.v1beta2.Secret.toObject(message.secret, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; + /** + * Converts this UpdateSecretRequest to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecretRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + /** + * Gets the default type url for UpdateSecretRequest + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.UpdateSecretRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.UpdateSecretRequest"; + }; - /** - * 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; - }; + return UpdateSecretRequest; + })(); - /** - * 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(); - }; + v1beta2.AccessSecretVersionRequest = (function() { - /** - * 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; - }; + /** + * Properties of an AccessSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IAccessSecretVersionRequest + * @property {string|null} [name] AccessSecretVersionRequest name + */ - /** - * 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 + /** + * Constructs a new AccessSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents an AccessSecretVersionRequest. + * @implements IAccessSecretVersionRequest + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest=} [properties] Properties to set + */ + function AccessSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessSecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @instance + */ + AccessSecretVersionRequest.prototype.name = ""; + + /** + * Creates a new AccessSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest} AccessSecretVersionRequest instance + */ + AccessSecretVersionRequest.create = function create(properties) { + return new AccessSecretVersionRequest(properties); + }; + + /** + * Encodes the specified AccessSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest} message AccessSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionRequest.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 AccessSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest} message AccessSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest} AccessSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionRequest.decode = function 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.secretmanager.v1beta2.AccessSecretVersionRequest(); + 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 an AccessSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest} AccessSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSecretVersionRequest.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 an AccessSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest} AccessSecretVersionRequest + */ + AccessSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AccessSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest} message AccessSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSecretVersionRequest.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 AccessSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + AccessSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest"; + }; + + return AccessSecretVersionRequest; + })(); + + v1beta2.AccessSecretVersionResponse = (function() { + + /** + * Properties of an AccessSecretVersionResponse. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IAccessSecretVersionResponse + * @property {string|null} [name] AccessSecretVersionResponse name + * @property {google.cloud.secretmanager.v1beta2.ISecretPayload|null} [payload] AccessSecretVersionResponse payload + */ + + /** + * Constructs a new AccessSecretVersionResponse. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents an AccessSecretVersionResponse. + * @implements IAccessSecretVersionResponse + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse=} [properties] Properties to set + */ + function AccessSecretVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessSecretVersionResponse name. + * @member {string} name + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @instance + */ + AccessSecretVersionResponse.prototype.name = ""; + + /** + * AccessSecretVersionResponse payload. + * @member {google.cloud.secretmanager.v1beta2.ISecretPayload|null|undefined} payload + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @instance + */ + AccessSecretVersionResponse.prototype.payload = null; + + /** + * Creates a new AccessSecretVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse} AccessSecretVersionResponse instance + */ + AccessSecretVersionResponse.create = function create(properties) { + return new AccessSecretVersionResponse(properties); + }; + + /** + * Encodes the specified AccessSecretVersionResponse message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse} message AccessSecretVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionResponse.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.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.cloud.secretmanager.v1beta2.SecretPayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessSecretVersionResponse message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse} message AccessSecretVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSecretVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse} AccessSecretVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionResponse.decode = function 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.secretmanager.v1beta2.AccessSecretVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.payload = $root.google.cloud.secretmanager.v1beta2.SecretPayload.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessSecretVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse} AccessSecretVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSecretVersionResponse message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSecretVersionResponse.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.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.secretmanager.v1beta2.SecretPayload.verify(message.payload); + if (error) + return "payload." + error; + } + return null; + }; + + /** + * Creates an AccessSecretVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse} AccessSecretVersionResponse + */ + AccessSecretVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse.payload: object expected"); + message.payload = $root.google.cloud.secretmanager.v1beta2.SecretPayload.fromObject(object.payload); + } + return message; + }; + + /** + * Creates a plain object from an AccessSecretVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse} message AccessSecretVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSecretVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.payload = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.secretmanager.v1beta2.SecretPayload.toObject(message.payload, options); + return object; + }; + + /** + * Converts this AccessSecretVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @instance + * @returns {Object.} JSON object + */ + AccessSecretVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessSecretVersionResponse + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSecretVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse"; + }; + + return AccessSecretVersionResponse; + })(); + + v1beta2.DeleteSecretRequest = (function() { + + /** + * Properties of a DeleteSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IDeleteSecretRequest + * @property {string|null} [name] DeleteSecretRequest name + * @property {string|null} [etag] DeleteSecretRequest etag + */ + + /** + * Constructs a new DeleteSecretRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a DeleteSecretRequest. + * @implements IDeleteSecretRequest + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IDeleteSecretRequest=} [properties] Properties to set + */ + function DeleteSecretRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSecretRequest name. + * @member {string} name + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @instance + */ + DeleteSecretRequest.prototype.name = ""; + + /** + * DeleteSecretRequest etag. + * @member {string} etag + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @instance + */ + DeleteSecretRequest.prototype.etag = ""; + + /** + * Creates a new DeleteSecretRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDeleteSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.DeleteSecretRequest} DeleteSecretRequest instance + */ + DeleteSecretRequest.create = function create(properties) { + return new DeleteSecretRequest(properties); + }; + + /** + * Encodes the specified DeleteSecretRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DeleteSecretRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDeleteSecretRequest} message DeleteSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecretRequest.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DeleteSecretRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDeleteSecretRequest} message DeleteSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSecretRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.DeleteSecretRequest} DeleteSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecretRequest.decode = function 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.secretmanager.v1beta2.DeleteSecretRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSecretRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.DeleteSecretRequest} DeleteSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecretRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecretRequest message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecretRequest.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteSecretRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.DeleteSecretRequest} DeleteSecretRequest + */ + DeleteSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.DeleteSecretRequest) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.DeleteSecretRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteSecretRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.DeleteSecretRequest} message DeleteSecretRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSecretRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteSecretRequest to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSecretRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSecretRequest + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.DeleteSecretRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.DeleteSecretRequest"; + }; + + return DeleteSecretRequest; + })(); + + v1beta2.DisableSecretVersionRequest = (function() { + + /** + * Properties of a DisableSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IDisableSecretVersionRequest + * @property {string|null} [name] DisableSecretVersionRequest name + * @property {string|null} [etag] DisableSecretVersionRequest etag + */ + + /** + * Constructs a new DisableSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a DisableSecretVersionRequest. + * @implements IDisableSecretVersionRequest + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest=} [properties] Properties to set + */ + function DisableSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableSecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @instance + */ + DisableSecretVersionRequest.prototype.name = ""; + + /** + * DisableSecretVersionRequest etag. + * @member {string} etag + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @instance + */ + DisableSecretVersionRequest.prototype.etag = ""; + + /** + * Creates a new DisableSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest} DisableSecretVersionRequest instance + */ + DisableSecretVersionRequest.create = function create(properties) { + return new DisableSecretVersionRequest(properties); + }; + + /** + * Encodes the specified DisableSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest} message DisableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableSecretVersionRequest.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DisableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest} message DisableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest} DisableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableSecretVersionRequest.decode = function 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.secretmanager.v1beta2.DisableSecretVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisableSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest} DisableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableSecretVersionRequest.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DisableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest} DisableSecretVersionRequest + */ + DisableSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DisableSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest} message DisableSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableSecretVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DisableSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DisableSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest"; + }; + + return DisableSecretVersionRequest; + })(); + + v1beta2.EnableSecretVersionRequest = (function() { + + /** + * Properties of an EnableSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IEnableSecretVersionRequest + * @property {string|null} [name] EnableSecretVersionRequest name + * @property {string|null} [etag] EnableSecretVersionRequest etag + */ + + /** + * Constructs a new EnableSecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents an EnableSecretVersionRequest. + * @implements IEnableSecretVersionRequest + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest=} [properties] Properties to set + */ + function EnableSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableSecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @instance + */ + EnableSecretVersionRequest.prototype.name = ""; + + /** + * EnableSecretVersionRequest etag. + * @member {string} etag + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @instance + */ + EnableSecretVersionRequest.prototype.etag = ""; + + /** + * Creates a new EnableSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest} EnableSecretVersionRequest instance + */ + EnableSecretVersionRequest.create = function create(properties) { + return new EnableSecretVersionRequest(properties); + }; + + /** + * Encodes the specified EnableSecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest} message EnableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableSecretVersionRequest.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified EnableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest} message EnableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest} EnableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableSecretVersionRequest.decode = function 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.secretmanager.v1beta2.EnableSecretVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnableSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest} EnableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableSecretVersionRequest.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an EnableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest} EnableSecretVersionRequest + */ + EnableSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an EnableSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest} message EnableSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableSecretVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this EnableSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + EnableSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest"; + }; + + return EnableSecretVersionRequest; + })(); + + v1beta2.DestroySecretVersionRequest = (function() { + + /** + * Properties of a DestroySecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @interface IDestroySecretVersionRequest + * @property {string|null} [name] DestroySecretVersionRequest name + * @property {string|null} [etag] DestroySecretVersionRequest etag + */ + + /** + * Constructs a new DestroySecretVersionRequest. + * @memberof google.cloud.secretmanager.v1beta2 + * @classdesc Represents a DestroySecretVersionRequest. + * @implements IDestroySecretVersionRequest + * @constructor + * @param {google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest=} [properties] Properties to set + */ + function DestroySecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DestroySecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @instance + */ + DestroySecretVersionRequest.prototype.name = ""; + + /** + * DestroySecretVersionRequest etag. + * @member {string} etag + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @instance + */ + DestroySecretVersionRequest.prototype.etag = ""; + + /** + * Creates a new DestroySecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest} DestroySecretVersionRequest instance + */ + DestroySecretVersionRequest.create = function create(properties) { + return new DestroySecretVersionRequest(properties); + }; + + /** + * Encodes the specified DestroySecretVersionRequest message. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest} message DestroySecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroySecretVersionRequest.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DestroySecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest} message DestroySecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroySecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestroySecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest} DestroySecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroySecretVersionRequest.decode = function 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.secretmanager.v1beta2.DestroySecretVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestroySecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest} DestroySecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroySecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestroySecretVersionRequest message. + * @function verify + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestroySecretVersionRequest.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DestroySecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest} DestroySecretVersionRequest + */ + DestroySecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest) + return object; + var message = new $root.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DestroySecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest} message DestroySecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestroySecretVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DestroySecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DestroySecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestroySecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestroySecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest"; + }; + + return DestroySecretVersionRequest; + })(); + + return v1beta2; + })(); + + return secretmanager; + })(); + + cloud.secrets = (function() { + + /** + * Namespace secrets. + * @memberof google.cloud + * @namespace + */ + var secrets = {}; + + secrets.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.secrets + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Secret = (function() { + + /** + * Properties of a Secret. + * @memberof google.cloud.secrets.v1beta1 + * @interface ISecret + * @property {string|null} [name] Secret name + * @property {google.cloud.secrets.v1beta1.IReplication|null} [replication] Secret replication + * @property {google.protobuf.ITimestamp|null} [createTime] Secret createTime + * @property {Object.|null} [labels] Secret labels + */ + + /** + * Constructs a new Secret. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a Secret. + * @implements ISecret + * @constructor + * @param {google.cloud.secrets.v1beta1.ISecret=} [properties] Properties to set + */ + function Secret(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]]; + } + + /** + * Secret name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.Secret + * @instance + */ + Secret.prototype.name = ""; + + /** + * Secret replication. + * @member {google.cloud.secrets.v1beta1.IReplication|null|undefined} replication + * @memberof google.cloud.secrets.v1beta1.Secret + * @instance + */ + Secret.prototype.replication = null; + + /** + * Secret createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.secrets.v1beta1.Secret + * @instance + */ + Secret.prototype.createTime = null; + + /** + * Secret labels. + * @member {Object.} labels + * @memberof google.cloud.secrets.v1beta1.Secret + * @instance + */ + Secret.prototype.labels = $util.emptyObject; + + /** + * Creates a new Secret instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {google.cloud.secrets.v1beta1.ISecret=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.Secret} Secret instance + */ + Secret.create = function create(properties) { + return new Secret(properties); + }; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.cloud.secrets.v1beta1.Secret.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {google.cloud.secrets.v1beta1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.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.replication != null && Object.hasOwnProperty.call(message, "replication")) + $root.google.cloud.secrets.v1beta1.Replication.encode(message.replication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Secret.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {google.cloud.secrets.v1beta1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decode = function 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.secrets.v1beta1.Secret(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.replication = $root.google.cloud.secrets.v1beta1.Replication.decode(reader, reader.uint32()); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Secret message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Secret.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.replication != null && message.hasOwnProperty("replication")) { + var error = $root.google.cloud.secrets.v1beta1.Replication.verify(message.replication); + if (error) + return "replication." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + 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"; + } + return null; + }; + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.Secret} Secret + */ + Secret.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.Secret) + return object; + var message = new $root.google.cloud.secrets.v1beta1.Secret(); + if (object.name != null) + message.name = String(object.name); + if (object.replication != null) { + if (typeof object.replication !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.Secret.replication: object expected"); + message.replication = $root.google.cloud.secrets.v1beta1.Replication.fromObject(object.replication); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.Secret.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.Secret.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]]); + } + return message; + }; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {google.cloud.secrets.v1beta1.Secret} message Secret + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Secret.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.replication = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.replication != null && message.hasOwnProperty("replication")) + object.replication = $root.google.cloud.secrets.v1beta1.Replication.toObject(message.replication, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + 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]]; + } + return object; + }; + + /** + * Converts this Secret to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.Secret + * @instance + * @returns {Object.} JSON object + */ + Secret.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Secret + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.Secret + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Secret.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Secret"; + }; + + return Secret; + })(); + + v1beta1.SecretVersion = (function() { + + /** + * Properties of a SecretVersion. + * @memberof google.cloud.secrets.v1beta1 + * @interface ISecretVersion + * @property {string|null} [name] SecretVersion name + * @property {google.protobuf.ITimestamp|null} [createTime] SecretVersion createTime + * @property {google.protobuf.ITimestamp|null} [destroyTime] SecretVersion destroyTime + * @property {google.cloud.secrets.v1beta1.SecretVersion.State|null} [state] SecretVersion state + */ + + /** + * Constructs a new SecretVersion. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a SecretVersion. + * @implements ISecretVersion + * @constructor + * @param {google.cloud.secrets.v1beta1.ISecretVersion=} [properties] Properties to set + */ + function SecretVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecretVersion name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @instance + */ + SecretVersion.prototype.name = ""; + + /** + * SecretVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @instance + */ + SecretVersion.prototype.createTime = null; + + /** + * SecretVersion destroyTime. + * @member {google.protobuf.ITimestamp|null|undefined} destroyTime + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @instance + */ + SecretVersion.prototype.destroyTime = null; + + /** + * SecretVersion state. + * @member {google.cloud.secrets.v1beta1.SecretVersion.State} state + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @instance + */ + SecretVersion.prototype.state = 0; + + /** + * Creates a new SecretVersion instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {google.cloud.secrets.v1beta1.ISecretVersion=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion instance + */ + SecretVersion.create = function create(properties) { + return new SecretVersion(properties); + }; + + /** + * Encodes the specified SecretVersion message. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {google.cloud.secrets.v1beta1.ISecretVersion} message SecretVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVersion.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.destroyTime != null && Object.hasOwnProperty.call(message, "destroyTime")) + $root.google.protobuf.Timestamp.encode(message.destroyTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + return writer; + }; + + /** + * Encodes the specified SecretVersion message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {google.cloud.secrets.v1beta1.ISecretVersion} message SecretVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecretVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVersion.decode = function 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.secrets.v1beta1.SecretVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.destroyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecretVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecretVersion message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretVersion.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.destroyTime); + if (error) + return "destroyTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SecretVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.SecretVersion} SecretVersion + */ + SecretVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.SecretVersion) + return object; + var message = new $root.google.cloud.secrets.v1beta1.SecretVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.SecretVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.destroyTime != null) { + if (typeof object.destroyTime !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.SecretVersion.destroyTime: object expected"); + message.destroyTime = $root.google.protobuf.Timestamp.fromObject(object.destroyTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "DESTROYED": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SecretVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {google.cloud.secrets.v1beta1.SecretVersion} message SecretVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.destroyTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) + object.destroyTime = $root.google.protobuf.Timestamp.toObject(message.destroyTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.secrets.v1beta1.SecretVersion.State[message.state] === undefined ? message.state : $root.google.cloud.secrets.v1beta1.SecretVersion.State[message.state] : message.state; + return object; + }; + + /** + * Converts this SecretVersion to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @instance + * @returns {Object.} JSON object + */ + SecretVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretVersion + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.SecretVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.SecretVersion"; + }; + + /** + * State enum. + * @name google.cloud.secrets.v1beta1.SecretVersion.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} DESTROYED=3 DESTROYED value + */ + SecretVersion.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "DESTROYED"] = 3; + return values; + })(); + + return SecretVersion; + })(); + + v1beta1.Replication = (function() { + + /** + * Properties of a Replication. + * @memberof google.cloud.secrets.v1beta1 + * @interface IReplication + * @property {google.cloud.secrets.v1beta1.Replication.IAutomatic|null} [automatic] Replication automatic + * @property {google.cloud.secrets.v1beta1.Replication.IUserManaged|null} [userManaged] Replication userManaged + */ + + /** + * Constructs a new Replication. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a Replication. + * @implements IReplication + * @constructor + * @param {google.cloud.secrets.v1beta1.IReplication=} [properties] Properties to set + */ + function Replication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Replication automatic. + * @member {google.cloud.secrets.v1beta1.Replication.IAutomatic|null|undefined} automatic + * @memberof google.cloud.secrets.v1beta1.Replication + * @instance + */ + Replication.prototype.automatic = null; + + /** + * Replication userManaged. + * @member {google.cloud.secrets.v1beta1.Replication.IUserManaged|null|undefined} userManaged + * @memberof google.cloud.secrets.v1beta1.Replication + * @instance + */ + Replication.prototype.userManaged = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Replication replication. + * @member {"automatic"|"userManaged"|undefined} replication + * @memberof google.cloud.secrets.v1beta1.Replication + * @instance + */ + Object.defineProperty(Replication.prototype, "replication", { + get: $util.oneOfGetter($oneOfFields = ["automatic", "userManaged"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Replication instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {google.cloud.secrets.v1beta1.IReplication=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.Replication} Replication instance + */ + Replication.create = function create(properties) { + return new Replication(properties); + }; + + /** + * Encodes the specified Replication message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {google.cloud.secrets.v1beta1.IReplication} message Replication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Replication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.automatic != null && Object.hasOwnProperty.call(message, "automatic")) + $root.google.cloud.secrets.v1beta1.Replication.Automatic.encode(message.automatic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.userManaged != null && Object.hasOwnProperty.call(message, "userManaged")) + $root.google.cloud.secrets.v1beta1.Replication.UserManaged.encode(message.userManaged, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Replication message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {google.cloud.secrets.v1beta1.IReplication} message Replication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Replication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Replication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.Replication} Replication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Replication.decode = function 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.secrets.v1beta1.Replication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.automatic = $root.google.cloud.secrets.v1beta1.Replication.Automatic.decode(reader, reader.uint32()); + break; + } + case 2: { + message.userManaged = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Replication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.Replication} Replication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Replication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Replication message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Replication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.automatic != null && message.hasOwnProperty("automatic")) { + properties.replication = 1; + { + var error = $root.google.cloud.secrets.v1beta1.Replication.Automatic.verify(message.automatic); + if (error) + return "automatic." + error; + } + } + if (message.userManaged != null && message.hasOwnProperty("userManaged")) { + if (properties.replication === 1) + return "replication: multiple values"; + properties.replication = 1; + { + var error = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.verify(message.userManaged); + if (error) + return "userManaged." + error; + } + } + return null; + }; + + /** + * Creates a Replication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.Replication} Replication + */ + Replication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.Replication) + return object; + var message = new $root.google.cloud.secrets.v1beta1.Replication(); + if (object.automatic != null) { + if (typeof object.automatic !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.Replication.automatic: object expected"); + message.automatic = $root.google.cloud.secrets.v1beta1.Replication.Automatic.fromObject(object.automatic); + } + if (object.userManaged != null) { + if (typeof object.userManaged !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.Replication.userManaged: object expected"); + message.userManaged = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.fromObject(object.userManaged); + } + return message; + }; + + /** + * Creates a plain object from a Replication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {google.cloud.secrets.v1beta1.Replication} message Replication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Replication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.automatic != null && message.hasOwnProperty("automatic")) { + object.automatic = $root.google.cloud.secrets.v1beta1.Replication.Automatic.toObject(message.automatic, options); + if (options.oneofs) + object.replication = "automatic"; + } + if (message.userManaged != null && message.hasOwnProperty("userManaged")) { + object.userManaged = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.toObject(message.userManaged, options); + if (options.oneofs) + object.replication = "userManaged"; + } + return object; + }; + + /** + * Converts this Replication to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.Replication + * @instance + * @returns {Object.} JSON object + */ + Replication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Replication + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.Replication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Replication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication"; + }; + + Replication.Automatic = (function() { + + /** + * Properties of an Automatic. + * @memberof google.cloud.secrets.v1beta1.Replication + * @interface IAutomatic + */ + + /** + * Constructs a new Automatic. + * @memberof google.cloud.secrets.v1beta1.Replication + * @classdesc Represents an Automatic. + * @implements IAutomatic + * @constructor + * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic=} [properties] Properties to set + */ + function Automatic(properties) { + if (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 Automatic instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic instance + */ + Automatic.create = function create(properties) { + return new Automatic(properties); + }; + + /** + * Encodes the specified Automatic message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.Automatic.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic} message Automatic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Automatic.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Automatic message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.Automatic.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {google.cloud.secrets.v1beta1.Replication.IAutomatic} message Automatic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Automatic.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Automatic message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Automatic.decode = function 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.secrets.v1beta1.Replication.Automatic(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Automatic message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Automatic.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Automatic message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Automatic.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Automatic message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.Replication.Automatic} Automatic + */ + Automatic.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.Replication.Automatic) + return object; + return new $root.google.cloud.secrets.v1beta1.Replication.Automatic(); + }; + + /** + * Creates a plain object from an Automatic message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {google.cloud.secrets.v1beta1.Replication.Automatic} message Automatic + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Automatic.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Automatic to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @instance + * @returns {Object.} JSON object + */ + Automatic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Automatic + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.Replication.Automatic + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Automatic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication.Automatic"; + }; + + return Automatic; + })(); + + Replication.UserManaged = (function() { + + /** + * Properties of a UserManaged. + * @memberof google.cloud.secrets.v1beta1.Replication + * @interface IUserManaged + * @property {Array.|null} [replicas] UserManaged replicas + */ + + /** + * Constructs a new UserManaged. + * @memberof google.cloud.secrets.v1beta1.Replication + * @classdesc Represents a UserManaged. + * @implements IUserManaged + * @constructor + * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged=} [properties] Properties to set + */ + function UserManaged(properties) { + this.replicas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserManaged replicas. + * @member {Array.} replicas + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @instance + */ + UserManaged.prototype.replicas = $util.emptyArray; + + /** + * Creates a new UserManaged instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged instance + */ + UserManaged.create = function create(properties) { + return new UserManaged(properties); + }; + + /** + * Encodes the specified UserManaged message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged} message UserManaged message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserManaged.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicas != null && message.replicas.length) + for (var i = 0; i < message.replicas.length; ++i) + $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.encode(message.replicas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserManaged message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {google.cloud.secrets.v1beta1.Replication.IUserManaged} message UserManaged message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserManaged.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserManaged message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserManaged.decode = function 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.secrets.v1beta1.Replication.UserManaged(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.replicas && message.replicas.length)) + message.replicas = []; + message.replicas.push($root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserManaged message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserManaged.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserManaged message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserManaged.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicas != null && message.hasOwnProperty("replicas")) { + if (!Array.isArray(message.replicas)) + return "replicas: array expected"; + for (var i = 0; i < message.replicas.length; ++i) { + var error = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.verify(message.replicas[i]); + if (error) + return "replicas." + error; + } + } + return null; + }; + + /** + * Creates a UserManaged message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged} UserManaged + */ + UserManaged.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.Replication.UserManaged) + return object; + var message = new $root.google.cloud.secrets.v1beta1.Replication.UserManaged(); + if (object.replicas) { + if (!Array.isArray(object.replicas)) + throw TypeError(".google.cloud.secrets.v1beta1.Replication.UserManaged.replicas: array expected"); + message.replicas = []; + for (var i = 0; i < object.replicas.length; ++i) { + if (typeof object.replicas[i] !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.Replication.UserManaged.replicas: object expected"); + message.replicas[i] = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.fromObject(object.replicas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a UserManaged message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {google.cloud.secrets.v1beta1.Replication.UserManaged} message UserManaged + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserManaged.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicas = []; + if (message.replicas && message.replicas.length) { + object.replicas = []; + for (var j = 0; j < message.replicas.length; ++j) + object.replicas[j] = $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.toObject(message.replicas[j], options); + } + return object; + }; + + /** + * Converts this UserManaged to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @instance + * @returns {Object.} JSON object + */ + UserManaged.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserManaged + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserManaged.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication.UserManaged"; + }; + + UserManaged.Replica = (function() { + + /** + * Properties of a Replica. + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @interface IReplica + * @property {string|null} [location] Replica location + */ + + /** + * Constructs a new Replica. + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged + * @classdesc Represents a Replica. + * @implements IReplica + * @constructor + * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica=} [properties] Properties to set + */ + function Replica(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Replica location. + * @member {string} location + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @instance + */ + Replica.prototype.location = ""; + + /** + * Creates a new Replica instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica instance + */ + Replica.create = function create(properties) { + return new Replica(properties); + }; + + /** + * Encodes the specified Replica message. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica} message Replica message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Replica.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + return writer; + }; + + /** + * Encodes the specified Replica message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.IReplica} message Replica message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Replica.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Replica message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Replica.decode = function 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.secrets.v1beta1.Replication.UserManaged.Replica(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Replica message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Replica.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Replica message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Replica.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Replica message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} Replica + */ + Replica.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica) + return object; + var message = new $root.google.cloud.secrets.v1beta1.Replication.UserManaged.Replica(); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Replica message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {google.cloud.secrets.v1beta1.Replication.UserManaged.Replica} message Replica + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Replica.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Replica to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @instance + * @returns {Object.} JSON object + */ + Replica.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Replica + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.Replication.UserManaged.Replica + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Replica.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.Replication.UserManaged.Replica"; + }; + + return Replica; + })(); + + return UserManaged; + })(); + + return Replication; + })(); + + v1beta1.SecretPayload = (function() { + + /** + * Properties of a SecretPayload. + * @memberof google.cloud.secrets.v1beta1 + * @interface ISecretPayload + * @property {Uint8Array|null} [data] SecretPayload data + */ + + /** + * Constructs a new SecretPayload. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a SecretPayload. + * @implements ISecretPayload + * @constructor + * @param {google.cloud.secrets.v1beta1.ISecretPayload=} [properties] Properties to set + */ + function SecretPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecretPayload data. + * @member {Uint8Array} data + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @instance + */ + SecretPayload.prototype.data = $util.newBuffer([]); + + /** + * Creates a new SecretPayload instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {google.cloud.secrets.v1beta1.ISecretPayload=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload instance + */ + SecretPayload.create = function create(properties) { + return new SecretPayload(properties); + }; + + /** + * Encodes the specified SecretPayload message. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {google.cloud.secrets.v1beta1.ISecretPayload} message SecretPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified SecretPayload message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.SecretPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {google.cloud.secrets.v1beta1.ISecretPayload} message SecretPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecretPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretPayload.decode = function 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.secrets.v1beta1.SecretPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecretPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecretPayload message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a SecretPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.SecretPayload} SecretPayload + */ + SecretPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.SecretPayload) + return object; + var message = new $root.google.cloud.secrets.v1beta1.SecretPayload(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a SecretPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {google.cloud.secrets.v1beta1.SecretPayload} message SecretPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this SecretPayload to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @instance + * @returns {Object.} JSON object + */ + SecretPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretPayload + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.SecretPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.SecretPayload"; + }; + + return SecretPayload; + })(); + + v1beta1.SecretManagerService = (function() { + + /** + * Constructs a new SecretManagerService service. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a SecretManagerService + * @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 SecretManagerService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecretManagerService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecretManagerService; + + /** + * Creates new SecretManagerService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @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 {SecretManagerService} RPC service. Useful where requests and/or responses are streamed. + */ + SecretManagerService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|listSecrets}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef ListSecretsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.ListSecretsResponse} [response] ListSecretsResponse + */ + + /** + * Calls ListSecrets. + * @function listSecrets + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} request ListSecretsRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.ListSecretsCallback} callback Node-style callback called with the error, if any, and ListSecretsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.listSecrets = function listSecrets(request, callback) { + return this.rpcCall(listSecrets, $root.google.cloud.secrets.v1beta1.ListSecretsRequest, $root.google.cloud.secrets.v1beta1.ListSecretsResponse, request, callback); + }, "name", { value: "ListSecrets" }); + + /** + * Calls ListSecrets. + * @function listSecrets + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} request ListSecretsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|createSecret}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef CreateSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.Secret} [response] Secret + */ + + /** + * Calls CreateSecret. + * @function createSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} request CreateSecretRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.CreateSecretCallback} callback Node-style callback called with the error, if any, and Secret + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.createSecret = function createSecret(request, callback) { + return this.rpcCall(createSecret, $root.google.cloud.secrets.v1beta1.CreateSecretRequest, $root.google.cloud.secrets.v1beta1.Secret, request, callback); + }, "name", { value: "CreateSecret" }); + + /** + * Calls CreateSecret. + * @function createSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} request CreateSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|addSecretVersion}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef AddSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion + */ + + /** + * Calls AddSecretVersion. + * @function addSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} request AddSecretVersionRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.AddSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.addSecretVersion = function addSecretVersion(request, callback) { + return this.rpcCall(addSecretVersion, $root.google.cloud.secrets.v1beta1.AddSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); + }, "name", { value: "AddSecretVersion" }); + + /** + * Calls AddSecretVersion. + * @function addSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} request AddSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|getSecret}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef GetSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.Secret} [response] Secret + */ + + /** + * Calls GetSecret. + * @function getSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} request GetSecretRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.GetSecretCallback} callback Node-style callback called with the error, if any, and Secret + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.getSecret = function getSecret(request, callback) { + return this.rpcCall(getSecret, $root.google.cloud.secrets.v1beta1.GetSecretRequest, $root.google.cloud.secrets.v1beta1.Secret, request, callback); + }, "name", { value: "GetSecret" }); + + /** + * Calls GetSecret. + * @function getSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} request GetSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|updateSecret}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef UpdateSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.Secret} [response] Secret + */ + + /** + * Calls UpdateSecret. + * @function updateSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} request UpdateSecretRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.UpdateSecretCallback} callback Node-style callback called with the error, if any, and Secret + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.updateSecret = function updateSecret(request, callback) { + return this.rpcCall(updateSecret, $root.google.cloud.secrets.v1beta1.UpdateSecretRequest, $root.google.cloud.secrets.v1beta1.Secret, request, callback); + }, "name", { value: "UpdateSecret" }); + + /** + * Calls UpdateSecret. + * @function updateSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} request UpdateSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|deleteSecret}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef DeleteSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSecret. + * @function deleteSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} request DeleteSecretRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.DeleteSecretCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.deleteSecret = function deleteSecret(request, callback) { + return this.rpcCall(deleteSecret, $root.google.cloud.secrets.v1beta1.DeleteSecretRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSecret" }); + + /** + * Calls DeleteSecret. + * @function deleteSecret + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} request DeleteSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|listSecretVersions}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef ListSecretVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} [response] ListSecretVersionsResponse + */ + + /** + * Calls ListSecretVersions. + * @function listSecretVersions + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} request ListSecretVersionsRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersionsCallback} callback Node-style callback called with the error, if any, and ListSecretVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.listSecretVersions = function listSecretVersions(request, callback) { + return this.rpcCall(listSecretVersions, $root.google.cloud.secrets.v1beta1.ListSecretVersionsRequest, $root.google.cloud.secrets.v1beta1.ListSecretVersionsResponse, request, callback); + }, "name", { value: "ListSecretVersions" }); + + /** + * Calls ListSecretVersions. + * @function listSecretVersions + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} request ListSecretVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|getSecretVersion}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef GetSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion + */ + + /** + * Calls GetSecretVersion. + * @function getSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} request GetSecretVersionRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.GetSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.getSecretVersion = function getSecretVersion(request, callback) { + return this.rpcCall(getSecretVersion, $root.google.cloud.secrets.v1beta1.GetSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); + }, "name", { value: "GetSecretVersion" }); + + /** + * Calls GetSecretVersion. + * @function getSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} request GetSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|accessSecretVersion}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef AccessSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} [response] AccessSecretVersionResponse + */ + + /** + * Calls AccessSecretVersion. + * @function accessSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} request AccessSecretVersionRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersionCallback} callback Node-style callback called with the error, if any, and AccessSecretVersionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.accessSecretVersion = function accessSecretVersion(request, callback) { + return this.rpcCall(accessSecretVersion, $root.google.cloud.secrets.v1beta1.AccessSecretVersionRequest, $root.google.cloud.secrets.v1beta1.AccessSecretVersionResponse, request, callback); + }, "name", { value: "AccessSecretVersion" }); + + /** + * Calls AccessSecretVersion. + * @function accessSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} request AccessSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|disableSecretVersion}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef DisableSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion + */ + + /** + * Calls DisableSecretVersion. + * @function disableSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} request DisableSecretVersionRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.DisableSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.disableSecretVersion = function disableSecretVersion(request, callback) { + return this.rpcCall(disableSecretVersion, $root.google.cloud.secrets.v1beta1.DisableSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); + }, "name", { value: "DisableSecretVersion" }); + + /** + * Calls DisableSecretVersion. + * @function disableSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} request DisableSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|enableSecretVersion}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef EnableSecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion + */ + + /** + * Calls EnableSecretVersion. + * @function enableSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} request EnableSecretVersionRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.EnableSecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.enableSecretVersion = function enableSecretVersion(request, callback) { + return this.rpcCall(enableSecretVersion, $root.google.cloud.secrets.v1beta1.EnableSecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); + }, "name", { value: "EnableSecretVersion" }); + + /** + * Calls EnableSecretVersion. + * @function enableSecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} request EnableSecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|destroySecretVersion}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef DestroySecretVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.secrets.v1beta1.SecretVersion} [response] SecretVersion + */ + + /** + * Calls DestroySecretVersion. + * @function destroySecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} request DestroySecretVersionRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.DestroySecretVersionCallback} callback Node-style callback called with the error, if any, and SecretVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.destroySecretVersion = function destroySecretVersion(request, callback) { + return this.rpcCall(destroySecretVersion, $root.google.cloud.secrets.v1beta1.DestroySecretVersionRequest, $root.google.cloud.secrets.v1beta1.SecretVersion, request, callback); + }, "name", { value: "DestroySecretVersion" }); + + /** + * Calls DestroySecretVersion. + * @function destroySecretVersion + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} request DestroySecretVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|setIamPolicy}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|getIamPolicy}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.secrets.v1beta1.SecretManagerService|testIamPermissions}. + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.secrets.v1beta1.SecretManagerService.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecretManagerService.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.secrets.v1beta1.SecretManagerService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecretManagerService; + })(); + + v1beta1.ListSecretsRequest = (function() { + + /** + * Properties of a ListSecretsRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IListSecretsRequest + * @property {string|null} [parent] ListSecretsRequest parent + * @property {number|null} [pageSize] ListSecretsRequest pageSize + * @property {string|null} [pageToken] ListSecretsRequest pageToken + */ + + /** + * Constructs a new ListSecretsRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a ListSecretsRequest. + * @implements IListSecretsRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IListSecretsRequest=} [properties] Properties to set + */ + function ListSecretsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecretsRequest parent. + * @member {string} parent + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @instance + */ + ListSecretsRequest.prototype.parent = ""; + + /** + * ListSecretsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @instance + */ + ListSecretsRequest.prototype.pageSize = 0; + + /** + * ListSecretsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @instance + */ + ListSecretsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSecretsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretsRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest instance + */ + ListSecretsRequest.create = function create(properties) { + return new ListSecretsRequest(properties); + }; + + /** + * Encodes the specified ListSecretsRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} message ListSecretsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListSecretsRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretsRequest} message ListSecretsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecretsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretsRequest.decode = function 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.secrets.v1beta1.ListSecretsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = 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 ListSecretsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecretsRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecretsRequest.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.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 ListSecretsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.ListSecretsRequest} ListSecretsRequest + */ + ListSecretsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretsRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.ListSecretsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListSecretsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {google.cloud.secrets.v1beta1.ListSecretsRequest} message ListSecretsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecretsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListSecretsRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSecretsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecretsRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.ListSecretsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecretsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretsRequest"; + }; + + return ListSecretsRequest; + })(); + + v1beta1.ListSecretsResponse = (function() { + + /** + * Properties of a ListSecretsResponse. + * @memberof google.cloud.secrets.v1beta1 + * @interface IListSecretsResponse + * @property {Array.|null} [secrets] ListSecretsResponse secrets + * @property {string|null} [nextPageToken] ListSecretsResponse nextPageToken + * @property {number|null} [totalSize] ListSecretsResponse totalSize + */ + + /** + * Constructs a new ListSecretsResponse. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a ListSecretsResponse. + * @implements IListSecretsResponse + * @constructor + * @param {google.cloud.secrets.v1beta1.IListSecretsResponse=} [properties] Properties to set + */ + function ListSecretsResponse(properties) { + this.secrets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecretsResponse secrets. + * @member {Array.} secrets + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @instance + */ + ListSecretsResponse.prototype.secrets = $util.emptyArray; + + /** + * ListSecretsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @instance + */ + ListSecretsResponse.prototype.nextPageToken = ""; + + /** + * ListSecretsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @instance + */ + ListSecretsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListSecretsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretsResponse=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse instance + */ + ListSecretsResponse.create = function create(properties) { + return new ListSecretsResponse(properties); + }; + + /** + * Encodes the specified ListSecretsResponse message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretsResponse} message ListSecretsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secrets != null && message.secrets.length) + for (var i = 0; i < message.secrets.length; ++i) + $root.google.cloud.secrets.v1beta1.Secret.encode(message.secrets[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); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListSecretsResponse message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretsResponse} message ListSecretsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecretsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretsResponse.decode = function 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.secrets.v1beta1.ListSecretsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.secrets && message.secrets.length)) + message.secrets = []; + message.secrets.push($root.google.cloud.secrets.v1beta1.Secret.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecretsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecretsResponse message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecretsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secrets != null && message.hasOwnProperty("secrets")) { + if (!Array.isArray(message.secrets)) + return "secrets: array expected"; + for (var i = 0; i < message.secrets.length; ++i) { + var error = $root.google.cloud.secrets.v1beta1.Secret.verify(message.secrets[i]); + if (error) + return "secrets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListSecretsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.ListSecretsResponse} ListSecretsResponse + */ + ListSecretsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretsResponse) + return object; + var message = new $root.google.cloud.secrets.v1beta1.ListSecretsResponse(); + if (object.secrets) { + if (!Array.isArray(object.secrets)) + throw TypeError(".google.cloud.secrets.v1beta1.ListSecretsResponse.secrets: array expected"); + message.secrets = []; + for (var i = 0; i < object.secrets.length; ++i) { + if (typeof object.secrets[i] !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.ListSecretsResponse.secrets: object expected"); + message.secrets[i] = $root.google.cloud.secrets.v1beta1.Secret.fromObject(object.secrets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListSecretsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {google.cloud.secrets.v1beta1.ListSecretsResponse} message ListSecretsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecretsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secrets = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.secrets && message.secrets.length) { + object.secrets = []; + for (var j = 0; j < message.secrets.length; ++j) + object.secrets[j] = $root.google.cloud.secrets.v1beta1.Secret.toObject(message.secrets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListSecretsResponse to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSecretsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecretsResponse + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.ListSecretsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecretsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretsResponse"; + }; + + return ListSecretsResponse; + })(); + + v1beta1.CreateSecretRequest = (function() { + + /** + * Properties of a CreateSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface ICreateSecretRequest + * @property {string|null} [parent] CreateSecretRequest parent + * @property {string|null} [secretId] CreateSecretRequest secretId + * @property {google.cloud.secrets.v1beta1.ISecret|null} [secret] CreateSecretRequest secret + */ + + /** + * Constructs a new CreateSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a CreateSecretRequest. + * @implements ICreateSecretRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest=} [properties] Properties to set + */ + function CreateSecretRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecretRequest parent. + * @member {string} parent + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @instance + */ + CreateSecretRequest.prototype.parent = ""; + + /** + * CreateSecretRequest secretId. + * @member {string} secretId + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @instance + */ + CreateSecretRequest.prototype.secretId = ""; + + /** + * CreateSecretRequest secret. + * @member {google.cloud.secrets.v1beta1.ISecret|null|undefined} secret + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @instance + */ + CreateSecretRequest.prototype.secret = null; + + /** + * Creates a new CreateSecretRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest instance + */ + CreateSecretRequest.create = function create(properties) { + return new CreateSecretRequest(properties); + }; + + /** + * Encodes the specified CreateSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.CreateSecretRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} message CreateSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecretRequest.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.secretId != null && Object.hasOwnProperty.call(message, "secretId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretId); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + $root.google.cloud.secrets.v1beta1.Secret.encode(message.secret, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.CreateSecretRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.ICreateSecretRequest} message CreateSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecretRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecretRequest.decode = function 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.secrets.v1beta1.CreateSecretRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.secretId = reader.string(); + break; + } + case 3: { + message.secret = $root.google.cloud.secrets.v1beta1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecretRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecretRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecretRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecretRequest.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.secretId != null && message.hasOwnProperty("secretId")) + if (!$util.isString(message.secretId)) + return "secretId: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) { + var error = $root.google.cloud.secrets.v1beta1.Secret.verify(message.secret); + if (error) + return "secret." + error; + } + return null; + }; + + /** + * Creates a CreateSecretRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.CreateSecretRequest} CreateSecretRequest + */ + CreateSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.CreateSecretRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.CreateSecretRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.secretId != null) + message.secretId = String(object.secretId); + if (object.secret != null) { + if (typeof object.secret !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.CreateSecretRequest.secret: object expected"); + message.secret = $root.google.cloud.secrets.v1beta1.Secret.fromObject(object.secret); + } + return message; + }; + + /** + * Creates a plain object from a CreateSecretRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.CreateSecretRequest} message CreateSecretRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecretRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.secretId = ""; + object.secret = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.secretId != null && message.hasOwnProperty("secretId")) + object.secretId = message.secretId; + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = $root.google.cloud.secrets.v1beta1.Secret.toObject(message.secret, options); + return object; + }; + + /** + * Converts this CreateSecretRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecretRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecretRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.CreateSecretRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.CreateSecretRequest"; + }; + + return CreateSecretRequest; + })(); + + v1beta1.AddSecretVersionRequest = (function() { + + /** + * Properties of an AddSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IAddSecretVersionRequest + * @property {string|null} [parent] AddSecretVersionRequest parent + * @property {google.cloud.secrets.v1beta1.ISecretPayload|null} [payload] AddSecretVersionRequest payload + */ + + /** + * Constructs a new AddSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents an AddSecretVersionRequest. + * @implements IAddSecretVersionRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest=} [properties] Properties to set + */ + function AddSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddSecretVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @instance + */ + AddSecretVersionRequest.prototype.parent = ""; + + /** + * AddSecretVersionRequest payload. + * @member {google.cloud.secrets.v1beta1.ISecretPayload|null|undefined} payload + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @instance + */ + AddSecretVersionRequest.prototype.payload = null; + + /** + * Creates a new AddSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest instance + */ + AddSecretVersionRequest.create = function create(properties) { + return new AddSecretVersionRequest(properties); + }; + + /** + * Encodes the specified AddSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.AddSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} message AddSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSecretVersionRequest.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.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.cloud.secrets.v1beta1.SecretPayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.AddSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IAddSecretVersionRequest} message AddSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSecretVersionRequest.decode = function 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.secrets.v1beta1.AddSecretVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddSecretVersionRequest.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.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.secrets.v1beta1.SecretPayload.verify(message.payload); + if (error) + return "payload." + error; + } + return null; + }; + + /** + * Creates an AddSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.AddSecretVersionRequest} AddSecretVersionRequest + */ + AddSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.AddSecretVersionRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.AddSecretVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.AddSecretVersionRequest.payload: object expected"); + message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.fromObject(object.payload); + } + return message; + }; + + /** + * Creates a plain object from an AddSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.AddSecretVersionRequest} message AddSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddSecretVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.payload = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.toObject(message.payload, options); + return object; + }; + + /** + * Converts this AddSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + AddSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.AddSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.AddSecretVersionRequest"; + }; + + return AddSecretVersionRequest; + })(); + + v1beta1.GetSecretRequest = (function() { + + /** + * Properties of a GetSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IGetSecretRequest + * @property {string|null} [name] GetSecretRequest name + */ + + /** + * Constructs a new GetSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a GetSecretRequest. + * @implements IGetSecretRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IGetSecretRequest=} [properties] Properties to set + */ + function GetSecretRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSecretRequest name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @instance + */ + GetSecretRequest.prototype.name = ""; + + /** + * Creates a new GetSecretRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IGetSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest instance + */ + GetSecretRequest.create = function create(properties) { + return new GetSecretRequest(properties); + }; + + /** + * Encodes the specified GetSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} message GetSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecretRequest.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 GetSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IGetSecretRequest} message GetSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSecretRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecretRequest.decode = function 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.secrets.v1beta1.GetSecretRequest(); + 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 GetSecretRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecretRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSecretRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSecretRequest.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 GetSecretRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.GetSecretRequest} GetSecretRequest + */ + GetSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.GetSecretRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.GetSecretRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSecretRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.GetSecretRequest} message GetSecretRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSecretRequest.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 GetSecretRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @instance + * @returns {Object.} JSON object + */ + GetSecretRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSecretRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.GetSecretRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.GetSecretRequest"; + }; + + return GetSecretRequest; + })(); + + v1beta1.ListSecretVersionsRequest = (function() { + + /** + * Properties of a ListSecretVersionsRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IListSecretVersionsRequest + * @property {string|null} [parent] ListSecretVersionsRequest parent + * @property {number|null} [pageSize] ListSecretVersionsRequest pageSize + * @property {string|null} [pageToken] ListSecretVersionsRequest pageToken + */ + + /** + * Constructs a new ListSecretVersionsRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a ListSecretVersionsRequest. + * @implements IListSecretVersionsRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest=} [properties] Properties to set + */ + function ListSecretVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecretVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @instance + */ + ListSecretVersionsRequest.prototype.parent = ""; + + /** + * ListSecretVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @instance + */ + ListSecretVersionsRequest.prototype.pageSize = 0; + + /** + * ListSecretVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @instance + */ + ListSecretVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSecretVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest instance + */ + ListSecretVersionsRequest.create = function create(properties) { + return new ListSecretVersionsRequest(properties); + }; + + /** + * Encodes the specified ListSecretVersionsRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} message ListSecretVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretVersionsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListSecretVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsRequest} message ListSecretVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecretVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretVersionsRequest.decode = function 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.secrets.v1beta1.ListSecretVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = 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 ListSecretVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecretVersionsRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecretVersionsRequest.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.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 ListSecretVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} ListSecretVersionsRequest + */ + ListSecretVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretVersionsRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.ListSecretVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListSecretVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {google.cloud.secrets.v1beta1.ListSecretVersionsRequest} message ListSecretVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecretVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListSecretVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSecretVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecretVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecretVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretVersionsRequest"; + }; + + return ListSecretVersionsRequest; + })(); + + v1beta1.ListSecretVersionsResponse = (function() { + + /** + * Properties of a ListSecretVersionsResponse. + * @memberof google.cloud.secrets.v1beta1 + * @interface IListSecretVersionsResponse + * @property {Array.|null} [versions] ListSecretVersionsResponse versions + * @property {string|null} [nextPageToken] ListSecretVersionsResponse nextPageToken + * @property {number|null} [totalSize] ListSecretVersionsResponse totalSize + */ + + /** + * Constructs a new ListSecretVersionsResponse. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a ListSecretVersionsResponse. + * @implements IListSecretVersionsResponse + * @constructor + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse=} [properties] Properties to set + */ + function ListSecretVersionsResponse(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecretVersionsResponse versions. + * @member {Array.} versions + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @instance + */ + ListSecretVersionsResponse.prototype.versions = $util.emptyArray; + + /** + * ListSecretVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @instance + */ + ListSecretVersionsResponse.prototype.nextPageToken = ""; + + /** + * ListSecretVersionsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @instance + */ + ListSecretVersionsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListSecretVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse instance + */ + ListSecretVersionsResponse.create = function create(properties) { + return new ListSecretVersionsResponse(properties); + }; + + /** + * Encodes the specified ListSecretVersionsResponse message. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse} message ListSecretVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.cloud.secrets.v1beta1.SecretVersion.encode(message.versions[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); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListSecretVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.ListSecretVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {google.cloud.secrets.v1beta1.IListSecretVersionsResponse} message ListSecretVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecretVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecretVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretVersionsResponse.decode = function 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.secrets.v1beta1.ListSecretVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.cloud.secrets.v1beta1.SecretVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecretVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecretVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecretVersionsResponse message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecretVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.cloud.secrets.v1beta1.SecretVersion.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListSecretVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} ListSecretVersionsResponse + */ + ListSecretVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.ListSecretVersionsResponse) + return object; + var message = new $root.google.cloud.secrets.v1beta1.ListSecretVersionsResponse(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.secrets.v1beta1.ListSecretVersionsResponse.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.ListSecretVersionsResponse.versions: object expected"); + message.versions[i] = $root.google.cloud.secrets.v1beta1.SecretVersion.fromObject(object.versions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListSecretVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {google.cloud.secrets.v1beta1.ListSecretVersionsResponse} message ListSecretVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecretVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.cloud.secrets.v1beta1.SecretVersion.toObject(message.versions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListSecretVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSecretVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecretVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.ListSecretVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecretVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.ListSecretVersionsResponse"; + }; + + return ListSecretVersionsResponse; + })(); + + v1beta1.GetSecretVersionRequest = (function() { + + /** + * Properties of a GetSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IGetSecretVersionRequest + * @property {string|null} [name] GetSecretVersionRequest name + */ + + /** + * Constructs a new GetSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a GetSecretVersionRequest. + * @implements IGetSecretVersionRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest=} [properties] Properties to set + */ + function GetSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @instance + */ + GetSecretVersionRequest.prototype.name = ""; + + /** + * Creates a new GetSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest instance + */ + GetSecretVersionRequest.create = function create(properties) { + return new GetSecretVersionRequest(properties); + }; + + /** + * Encodes the specified GetSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} message GetSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecretVersionRequest.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 GetSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.GetSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IGetSecretVersionRequest} message GetSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecretVersionRequest.decode = function 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.secrets.v1beta1.GetSecretVersionRequest(); + 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 GetSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSecretVersionRequest.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 GetSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.GetSecretVersionRequest} GetSecretVersionRequest + */ + GetSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.GetSecretVersionRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.GetSecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.GetSecretVersionRequest} message GetSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSecretVersionRequest.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 GetSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.GetSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.GetSecretVersionRequest"; + }; + + return GetSecretVersionRequest; + })(); + + v1beta1.UpdateSecretRequest = (function() { + + /** + * Properties of an UpdateSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IUpdateSecretRequest + * @property {google.cloud.secrets.v1beta1.ISecret|null} [secret] UpdateSecretRequest secret + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecretRequest updateMask + */ + + /** + * Constructs a new UpdateSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents an UpdateSecretRequest. + * @implements IUpdateSecretRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest=} [properties] Properties to set + */ + function UpdateSecretRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecretRequest secret. + * @member {google.cloud.secrets.v1beta1.ISecret|null|undefined} secret + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @instance + */ + UpdateSecretRequest.prototype.secret = null; + + /** + * UpdateSecretRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @instance + */ + UpdateSecretRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSecretRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest instance + */ + UpdateSecretRequest.create = function create(properties) { + return new UpdateSecretRequest(properties); + }; + + /** + * Encodes the specified UpdateSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.UpdateSecretRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} message UpdateSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecretRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + $root.google.cloud.secrets.v1beta1.Secret.encode(message.secret, 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 UpdateSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.UpdateSecretRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IUpdateSecretRequest} message UpdateSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecretRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecretRequest.decode = function 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.secrets.v1beta1.UpdateSecretRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.secret = $root.google.cloud.secrets.v1beta1.Secret.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 UpdateSecretRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecretRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecretRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecretRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secret != null && message.hasOwnProperty("secret")) { + var error = $root.google.cloud.secrets.v1beta1.Secret.verify(message.secret); + if (error) + return "secret." + 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 UpdateSecretRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.UpdateSecretRequest} UpdateSecretRequest + */ + UpdateSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.UpdateSecretRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.UpdateSecretRequest(); + if (object.secret != null) { + if (typeof object.secret !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.UpdateSecretRequest.secret: object expected"); + message.secret = $root.google.cloud.secrets.v1beta1.Secret.fromObject(object.secret); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.UpdateSecretRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecretRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.UpdateSecretRequest} message UpdateSecretRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecretRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.secret = null; + object.updateMask = null; + } + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = $root.google.cloud.secrets.v1beta1.Secret.toObject(message.secret, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSecretRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecretRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecretRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.UpdateSecretRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.UpdateSecretRequest"; + }; + + return UpdateSecretRequest; + })(); + + v1beta1.AccessSecretVersionRequest = (function() { + + /** + * Properties of an AccessSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IAccessSecretVersionRequest + * @property {string|null} [name] AccessSecretVersionRequest name + */ + + /** + * Constructs a new AccessSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents an AccessSecretVersionRequest. + * @implements IAccessSecretVersionRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest=} [properties] Properties to set + */ + function AccessSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessSecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @instance + */ + AccessSecretVersionRequest.prototype.name = ""; + + /** + * Creates a new AccessSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest instance + */ + AccessSecretVersionRequest.create = function create(properties) { + return new AccessSecretVersionRequest(properties); + }; + + /** + * Encodes the specified AccessSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} message AccessSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionRequest.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 AccessSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionRequest} message AccessSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionRequest.decode = function 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.secrets.v1beta1.AccessSecretVersionRequest(); + 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 an AccessSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSecretVersionRequest.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 an AccessSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} AccessSecretVersionRequest + */ + AccessSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.AccessSecretVersionRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.AccessSecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AccessSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.AccessSecretVersionRequest} message AccessSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSecretVersionRequest.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 AccessSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + AccessSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.AccessSecretVersionRequest"; + }; + + return AccessSecretVersionRequest; + })(); + + v1beta1.AccessSecretVersionResponse = (function() { + + /** + * Properties of an AccessSecretVersionResponse. + * @memberof google.cloud.secrets.v1beta1 + * @interface IAccessSecretVersionResponse + * @property {string|null} [name] AccessSecretVersionResponse name + * @property {google.cloud.secrets.v1beta1.ISecretPayload|null} [payload] AccessSecretVersionResponse payload + */ + + /** + * Constructs a new AccessSecretVersionResponse. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents an AccessSecretVersionResponse. + * @implements IAccessSecretVersionResponse + * @constructor + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse=} [properties] Properties to set + */ + function AccessSecretVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessSecretVersionResponse name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @instance + */ + AccessSecretVersionResponse.prototype.name = ""; + + /** + * AccessSecretVersionResponse payload. + * @member {google.cloud.secrets.v1beta1.ISecretPayload|null|undefined} payload + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @instance + */ + AccessSecretVersionResponse.prototype.payload = null; + + /** + * Creates a new AccessSecretVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse instance + */ + AccessSecretVersionResponse.create = function create(properties) { + return new AccessSecretVersionResponse(properties); + }; + + /** + * Encodes the specified AccessSecretVersionResponse message. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse} message AccessSecretVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionResponse.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.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.cloud.secrets.v1beta1.SecretPayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessSecretVersionResponse message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.AccessSecretVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {google.cloud.secrets.v1beta1.IAccessSecretVersionResponse} message AccessSecretVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSecretVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSecretVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionResponse.decode = function 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.secrets.v1beta1.AccessSecretVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessSecretVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSecretVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSecretVersionResponse message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSecretVersionResponse.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.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.secrets.v1beta1.SecretPayload.verify(message.payload); + if (error) + return "payload." + error; + } + return null; + }; + + /** + * Creates an AccessSecretVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} AccessSecretVersionResponse + */ + AccessSecretVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.AccessSecretVersionResponse) + return object; + var message = new $root.google.cloud.secrets.v1beta1.AccessSecretVersionResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.secrets.v1beta1.AccessSecretVersionResponse.payload: object expected"); + message.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.fromObject(object.payload); + } + return message; + }; + + /** + * Creates a plain object from an AccessSecretVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {google.cloud.secrets.v1beta1.AccessSecretVersionResponse} message AccessSecretVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSecretVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.payload = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.secrets.v1beta1.SecretPayload.toObject(message.payload, options); + return object; + }; + + /** + * Converts this AccessSecretVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @instance + * @returns {Object.} JSON object + */ + AccessSecretVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessSecretVersionResponse + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.AccessSecretVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSecretVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.AccessSecretVersionResponse"; + }; + + return AccessSecretVersionResponse; + })(); + + v1beta1.DeleteSecretRequest = (function() { + + /** + * Properties of a DeleteSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IDeleteSecretRequest + * @property {string|null} [name] DeleteSecretRequest name + */ + + /** + * Constructs a new DeleteSecretRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a DeleteSecretRequest. + * @implements IDeleteSecretRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest=} [properties] Properties to set + */ + function DeleteSecretRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSecretRequest name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @instance + */ + DeleteSecretRequest.prototype.name = ""; + + /** + * Creates a new DeleteSecretRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest instance + */ + DeleteSecretRequest.create = function create(properties) { + return new DeleteSecretRequest(properties); + }; + + /** + * Encodes the specified DeleteSecretRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.DeleteSecretRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} message DeleteSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecretRequest.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 DeleteSecretRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.DeleteSecretRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDeleteSecretRequest} message DeleteSecretRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecretRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSecretRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecretRequest.decode = function 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.secrets.v1beta1.DeleteSecretRequest(); + 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 DeleteSecretRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecretRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecretRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecretRequest.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 DeleteSecretRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.DeleteSecretRequest} DeleteSecretRequest + */ + DeleteSecretRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.DeleteSecretRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.DeleteSecretRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSecretRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {google.cloud.secrets.v1beta1.DeleteSecretRequest} message DeleteSecretRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSecretRequest.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 DeleteSecretRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSecretRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSecretRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.DeleteSecretRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSecretRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.DeleteSecretRequest"; + }; + + return DeleteSecretRequest; + })(); + + v1beta1.DisableSecretVersionRequest = (function() { + + /** + * Properties of a DisableSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IDisableSecretVersionRequest + * @property {string|null} [name] DisableSecretVersionRequest name + */ + + /** + * Constructs a new DisableSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a DisableSecretVersionRequest. + * @implements IDisableSecretVersionRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest=} [properties] Properties to set + */ + function DisableSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableSecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @instance + */ + DisableSecretVersionRequest.prototype.name = ""; + + /** + * Creates a new DisableSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest instance + */ + DisableSecretVersionRequest.create = function create(properties) { + return new DisableSecretVersionRequest(properties); + }; + + /** + * Encodes the specified DisableSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.DisableSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} message DisableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableSecretVersionRequest.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 DisableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.DisableSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDisableSecretVersionRequest} message DisableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableSecretVersionRequest.decode = function 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.secrets.v1beta1.DisableSecretVersionRequest(); + 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 DisableSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableSecretVersionRequest.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 DisableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} DisableSecretVersionRequest + */ + DisableSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.DisableSecretVersionRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.DisableSecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DisableSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.DisableSecretVersionRequest} message DisableSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableSecretVersionRequest.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 DisableSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DisableSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.DisableSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.DisableSecretVersionRequest"; + }; + + return DisableSecretVersionRequest; + })(); + + v1beta1.EnableSecretVersionRequest = (function() { + + /** + * Properties of an EnableSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IEnableSecretVersionRequest + * @property {string|null} [name] EnableSecretVersionRequest name + */ + + /** + * Constructs a new EnableSecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents an EnableSecretVersionRequest. + * @implements IEnableSecretVersionRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest=} [properties] Properties to set + */ + function EnableSecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableSecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @instance + */ + EnableSecretVersionRequest.prototype.name = ""; + + /** + * Creates a new EnableSecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest instance + */ + EnableSecretVersionRequest.create = function create(properties) { + return new EnableSecretVersionRequest(properties); + }; + + /** + * Encodes the specified EnableSecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.EnableSecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} message EnableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableSecretVersionRequest.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 EnableSecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.EnableSecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IEnableSecretVersionRequest} message EnableSecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableSecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableSecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableSecretVersionRequest.decode = function 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.secrets.v1beta1.EnableSecretVersionRequest(); + 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 an EnableSecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableSecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableSecretVersionRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableSecretVersionRequest.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 an EnableSecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} EnableSecretVersionRequest + */ + EnableSecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.EnableSecretVersionRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.EnableSecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an EnableSecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.EnableSecretVersionRequest} message EnableSecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableSecretVersionRequest.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 EnableSecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + EnableSecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableSecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.EnableSecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableSecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.EnableSecretVersionRequest"; + }; + + return EnableSecretVersionRequest; + })(); + + v1beta1.DestroySecretVersionRequest = (function() { + + /** + * Properties of a DestroySecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @interface IDestroySecretVersionRequest + * @property {string|null} [name] DestroySecretVersionRequest name + */ + + /** + * Constructs a new DestroySecretVersionRequest. + * @memberof google.cloud.secrets.v1beta1 + * @classdesc Represents a DestroySecretVersionRequest. + * @implements IDestroySecretVersionRequest + * @constructor + * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest=} [properties] Properties to set + */ + function DestroySecretVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DestroySecretVersionRequest name. + * @member {string} name + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @instance + */ + DestroySecretVersionRequest.prototype.name = ""; + + /** + * Creates a new DestroySecretVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest=} [properties] Properties to set + * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest instance + */ + DestroySecretVersionRequest.create = function create(properties) { + return new DestroySecretVersionRequest(properties); + }; + + /** + * Encodes the specified DestroySecretVersionRequest message. Does not implicitly {@link google.cloud.secrets.v1beta1.DestroySecretVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} message DestroySecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroySecretVersionRequest.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 DestroySecretVersionRequest message, length delimited. Does not implicitly {@link google.cloud.secrets.v1beta1.DestroySecretVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.IDestroySecretVersionRequest} message DestroySecretVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroySecretVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestroySecretVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroySecretVersionRequest.decode = function 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.secrets.v1beta1.DestroySecretVersionRequest(); + 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 DestroySecretVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroySecretVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestroySecretVersionRequest message. + * @function verify + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestroySecretVersionRequest.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 DestroySecretVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} DestroySecretVersionRequest + */ + DestroySecretVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.secrets.v1beta1.DestroySecretVersionRequest) + return object; + var message = new $root.google.cloud.secrets.v1beta1.DestroySecretVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DestroySecretVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {google.cloud.secrets.v1beta1.DestroySecretVersionRequest} message DestroySecretVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestroySecretVersionRequest.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 DestroySecretVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DestroySecretVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestroySecretVersionRequest + * @function getTypeUrl + * @memberof google.cloud.secrets.v1beta1.DestroySecretVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestroySecretVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.secrets.v1beta1.DestroySecretVersionRequest"; + }; + + return DestroySecretVersionRequest; + })(); + + return v1beta1; + })(); + + return secrets; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 */ @@ -16352,6 +24560,7 @@ * @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 */ /** @@ -16444,6 +24653,14 @@ */ Publishing.prototype.librarySettings = $util.emptyArray; + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + /** * Creates a new Publishing instance using the specified properties. * @function create @@ -16489,6 +24706,8 @@ 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); return writer; }; @@ -16565,6 +24784,10 @@ message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); break; } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -16640,6 +24863,9 @@ case 2: case 3: case 4: + case 5: + case 6: + case 7: break; } if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { @@ -16651,6 +24877,9 @@ return "librarySettings." + error; } } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; return null; }; @@ -16720,6 +24949,18 @@ 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)) @@ -16731,6 +24972,8 @@ message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); } } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); return message; }; @@ -16759,6 +25002,7 @@ object.githubLabel = ""; object.docTagPrefix = ""; object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; } if (message.methodSettings && message.methodSettings.length) { object.methodSettings = []; @@ -16787,6 +25031,8 @@ 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; return object; }; @@ -17949,6 +26195,11 @@ * @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 */ /** @@ -17960,6 +26211,11 @@ * @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) @@ -17974,6 +26230,46 @@ */ 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 @@ -18000,6 +26296,21 @@ 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; }; @@ -18030,7 +26341,7 @@ 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(); + 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) { @@ -18038,6 +26349,70 @@ 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; @@ -18078,6 +26453,43 @@ 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; }; @@ -18098,6 +26510,41 @@ 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; }; @@ -18114,10 +26561,45 @@ 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; }; @@ -18574,6 +27056,7 @@ * @interface IMethodSettings * @property {string|null} [selector] MethodSettings selector * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields */ /** @@ -18585,6 +27068,7 @@ * @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) @@ -18607,6 +27091,14 @@ */ 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 @@ -18635,6 +27127,9 @@ 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; }; @@ -18677,6 +27172,12 @@ 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; @@ -18720,6 +27221,13 @@ 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; }; @@ -18742,6 +27250,13 @@ 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; }; @@ -18758,6 +27273,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; if (options.defaults) { object.selector = ""; object.longRunning = null; @@ -18766,6 +27283,11 @@ 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; }; @@ -19095,6 +27617,9 @@ * @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); @@ -19103,6 +27628,9 @@ 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; })(); @@ -19384,6 +27912,38 @@ 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() { /** @@ -19402,7 +27962,7 @@ * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {string|null} [edition] FileDescriptorProto edition + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition */ /** @@ -19525,11 +28085,11 @@ /** * FileDescriptorProto edition. - * @member {string} edition + * @member {google.protobuf.Edition} edition * @memberof google.protobuf.FileDescriptorProto * @instance */ - FileDescriptorProto.prototype.edition = ""; + FileDescriptorProto.prototype.edition = 0; /** * Creates a new FileDescriptorProto instance using the specified properties. @@ -19587,7 +28147,7 @@ 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 13, wireType 2 =*/106).string(message.edition); + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); return writer; }; @@ -19694,8 +28254,8 @@ message.syntax = reader.string(); break; } - case 13: { - message.edition = reader.string(); + case 14: { + message.edition = reader.int32(); break; } default: @@ -19810,8 +28370,22 @@ if (!$util.isString(message.syntax)) return "syntax: string expected"; if (message.edition != null && message.hasOwnProperty("edition")) - if (!$util.isString(message.edition)) - return "edition: string expected"; + 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; }; @@ -19904,8 +28478,58 @@ } if (object.syntax != null) message.syntax = String(object.syntax); - if (object.edition != null) - message.edition = String(object.edition); + 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; }; @@ -19937,7 +28561,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; - object.edition = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -19985,7 +28609,7 @@ if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = message.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; }; @@ -21088,6 +29712,9 @@ * @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 */ /** @@ -21100,6 +29727,7 @@ */ 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) @@ -21114,6 +29742,30 @@ */ 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 @@ -21138,6 +29790,13 @@ 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(); @@ -21181,6 +29840,20 @@ 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; @@ -21225,6 +29898,28 @@ 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; }; @@ -21250,6 +29945,37 @@ 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; }; @@ -21266,8 +29992,23 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + 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) @@ -21295,12 +30036,322 @@ * @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.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; })(); @@ -21597,8 +30648,8 @@ default: return "label: enum value expected"; case 1: - case 2: case 3: + case 2: break; } if (message.type != null && message.hasOwnProperty("type")) @@ -21678,14 +30729,14 @@ case 1: message.label = 1; break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; case "LABEL_REPEATED": case 3: message.label = 3; break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; } switch (object.type) { default: @@ -21915,14 +30966,14 @@ * @name google.protobuf.FieldDescriptorProto.Label * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED 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[2] = "LABEL_REQUIRED"] = 2; values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; return values; })(); @@ -21945,9 +30996,247 @@ * @classdesc Represents an OneofDescriptorProto. * @implements IOneofDescriptorProto * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @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 OneofDescriptorProto(properties) { + 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) @@ -21955,80 +31244,113 @@ } /** - * OneofDescriptorProto name. + * EnumDescriptorProto name. * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - OneofDescriptorProto.prototype.name = ""; + EnumDescriptorProto.prototype.name = ""; /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - OneofDescriptorProto.prototype.options = null; + EnumDescriptorProto.prototype.value = $util.emptyArray; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * 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.OneofDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); }; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, 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.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $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 OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofDescriptorProto + * @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.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decode = function decode(reader, length) { + 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.OneofDescriptorProto(); + 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) { @@ -22037,7 +31359,25 @@ break; } case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + 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: @@ -22049,143 +31389,437 @@ }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumDescriptorProto.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 + * 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 */ - 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; + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - 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); + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - return message; + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; }; - /** - * 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; - }; + 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); + }; - /** - * 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 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"; + }; - /** - * 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 EnumReservedRange; + })(); - return OneofDescriptorProto; + return EnumDescriptorProto; })(); - protobuf.EnumDescriptorProto = (function() { + protobuf.EnumValueDescriptorProto = (function() { /** - * Properties of an EnumDescriptorProto. + * Properties of an EnumValueDescriptorProto. * @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 + * @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 EnumDescriptorProto. + * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; + function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22193,113 +31827,90 @@ } /** - * EnumDescriptorProto name. + * EnumValueDescriptorProto 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 + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - EnumDescriptorProto.prototype.options = null; + EnumValueDescriptorProto.prototype.name = ""; /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + EnumValueDescriptorProto.prototype.number = 0; /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + EnumValueDescriptorProto.prototype.options = null; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new EnumValueDescriptorProto instance using the specified properties. * @function create - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); }; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encode = function encode(message, 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.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.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.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]); + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto + * @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.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decode = function decode(reader, length) { + 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.EnumDescriptorProto(); + 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) { @@ -22308,25 +31919,11 @@ break; } case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + message.number = reader.int32(); 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()); + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; } default: @@ -22338,437 +31935,426 @@ }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumDescriptorProto message. + * Verifies an EnumValueDescriptorProto message. * @function verify - * @memberof google.protobuf.EnumDescriptorProto + * @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 */ - 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"; + 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); + var message = new $root.google.protobuf.EnumValueDescriptorProto(); 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.number != null) + message.number = object.number | 0; 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]); + 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 EnumDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options) { + EnumValueDescriptorProto.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.number = 0; 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.number != null && message.hasOwnProperty("number")) + object.number = message.number; 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]; - } + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); return object; }; /** - * Converts this EnumDescriptorProto to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumDescriptorProto + * Gets the default type url for EnumValueDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; }; - EnumDescriptorProto.EnumReservedRange = (function() { + return EnumValueDescriptorProto; + })(); - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ + protobuf.ServiceDescriptorProto = (function() { - /** - * 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]]; - } + /** + * 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 + */ - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; + /** + * 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]]; + } - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; - /** - * 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); - }; + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; - /** - * 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; - }; + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; - /** - * 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(); - }; + /** + * 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; + }; - /** - * 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); + /** + * 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 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; - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; + /** + * 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.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")) { + 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return EnumReservedRange; - })(); + /** + * 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 EnumDescriptorProto; + return ServiceDescriptorProto; })(); - protobuf.EnumValueDescriptorProto = (function() { + protobuf.MethodDescriptorProto = (function() { /** - * Properties of an EnumValueDescriptorProto. + * Properties of a MethodDescriptorProto. * @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 + * @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 EnumValueDescriptorProto. + * Constructs a new MethodDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ - function EnumValueDescriptorProto(properties) { + function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22776,90 +32362,120 @@ } /** - * EnumValueDescriptorProto name. + * MethodDescriptorProto name. * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - EnumValueDescriptorProto.prototype.name = ""; + MethodDescriptorProto.prototype.name = ""; /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - EnumValueDescriptorProto.prototype.number = 0; + MethodDescriptorProto.prototype.inputType = ""; /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - EnumValueDescriptorProto.prototype.options = null; + MethodDescriptorProto.prototype.outputType = ""; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * 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.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); }; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encode = function encode(message, 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.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + 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.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $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 EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto + * @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.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decode = function decode(reader, length) { + 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.EnumValueDescriptorProto(); + 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) { @@ -22868,11 +32484,23 @@ break; } case 2: { - message.number = reader.int32(); + message.inputType = reader.string(); break; } case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + 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: @@ -22884,147 +32512,191 @@ }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueDescriptorProto message. + * Verifies a MethodDescriptorProto message. * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.verify = function verify(message) { + 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.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer 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.EnumValueOptions.verify(message.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 an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); + var message = new $root.google.protobuf.MethodDescriptorProto(); if (object.name != null) message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; + 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.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + 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 an EnumValueDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { + MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.number = 0; + 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.number != null && message.hasOwnProperty("number")) - object.number = message.number; + 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.EnumValueOptions.toObject(message.options, 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 EnumValueDescriptorProto to JSON. + * Converts this MethodDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueDescriptorProto + * Gets the default type url for MethodDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; }; - return EnumValueDescriptorProto; + return MethodDescriptorProto; })(); - protobuf.ServiceDescriptorProto = (function() { + protobuf.FileOptions = (function() { /** - * Properties of a ServiceDescriptorProto. + * Properties of a FileOptions. * @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 + * @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 ServiceDescriptorProto. + * Constructs a new FileOptions. * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto + * @classdesc Represents a FileOptions. + * @implements IFileOptions * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ - function ServiceDescriptorProto(properties) { - this.method = []; + 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) @@ -23032,106 +32704,375 @@ } /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions * @instance */ - ServiceDescriptorProto.prototype.name = ""; + FileOptions.prototype.javaPackage = ""; /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions * @instance */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + FileOptions.prototype.javaOuterClassname = ""; /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions * @instance */ - ServiceDescriptorProto.prototype.options = null; + 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 ServiceDescriptorProto instance using the specified properties. + * Creates a new FileOptions instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); + FileOptions.create = function create(properties) { + return new FileOptions(properties); }; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer) { + FileOptions.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(); + 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 ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * Decodes a FileOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceDescriptorProto + * @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.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decode = function decode(reader, length) { + 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.ServiceDescriptorProto(); + 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.name = reader.string(); + message.javaPackage = reader.string(); break; } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + case 8: { + message.javaOuterClassname = reader.string(); break; } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + 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: @@ -23139,171 +33080,384 @@ 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]); + 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 "method." + error; + return "uninterpretedOption." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @returns {google.protobuf.FileOptions} FileOptions */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) 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]); + 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.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + 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 ServiceDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options) { + FileOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.method = []; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { - object.name = ""; - object.options = null; + 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.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.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); } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; /** - * Converts this ServiceDescriptorProto to JSON. + * Converts this FileOptions to JSON. * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { + FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceDescriptorProto + * Gets the default type url for FileOptions * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.FileOptions"; }; - return ServiceDescriptorProto; + /** + * 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.MethodDescriptorProto = (function() { + protobuf.MessageOptions = (function() { /** - * Properties of a MethodDescriptorProto. + * Properties of a MessageOptions. * @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 + * @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 MethodDescriptorProto. + * Constructs a new MessageOptions. * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ - function MethodDescriptorProto(properties) { + function MessageOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23311,145 +33465,176 @@ } /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions * @instance */ - MethodDescriptorProto.prototype.name = ""; + MessageOptions.prototype.messageSetWireFormat = false; /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions * @instance */ - MethodDescriptorProto.prototype.inputType = ""; + MessageOptions.prototype.noStandardDescriptorAccessor = false; /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions * @instance */ - MethodDescriptorProto.prototype.outputType = ""; + MessageOptions.prototype.deprecated = false; /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions * @instance */ - MethodDescriptorProto.prototype.options = null; + MessageOptions.prototype.mapEntry = false; /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions * @instance */ - MethodDescriptorProto.prototype.clientStreaming = false; + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions * @instance */ - MethodDescriptorProto.prototype.serverStreaming = false; + MessageOptions.prototype.features = null; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * 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.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); }; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encode = function encode(message, writer) { + MessageOptions.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); + 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 MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * Decodes a MessageOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodDescriptorProto + * @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.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decode = function decode(reader, length) { + 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.MethodDescriptorProto(); + 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.name = reader.string(); + message.messageSetWireFormat = reader.bool(); break; } case 2: { - message.inputType = reader.string(); + message.noStandardDescriptorAccessor = reader.bool(); break; } case 3: { - message.outputType = reader.string(); + message.deprecated = reader.bool(); break; } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + case 7: { + message.mapEntry = reader.bool(); break; } - case 5: { - message.clientStreaming = reader.bool(); + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); break; } - case 6: { - message.serverStreaming = reader.bool(); + 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: @@ -23461,555 +33646,501 @@ }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodDescriptorProto message. + * Verifies a MessageOptions message. * @function verify - * @memberof google.protobuf.MethodDescriptorProto + * @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 */ - MethodDescriptorProto.verify = function verify(message) { + MessageOptions.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 (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 "options." + 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; } - 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. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @returns {google.protobuf.MessageOptions} MessageOptions */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) 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); + 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"]); } - 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. + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodDescriptorProto.toObject = function toObject(message, options) { + MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; + 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.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; + 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 MethodDescriptorProto to JSON. + * Converts this MessageOptions to JSON. * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodDescriptorProto + * Gets the default type url for MessageOptions * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.MessageOptions"; }; - return MethodDescriptorProto; + return MessageOptions; })(); - 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} [phpGenericServices] FileOptions phpGenericServices - * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ + protobuf.FieldOptions = (function() { /** - * Constructs a new FileOptions. + * Properties of a FieldOptions. * @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 + * @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 */ - FileOptions.prototype.optimizeFor = 1; /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ - FileOptions.prototype.goPackage = ""; + 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]]; + } /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.ccGenericServices = false; + FieldOptions.prototype.ctype = 0; /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.javaGenericServices = false; + FieldOptions.prototype.packed = false; /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.pyGenericServices = false; + FieldOptions.prototype.jstype = 0; /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.phpGenericServices = false; + FieldOptions.prototype.lazy = false; /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.deprecated = false; + FieldOptions.prototype.unverifiedLazy = false; /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.ccEnableArenas = true; + FieldOptions.prototype.deprecated = false; /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.objcClassPrefix = ""; + FieldOptions.prototype.weak = false; /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.csharpNamespace = ""; + FieldOptions.prototype.debugRedact = false; /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.swiftPrefix = ""; + FieldOptions.prototype.retention = 0; /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.phpClassPrefix = ""; + FieldOptions.prototype.targets = $util.emptyArray; /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.phpNamespace = ""; + FieldOptions.prototype.editionDefaults = $util.emptyArray; /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.phpMetadataNamespace = ""; + FieldOptions.prototype.features = null; /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.rubyPackage = ""; + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions * @instance */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new FieldOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); }; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encode = function encode(message, writer) { + FieldOptions.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.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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - 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); + 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.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(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes a FieldOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileOptions + * @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.FileOptions} FileOptions + * @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 - */ - 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(); + * @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 16: { - message.ccGenericServices = reader.bool(); + case 2: { + message.packed = reader.bool(); break; } - case 17: { - message.javaGenericServices = reader.bool(); + case 6: { + message.jstype = reader.int32(); break; } - case 18: { - message.pyGenericServices = reader.bool(); + case 5: { + message.lazy = reader.bool(); break; } - case 42: { - message.phpGenericServices = reader.bool(); + case 15: { + message.unverifiedLazy = reader.bool(); break; } - case 23: { + case 3: { 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(); + case 10: { + message.weak = reader.bool(); break; } - case 39: { - message.swiftPrefix = reader.string(); + case 16: { + message.debugRedact = reader.bool(); break; } - case 40: { - message.phpClassPrefix = reader.string(); + case 17: { + message.retention = reader.int32(); break; } - case 41: { - message.phpNamespace = reader.string(); + 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 44: { - message.phpMetadataNamespace = reader.string(); + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); break; } - case 45: { - message.rubyPackage = reader.string(); + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } case 999: { @@ -24018,10 +34149,19 @@ 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())); + 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: @@ -24033,98 +34173,111 @@ }; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions + * @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 */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { + FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileOptions message. + * Verifies a FieldOptions message. * @function verify - * @memberof google.protobuf.FileOptions + * @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 */ - FileOptions.verify = function verify(message) { + FieldOptions.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) { + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { default: - return "optimizeFor: enum value expected"; + return "ctype: enum value expected"; + case 0: 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; + 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.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.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"; @@ -24134,272 +34287,746 @@ 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; - } + 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.FieldOptions} FieldOptions */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) 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) { + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; + if (typeof object.ctype === "number") { + message.ctype = object.ctype; break; } break; - case "SPEED": + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": case 1: - message.optimizeFor = 1; + message.ctype = 1; break; - case "CODE_SIZE": + case "STRING_PIECE": case 2: - message.optimizeFor = 2; + message.ctype = 2; break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; + } + 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.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.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.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.FileOptions.uninterpretedOption: array expected"); + 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.FileOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.FieldOptions.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]); - } + 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 FileOptions message. Also converts values to other types if specified. + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.FileOptions} message FileOptions + * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options) { + 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.resourceDefinition"] = []; + object[".google.api.fieldBehavior"] = []; } 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.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; + 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.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.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.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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; + 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.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); + 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 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - /** - * 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; + /** + * 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 FileOptions; + return FieldOptions; })(); - protobuf.MessageOptions = (function() { + protobuf.OneofOptions = (function() { /** - * Properties of a MessageOptions. + * Properties of an OneofOptions. * @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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** - * Constructs a new MessageOptions. + * Constructs a new OneofOptions. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ - function MessageOptions(properties) { + function OneofOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -24408,152 +35035,86 @@ } /** - * 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 + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions * @instance */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + OneofOptions.prototype.features = null; /** - * MessageOptions uninterpretedOption. + * OneofOptions 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 + * @memberof google.protobuf.OneofOptions * @instance */ - MessageOptions.prototype[".google.api.resource"] = null; + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @function create - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); }; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer) { + OneofOptions.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 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(); - 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. + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * Decodes an OneofOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MessageOptions + * @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.MessageOptions} MessageOptions + * @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 */ - MessageOptions.decode = function decode(reader, length) { + 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.MessageOptions(); + 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.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(); + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } case 999: { @@ -24562,10 +35123,6 @@ 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; @@ -24575,47 +35132,37 @@ }; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions + * @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 */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { + OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageOptions message. + * Verifies an OneofOptions message. * @function verify - * @memberof google.protobuf.MessageOptions + * @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 */ - MessageOptions.verify = function verify(message) { + OneofOptions.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"; @@ -24623,160 +35170,120 @@ 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. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.OneofOptions} OneofOptions */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) 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); + 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.MessageOptions.uninterpretedOption: array expected"); + 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.MessageOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.OneofOptions.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. + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options) { + OneofOptions.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[".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 (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); } - 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. + * Converts this OneofOptions to JSON. * @function toJSON - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ - MessageOptions.prototype.toJSON = function toJSON() { + OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageOptions + * Gets the default type url for OneofOptions * @function getTypeUrl - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.OneofOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; + return typeUrlPrefix + "/google.protobuf.OneofOptions"; }; - return MessageOptions; + return OneofOptions; })(); - protobuf.FieldOptions = (function() { + protobuf.EnumOptions = (function() { /** - * Properties of a FieldOptions. + * Properties of an EnumOptions. * @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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target - * @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 + * @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 FieldOptions. + * Constructs a new EnumOptions. * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ - function FieldOptions(properties) { + function EnumOptions(properties) { 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) @@ -24784,236 +35291,128 @@ } /** - * 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 + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions * @instance */ - FieldOptions.prototype.unverifiedLazy = false; + EnumOptions.prototype.allowAlias = false; /** - * FieldOptions deprecated. + * EnumOptions 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 + * @memberof google.protobuf.EnumOptions * @instance */ - FieldOptions.prototype.debugRedact = false; + EnumOptions.prototype.deprecated = false; /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions * @instance */ - FieldOptions.prototype.retention = 0; + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; /** - * FieldOptions target. - * @member {google.protobuf.FieldOptions.OptionTargetType} target - * @memberof google.protobuf.FieldOptions + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions * @instance */ - FieldOptions.prototype.target = 0; + EnumOptions.prototype.features = null; /** - * FieldOptions uninterpretedOption. + * EnumOptions 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 + * @memberof google.protobuf.EnumOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); }; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { + EnumOptions.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.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.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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - 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. + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes an EnumOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions + * @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.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decode = function decode(reader, length) { + 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.FieldOptions(); + 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 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(); + message.allowAlias = 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(); + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); break; } - case 18: { - message.target = reader.int32(); + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } case 999: { @@ -25022,21 +35421,6 @@ 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; @@ -25046,513 +35430,181 @@ }; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { + EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldOptions message. + * Verifies an EnumOptions 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.target != null && message.hasOwnProperty("target")) - switch (message.target) { - default: - return "target: 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.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: - 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; + * @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; } - switch (object.target) { - default: - if (typeof object.target === "number") { - message.target = object.target; - break; + 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; } - break; - case "TARGET_TYPE_UNKNOWN": - case 0: - message.target = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.target = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.target = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.target = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.target = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.target = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.target = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.target = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.target = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.target = 9; - break; + } + 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.FieldOptions.uninterpretedOption: array expected"); + 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.FieldOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.EnumOptions.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; - } - } - 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. + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOptions.toObject = function toObject(message, options) { + EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { + if (options.arrays || options.defaults) object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; + object.allowAlias = 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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; - object[".google.api.resourceReference"] = null; + object.deprecatedLegacyJsonFieldConflicts = false; + 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.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; 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.target != null && message.hasOwnProperty("target")) - object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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.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. + * Converts this EnumOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ - FieldOptions.prototype.toJSON = function toJSON() { + EnumOptions.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 + * 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 */ - 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; - })(); + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; - return FieldOptions; + return EnumOptions; })(); - protobuf.OneofOptions = (function() { + protobuf.EnumValueOptions = (function() { /** - * Properties of an OneofOptions. + * Properties of an EnumValueOptions. * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + * @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 OneofOptions. + * Constructs a new EnumValueOptions. * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ - function OneofOptions(properties) { + function EnumValueOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -25561,37 +35613,67 @@ } /** - * OneofOptions uninterpretedOption. + * 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.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @instance */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new OneofOptions instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @function create - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); }; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, 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(); @@ -25599,36 +35681,48 @@ }; /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofOptions + * @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.OneofOptions} OneofOptions + * @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 */ - OneofOptions.decode = function decode(reader, length) { + 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.OneofOptions(); + 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 = []; @@ -25644,32 +35738,43 @@ }; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions + * @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 */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofOptions message. + * Verifies an EnumValueOptions message. * @function verify - * @memberof google.protobuf.OneofOptions + * @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 */ - OneofOptions.verify = function verify(message) { + 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"; @@ -25683,24 +35788,33 @@ }; /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) return object; - var message = new $root.google.protobuf.OneofOptions(); + 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.OneofOptions.uninterpretedOption: array expected"); + 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.OneofOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } @@ -25708,20 +35822,31 @@ }; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + 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) @@ -25731,55 +35856,56 @@ }; /** - * Converts this OneofOptions to JSON. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - OneofOptions.prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OneofOptions + * Gets the default type url for EnumValueOptions * @function getTypeUrl - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; }; - return OneofOptions; + return EnumValueOptions; })(); - protobuf.EnumOptions = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of an EnumOptions. + * Properties of a ServiceOptions. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @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 */ /** - * Constructs a new EnumOptions. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function EnumOptions(properties) { + function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -25788,122 +35914,136 @@ } /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumOptions.prototype.allowAlias = false; + ServiceOptions.prototype.features = null; /** - * EnumOptions deprecated. + * ServiceOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumOptions.prototype.deprecated = false; + ServiceOptions.prototype.deprecated = false; /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions + * 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 */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + ServiceOptions.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); + 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"]); return writer; }; /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumOptions + * @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.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decode = function decode(reader, length) { + 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.EnumOptions(); + 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 2: { - message.allowAlias = reader.bool(); + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } - case 3: { + case 33: { message.deprecated = reader.bool(); break; } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = 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; + } default: reader.skipType(tag & 7); break; @@ -25913,41 +36053,40 @@ }; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumOptions message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.protobuf.EnumOptions + * @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 */ - EnumOptions.verify = function verify(message) { + ServiceOptions.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.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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -25957,123 +36096,142 @@ 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"; return null; }; /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); + 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.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + 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.EnumOptions.uninterpretedOption: object expected"); + 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"]); return message; }; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + ServiceOptions.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; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; } - 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); } + 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"]; return object; }; /** - * Converts this EnumOptions to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for ServiceOptions * @function getTypeUrl - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; - return EnumOptions; + return ServiceOptions; })(); - protobuf.EnumValueOptions = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of an EnumValueOptions. + * Properties of a MethodOptions. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @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 EnumValueOptions. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function EnumValueOptions(properties) { + 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) @@ -26081,94 +36239,153 @@ } /** - * EnumValueOptions deprecated. + * MethodOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @instance */ - EnumValueOptions.prototype.deprecated = false; + MethodOptions.prototype.deprecated = false; /** - * EnumValueOptions uninterpretedOption. + * 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.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new EnumValueOptions instance using the specified properties. + * 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.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + MethodOptions.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); + 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 EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @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.EnumValueOptions} EnumValueOptions + * @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 */ - EnumValueOptions.decode = function decode(reader, length) { + 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.EnumValueOptions(); + 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 1: { + 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; @@ -26178,35 +36395,49 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @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 */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @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 */ - EnumValueOptions.verify = function verify(message) { + 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"; @@ -26216,114 +36447,199 @@ 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 an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.MethodOptions} MethodOptions */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) return object; - var message = new $root.google.protobuf.EnumValueOptions(); + 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.EnumValueOptions.uninterpretedOption: array expected"); + 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.EnumValueOptions.uninterpretedOption: object expected"); + 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 an EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; - if (options.defaults) + 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 EnumValueOptions to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for MethodOptions * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.MethodOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + return typeUrlPrefix + "/google.protobuf.MethodOptions"; }; - return EnumValueOptions; + /** + * 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.ServiceOptions = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of a ServiceOptions. + * Properties of an UninterpretedOption. * @memberof google.protobuf - * @interface IServiceOptions - * @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 + * @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 ServiceOptions. + * Constructs a new UninterpretedOption. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; + function UninterpretedOption(properties) { + this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26331,120 +36647,162 @@ } /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - ServiceOptions.prototype.deprecated = false; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + UninterpretedOption.prototype.identifierValue = ""; /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions + * 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 */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + UninterpretedOption.prototype.aggregateValue = ""; /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + UninterpretedOption.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.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.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 ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @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.ServiceOptions} ServiceOptions + * @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 */ - ServiceOptions.decode = function decode(reader, length) { + 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.ServiceOptions(); + 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 33: { - message.deprecated = reader.bool(); + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.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())); + case 3: { + message.identifierValue = reader.string(); break; } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); + case 4: { + message.positiveIntValue = reader.uint64(); break; } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); + 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: @@ -26456,171 +36814,458 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @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 */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies an UninterpretedOption message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @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 */ - ServiceOptions.verify = function verify(message) { + UninterpretedOption.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.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 (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 "uninterpretedOption." + error; + return "name." + 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.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 a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) return object; - var message = new $root.google.protobuf.ServiceOptions(); - 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]); + 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[".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.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 a ServiceOptions message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.uninterpretedOption = []; + object.name = []; if (options.defaults) { - object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; + 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.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - 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.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[".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.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 ServiceOptions to JSON. + * Converts this UninterpretedOption to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + UninterpretedOption.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"; - }; + /** + * 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 ServiceOptions; + return UninterpretedOption; })(); - protobuf.MethodOptions = (function() { + protobuf.FeatureSet = (function() { /** - * Properties of a MethodOptions. + * Properties of a FeatureSet. * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @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 + * @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 MethodOptions. + * Constructs a new FeatureSet. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; + function FeatureSet(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26628,137 +37273,145 @@ } /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet * @instance */ - MethodOptions.prototype.deprecated = false; + FeatureSet.prototype.fieldPresence = 0; /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet * @instance */ - MethodOptions.prototype.idempotencyLevel = 0; + FeatureSet.prototype.enumType = 0; /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet * @instance */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + FeatureSet.prototype.repeatedFieldEncoding = 0; /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet * @instance */ - MethodOptions.prototype[".google.api.http"] = null; + FeatureSet.prototype.utf8Validation = 0; /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + FeatureSet.prototype.messageEncoding = 0; /** - * Creates a new MethodOptions instance using the specified properties. + * 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.MethodOptions + * @memberof google.protobuf.FeatureSet * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); }; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FeatureSet * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + FeatureSet.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.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(); + 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 MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FeatureSet * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes a FeatureSet message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @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.MethodOptions} MethodOptions + * @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 */ - MethodOptions.decode = function decode(reader, length) { + 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.MethodOptions(); + 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 33: { - message.deprecated = reader.bool(); + case 1: { + message.fieldPresence = reader.int32(); break; } - case 34: { - message.idempotencyLevel = reader.int32(); + case 2: { + message.enumType = reader.int32(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 3: { + message.repeatedFieldEncoding = reader.int32(); break; } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + case 4: { + message.utf8Validation = reader.int32(); break; } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); break; } default: @@ -26770,401 +37423,520 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FeatureSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @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 */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { + FeatureSet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies a FeatureSet message. * @function verify - * @memberof google.protobuf.MethodOptions + * @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 */ - MethodOptions.verify = function verify(message) { + FeatureSet.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) { + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { default: - return "idempotencyLevel: enum value expected"; + return "fieldPresence: enum value expected"; case 0: case 1: case 2: + case 3: break; } - 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.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; } - } - 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. + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FeatureSet * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.FeatureSet} FeatureSet */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; break; } break; - case "IDEMPOTENCY_UNKNOWN": + case "FIELD_PRESENCE_UNKNOWN": case 0: - message.idempotencyLevel = 0; + message.fieldPresence = 0; break; - case "NO_SIDE_EFFECTS": + case "EXPLICIT": case 1: - message.idempotencyLevel = 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 "IDEMPOTENT": + case "LEGACY_BEST_EFFORT": case 2: - message.idempotencyLevel = 2; + message.jsonFormat = 2; break; } - 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. + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FeatureSet * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.FeatureSet} message FeatureSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + FeatureSet.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[".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.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); + 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 MethodOptions to JSON. + * Converts this FeatureSet to JSON. * @function toJSON - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FeatureSet * @instance * @returns {Object.} JSON object */ - MethodOptions.prototype.toJSON = function toJSON() { + FeatureSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodOptions + * Gets the default type url for FeatureSet * @function getTypeUrl - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FeatureSet * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; + return typeUrlPrefix + "/google.protobuf.FeatureSet"; }; /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence * @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 + * @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 */ - MethodOptions.IdempotencyLevel = (function() { + FeatureSet.FieldPresence = (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; + 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; })(); - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { + /** + * 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; + })(); /** - * 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 + * 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; + })(); /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * 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 */ - 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]]; - } + 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; + })(); /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance + * 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 */ - UninterpretedOption.prototype.name = $util.emptyArray; + 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; + })(); /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * 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 */ - UninterpretedOption.prototype.identifierValue = ""; + 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() { /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * 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 */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + 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]]; + } /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults * @instance */ - UninterpretedOption.prototype.doubleValue = 0; + FeatureSetDefaults.prototype.defaults = $util.emptyArray; /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults * @instance */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + FeatureSetDefaults.prototype.minimumEdition = 0; /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults * @instance */ - UninterpretedOption.prototype.aggregateValue = ""; + FeatureSetDefaults.prototype.maximumEdition = 0; /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new FeatureSetDefaults instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); }; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + FeatureSetDefaults.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); + 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 UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes a FeatureSetDefaults message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @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.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decode = function decode(reader, length) { + 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.UninterpretedOption(); + 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 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(); + 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.positiveIntValue = reader.uint64(); + message.minimumEdition = reader.int32(); 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(); + message.maximumEdition = reader.int32(); break; } default: @@ -27176,224 +37948,283 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies a FeatureSetDefaults message. * @function verify - * @memberof google.protobuf.UninterpretedOption + * @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 */ - UninterpretedOption.verify = function verify(message) { + FeatureSetDefaults.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 (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 "name." + error; + return "defaults." + 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"; + 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 an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) 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]); + 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; } - 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. + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UninterpretedOption.toObject = function toObject(message, options) { + FeatureSetDefaults.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.name = []; + object.defaults = []; 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; + 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 UninterpretedOption to JSON. + * Converts this FeatureSetDefaults to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @instance * @returns {Object.} JSON object */ - UninterpretedOption.prototype.toJSON = function toJSON() { + FeatureSetDefaults.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UninterpretedOption + * Gets the default type url for FeatureSetDefaults * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.FeatureSetDefaults * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; }; - UninterpretedOption.NamePart = (function() { + FeatureSetDefaults.FeatureSetEditionDefault = (function() { /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension + * 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 NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set */ - function NamePart(properties) { + function FeatureSetEditionDefault(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27401,87 +38232,89 @@ } /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - NamePart.prototype.namePart = ""; + FeatureSetEditionDefault.prototype.edition = 0; /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - NamePart.prototype.isExtension = false; + FeatureSetEditionDefault.prototype.features = null; /** - * Creates a new NamePart instance using the specified properties. + * Creates a new FeatureSetEditionDefault instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance */ - NamePart.create = function create(properties) { - return new NamePart(properties); + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); }; /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @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 */ - NamePart.encode = function encode(message, writer) { + FeatureSetEditionDefault.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); + 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 NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @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 */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NamePart message from the specified reader or buffer. + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @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.UninterpretedOption.NamePart} NamePart + * @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 */ - NamePart.decode = function decode(reader, length) { + 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.UninterpretedOption.NamePart(); + 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 1: { - message.namePart = reader.string(); + case 3: { + message.edition = reader.int32(); break; } case 2: { - message.isExtension = reader.bool(); + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -27489,120 +38322,187 @@ 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. + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @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 */ - NamePart.decodeDelimited = function decodeDelimited(reader) { + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NamePart message. + * Verifies a FeatureSetEditionDefault message. * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart + * @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 */ - NamePart.verify = function verify(message) { + FeatureSetEditionDefault.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"; + 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 NamePart message from a plain object. Also converts values to their respective internal types. + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) 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); + 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 NamePart message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = function toObject(message, options) { + FeatureSetEditionDefault.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.namePart = ""; - object.isExtension = false; + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; + 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 NamePart to JSON. + * Converts this FeatureSetEditionDefault to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance * @returns {Object.} JSON object */ - NamePart.prototype.toJSON = function toJSON() { + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NamePart + * Gets the default type url for FeatureSetEditionDefault * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; }; - return NamePart; + return FeatureSetEditionDefault; })(); - return UninterpretedOption; + return FeatureSetDefaults; })(); protobuf.SourceCodeInfo = (function() { diff --git a/packages/google-cloud-secretmanager/protos/protos.json b/packages/google-cloud-secretmanager/protos/protos.json index a8bfd248fac..0f6c4b07d8d 100644 --- a/packages/google-cloud-secretmanager/protos/protos.json +++ b/packages/google-cloud-secretmanager/protos/protos.json @@ -955,6 +955,1064 @@ } } } + }, + "v1beta2": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.SecretManager.V1Beta2", + "go_package": "cloud.google.com/go/secretmanager/apiv1beta2/secretmanagerpb;secretmanagerpb", + "java_multiple_files": true, + "java_outer_classname": "ServiceProto", + "java_package": "com.google.cloud.secretmanager.v1beta2", + "objc_class_prefix": "GSM", + "php_namespace": "Google\\Cloud\\SecretManager\\V1beta2", + "ruby_package": "Google::Cloud::SecretManager::V1beta2" + }, + "nested": { + "Secret": { + "options": { + "(google.api.resource).type": "secretmanager.googleapis.com/Secret", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/secrets/{secret}", + "(google.api.resource).plural": "secrets", + "(google.api.resource).singular": "secret" + }, + "oneofs": { + "expiration": { + "oneof": [ + "expireTime", + "ttl" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "replication": { + "type": "Replication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "topics": { + "rule": "repeated", + "type": "Topic", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rotation": { + "type": "Rotation", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "versionAliases": { + "keyType": "string", + "type": "int64", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "versionDestroyTtl": { + "type": "google.protobuf.Duration", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customerManagedEncryption": { + "type": "CustomerManagedEncryption", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SecretVersion": { + "options": { + "(google.api.resource).type": "secretmanager.googleapis.com/SecretVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}", + "(google.api.resource).plural": "secretVersions", + "(google.api.resource).singular": "secretVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "destroyTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "replicationStatus": { + "type": "ReplicationStatus", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientSpecifiedPayloadChecksum": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scheduledDestroyTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "customerManagedEncryption": { + "type": "CustomerManagedEncryptionStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "DESTROYED": 3 + } + } + } + }, + "Replication": { + "oneofs": { + "replication": { + "oneof": [ + "automatic", + "userManaged" + ] + } + }, + "fields": { + "automatic": { + "type": "Automatic", + "id": 1 + }, + "userManaged": { + "type": "UserManaged", + "id": 2 + } + }, + "nested": { + "Automatic": { + "fields": { + "customerManagedEncryption": { + "type": "CustomerManagedEncryption", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UserManaged": { + "fields": { + "replicas": { + "rule": "repeated", + "type": "Replica", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Replica": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "customerManagedEncryption": { + "type": "CustomerManagedEncryption", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "CustomerManagedEncryption": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReplicationStatus": { + "oneofs": { + "replicationStatus": { + "oneof": [ + "automatic", + "userManaged" + ] + } + }, + "fields": { + "automatic": { + "type": "AutomaticStatus", + "id": 1 + }, + "userManaged": { + "type": "UserManagedStatus", + "id": 2 + } + }, + "nested": { + "AutomaticStatus": { + "fields": { + "customerManagedEncryption": { + "type": "CustomerManagedEncryptionStatus", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UserManagedStatus": { + "fields": { + "replicas": { + "rule": "repeated", + "type": "ReplicaStatus", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ReplicaStatus": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "customerManagedEncryption": { + "type": "CustomerManagedEncryptionStatus", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + }, + "CustomerManagedEncryptionStatus": { + "fields": { + "kmsKeyVersionName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Topic": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Topic", + "(google.api.resource).pattern": "projects/{project}/topics/{topic}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Rotation": { + "fields": { + "nextRotationTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rotationPeriod": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "SecretPayload": { + "oneofs": { + "_dataCrc32c": { + "oneof": [ + "dataCrc32c" + ] + } + }, + "fields": { + "data": { + "type": "bytes", + "id": 1 + }, + "dataCrc32c": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "SecretManagerService": { + "options": { + "(google.api.default_host)": "secretmanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListSecrets": { + "requestType": "ListSecretsRequest", + "responseType": "ListSecretsResponse", + "options": { + "(google.api.http).get": "/v1beta2/{parent=projects/*}/secrets", + "(google.api.http).additional_bindings.get": "/v1beta2/{parent=projects/*/locations/*}/secrets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{parent=projects/*}/secrets", + "additional_bindings": { + "get": "/v1beta2/{parent=projects/*/locations/*}/secrets" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateSecret": { + "requestType": "CreateSecretRequest", + "responseType": "Secret", + "options": { + "(google.api.http).post": "/v1beta2/{parent=projects/*}/secrets", + "(google.api.http).body": "secret", + "(google.api.http).additional_bindings.post": "/v1beta2/{parent=projects/*/locations/*}/secrets", + "(google.api.http).additional_bindings.body": "secret", + "(google.api.method_signature)": "parent,secret_id,secret" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{parent=projects/*}/secrets", + "body": "secret", + "additional_bindings": { + "post": "/v1beta2/{parent=projects/*/locations/*}/secrets", + "body": "secret" + } + } + }, + { + "(google.api.method_signature)": "parent,secret_id,secret" + } + ] + }, + "AddSecretVersion": { + "requestType": "AddSecretVersionRequest", + "responseType": "SecretVersion", + "options": { + "(google.api.http).post": "/v1beta2/{parent=projects/*/secrets/*}:addVersion", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta2/{parent=projects/*/locations/*/secrets/*}:addVersion", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,payload" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{parent=projects/*/secrets/*}:addVersion", + "body": "*", + "additional_bindings": { + "post": "/v1beta2/{parent=projects/*/locations/*/secrets/*}:addVersion", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,payload" + } + ] + }, + "GetSecret": { + "requestType": "GetSecretRequest", + "responseType": "Secret", + "options": { + "(google.api.http).get": "/v1beta2/{name=projects/*/secrets/*}", + "(google.api.http).additional_bindings.get": "/v1beta2/{name=projects/*/locations/*/secrets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{name=projects/*/secrets/*}", + "additional_bindings": { + "get": "/v1beta2/{name=projects/*/locations/*/secrets/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSecret": { + "requestType": "UpdateSecretRequest", + "responseType": "Secret", + "options": { + "(google.api.http).patch": "/v1beta2/{secret.name=projects/*/secrets/*}", + "(google.api.http).body": "secret", + "(google.api.http).additional_bindings.patch": "/v1beta2/{secret.name=projects/*/locations/*/secrets/*}", + "(google.api.http).additional_bindings.body": "secret", + "(google.api.method_signature)": "secret,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta2/{secret.name=projects/*/secrets/*}", + "body": "secret", + "additional_bindings": { + "patch": "/v1beta2/{secret.name=projects/*/locations/*/secrets/*}", + "body": "secret" + } + } + }, + { + "(google.api.method_signature)": "secret,update_mask" + } + ] + }, + "DeleteSecret": { + "requestType": "DeleteSecretRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta2/{name=projects/*/secrets/*}", + "(google.api.http).additional_bindings.delete": "/v1beta2/{name=projects/*/locations/*/secrets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta2/{name=projects/*/secrets/*}", + "additional_bindings": { + "delete": "/v1beta2/{name=projects/*/locations/*/secrets/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSecretVersions": { + "requestType": "ListSecretVersionsRequest", + "responseType": "ListSecretVersionsResponse", + "options": { + "(google.api.http).get": "/v1beta2/{parent=projects/*/secrets/*}/versions", + "(google.api.http).additional_bindings.get": "/v1beta2/{parent=projects/*/locations/*/secrets/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{parent=projects/*/secrets/*}/versions", + "additional_bindings": { + "get": "/v1beta2/{parent=projects/*/locations/*/secrets/*}/versions" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSecretVersion": { + "requestType": "GetSecretVersionRequest", + "responseType": "SecretVersion", + "options": { + "(google.api.http).get": "/v1beta2/{name=projects/*/secrets/*/versions/*}", + "(google.api.http).additional_bindings.get": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{name=projects/*/secrets/*/versions/*}", + "additional_bindings": { + "get": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "AccessSecretVersion": { + "requestType": "AccessSecretVersionRequest", + "responseType": "AccessSecretVersionResponse", + "options": { + "(google.api.http).get": "/v1beta2/{name=projects/*/secrets/*/versions/*}:access", + "(google.api.http).additional_bindings.get": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:access", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{name=projects/*/secrets/*/versions/*}:access", + "additional_bindings": { + "get": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:access" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DisableSecretVersion": { + "requestType": "DisableSecretVersionRequest", + "responseType": "SecretVersion", + "options": { + "(google.api.http).post": "/v1beta2/{name=projects/*/secrets/*/versions/*}:disable", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:disable", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{name=projects/*/secrets/*/versions/*}:disable", + "body": "*", + "additional_bindings": { + "post": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:disable", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "EnableSecretVersion": { + "requestType": "EnableSecretVersionRequest", + "responseType": "SecretVersion", + "options": { + "(google.api.http).post": "/v1beta2/{name=projects/*/secrets/*/versions/*}:enable", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:enable", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{name=projects/*/secrets/*/versions/*}:enable", + "body": "*", + "additional_bindings": { + "post": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:enable", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DestroySecretVersion": { + "requestType": "DestroySecretVersionRequest", + "responseType": "SecretVersion", + "options": { + "(google.api.http).post": "/v1beta2/{name=projects/*/secrets/*/versions/*}:destroy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:destroy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{name=projects/*/secrets/*/versions/*}:destroy", + "body": "*", + "additional_bindings": { + "post": "/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:destroy", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1beta2/{resource=projects/*/secrets/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta2/{resource=projects/*/locations/*/secrets/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{resource=projects/*/secrets/*}:setIamPolicy", + "body": "*", + "additional_bindings": { + "post": "/v1beta2/{resource=projects/*/locations/*/secrets/*}:setIamPolicy", + "body": "*" + } + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).get": "/v1beta2/{resource=projects/*/secrets/*}:getIamPolicy", + "(google.api.http).additional_bindings.get": "/v1beta2/{resource=projects/*/locations/*/secrets/*}:getIamPolicy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{resource=projects/*/secrets/*}:getIamPolicy", + "additional_bindings": { + "get": "/v1beta2/{resource=projects/*/locations/*/secrets/*}:getIamPolicy" + } + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1beta2/{resource=projects/*/secrets/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta2/{resource=projects/*/locations/*/secrets/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{resource=projects/*/secrets/*}:testIamPermissions", + "body": "*", + "additional_bindings": { + "post": "/v1beta2/{resource=projects/*/locations/*/secrets/*}:testIamPermissions", + "body": "*" + } + } + } + ] + } + } + }, + "ListSecretsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "secretmanager.googleapis.com/Secret" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSecretsResponse": { + "fields": { + "secrets": { + "rule": "repeated", + "type": "Secret", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "CreateSecretRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "secretmanager.googleapis.com/Secret" + } + }, + "secretId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "secret": { + "type": "Secret", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddSecretVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/Secret" + } + }, + "payload": { + "type": "SecretPayload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSecretRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/Secret" + } + } + } + }, + "ListSecretVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/Secret" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSecretVersionsResponse": { + "fields": { + "versions": { + "rule": "repeated", + "type": "SecretVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "GetSecretVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "UpdateSecretRequest": { + "fields": { + "secret": { + "type": "Secret", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AccessSecretVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "AccessSecretVersionResponse": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "payload": { + "type": "SecretPayload", + "id": 2 + } + } + }, + "DeleteSecretRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/Secret" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DisableSecretVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EnableSecretVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DestroySecretVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } } } }, @@ -1669,7 +2727,8 @@ "INPUT_ONLY": 4, "IMMUTABLE": 5, "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7 + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 } }, "resourceReference": { @@ -1956,6 +3015,10 @@ "rule": "repeated", "type": "ClientLibrarySettings", "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 } } }, @@ -2013,6 +3076,31 @@ "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 } } }, @@ -2041,6 +3129,11 @@ "longRunning": { "type": "LongRunning", "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 } }, "nested": { @@ -2072,7 +3165,10 @@ "CLOUD": 1, "ADS": 2, "PHOTOS": 3, - "STREET_VIEW": 4 + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 } }, "ClientLibraryDestination": { @@ -2116,6 +3212,21 @@ } } }, + "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": { @@ -2180,8 +3291,8 @@ "id": 12 }, "edition": { - "type": "string", - "id": 13 + "type": "Edition", + "id": 14 } } }, @@ -2273,6 +3384,26 @@ "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": [ @@ -2280,7 +3411,45 @@ 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": { @@ -2355,8 +3524,8 @@ "Label": { "values": { "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3 + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 } } } @@ -2544,13 +3713,6 @@ "default": false } }, - "phpGenericServices": { - "type": "bool", - "id": 42, - "options": { - "default": false - } - }, "deprecated": { "type": "bool", "id": 23, @@ -2593,6 +3755,10 @@ "type": "string", "id": 45 }, + "features": { + "type": "FeatureSet", + "id": 50 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2606,6 +3772,10 @@ ] ], "reserved": [ + [ + 42, + 42 + ], [ 38, 38 @@ -2655,6 +3825,10 @@ "deprecated": true } }, + "features": { + "type": "FeatureSet", + "id": 12 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2749,9 +3923,22 @@ "type": "OptionRetention", "id": 17 }, - "target": { + "targets": { + "rule": "repeated", "type": "OptionTargetType", - "id": 18 + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 }, "uninterpretedOption": { "rule": "repeated", @@ -2769,6 +3956,10 @@ [ 4, 4 + ], + [ + 18, + 18 ] ], "nested": { @@ -2806,11 +3997,27 @@ "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", @@ -2844,6 +4051,10 @@ "deprecated": true } }, + "features": { + "type": "FeatureSet", + "id": 7 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2872,6 +4083,17 @@ "default": false } }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2887,6 +4109,10 @@ }, "ServiceOptions": { "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, "deprecated": { "type": "bool", "id": 33, @@ -2923,6 +4149,10 @@ "default": "IDEMPOTENCY_UNKNOWN" } }, + "features": { + "type": "FeatureSet", + "id": 35 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2994,6 +4224,166 @@ } } }, + "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 + ], + [ + 9995, + 9999 + ] + ], + "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": { @@ -3121,7 +4511,7 @@ "options": { "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", "java_multiple_files": true, "java_outer_classname": "PolicyProto", "java_package": "com.google.iam.v1", diff --git a/packages/google-cloud-secretmanager/samples/README.md b/packages/google-cloud-secretmanager/samples/README.md index 7ec4884cd7b..329253849db 100644 --- a/packages/google-cloud-secretmanager/samples/README.md +++ b/packages/google-cloud-secretmanager/samples/README.md @@ -12,6 +12,21 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Secret_manager_service.access_secret_version](#secret_manager_service.access_secret_version) + * [Secret_manager_service.add_secret_version](#secret_manager_service.add_secret_version) + * [Secret_manager_service.create_secret](#secret_manager_service.create_secret) + * [Secret_manager_service.delete_secret](#secret_manager_service.delete_secret) + * [Secret_manager_service.destroy_secret_version](#secret_manager_service.destroy_secret_version) + * [Secret_manager_service.disable_secret_version](#secret_manager_service.disable_secret_version) + * [Secret_manager_service.enable_secret_version](#secret_manager_service.enable_secret_version) + * [Secret_manager_service.get_iam_policy](#secret_manager_service.get_iam_policy) + * [Secret_manager_service.get_secret](#secret_manager_service.get_secret) + * [Secret_manager_service.get_secret_version](#secret_manager_service.get_secret_version) + * [Secret_manager_service.list_secret_versions](#secret_manager_service.list_secret_versions) + * [Secret_manager_service.list_secrets](#secret_manager_service.list_secrets) + * [Secret_manager_service.set_iam_policy](#secret_manager_service.set_iam_policy) + * [Secret_manager_service.test_iam_permissions](#secret_manager_service.test_iam_permissions) + * [Secret_manager_service.update_secret](#secret_manager_service.update_secret) * [Secret_manager_service.access_secret_version](#secret_manager_service.access_secret_version) * [Secret_manager_service.add_secret_version](#secret_manager_service.add_secret_version) * [Secret_manager_service.create_secret](#secret_manager_service.create_secret) @@ -299,6 +314,261 @@ __Usage:__ +### Secret_manager_service.access_secret_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js` + + +----- + + + + +### Secret_manager_service.add_secret_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js` + + +----- + + + + +### Secret_manager_service.create_secret + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.js` + + +----- + + + + +### Secret_manager_service.delete_secret + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js` + + +----- + + + + +### Secret_manager_service.destroy_secret_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.js` + + +----- + + + + +### Secret_manager_service.disable_secret_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.js` + + +----- + + + + +### Secret_manager_service.enable_secret_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.js` + + +----- + + + + +### Secret_manager_service.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js` + + +----- + + + + +### Secret_manager_service.get_secret + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.js` + + +----- + + + + +### Secret_manager_service.get_secret_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js` + + +----- + + + + +### Secret_manager_service.list_secret_versions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js` + + +----- + + + + +### Secret_manager_service.list_secrets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.js` + + +----- + + + + +### Secret_manager_service.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.js` + + +----- + + + + +### Secret_manager_service.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js` + + +----- + + + + +### Secret_manager_service.update_secret + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js` + + +----- + + + + ### Quickstart View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-secretmanager/samples/quickstart.js). diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js new file mode 100644 index 00000000000..06434cbd3f0 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.access_secret_version.js @@ -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 +// +// 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 secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_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 resource name of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion in the + * format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + * `projects/* /secrets/* /versions/latest` or + * `projects/* /locations/* /secrets/* /versions/latest` is an alias to the most + * recently created + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion. + */ + // const name = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callAccessSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.accessSecretVersion(request); + console.log(response); + } + + callAccessSecretVersion(); + // [END secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js new file mode 100644 index 00000000000..4ac1e63c6ce --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.add_secret_version.js @@ -0,0 +1,70 @@ +// 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, payload) { + // [START secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_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 resource name of the + * Secret google.cloud.secretmanager.v1beta2.Secret to associate with the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion in the + * format `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + */ + // const parent = 'abc123' + /** + * Required. The secret payload of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion. + */ + // const payload = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callAddSecretVersion() { + // Construct request + const request = { + parent, + payload, + }; + + // Run request + const response = await secretmanagerClient.addSecretVersion(request); + console.log(response); + } + + callAddSecretVersion(); + // [END secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.js new file mode 100644 index 00000000000..6b9d419a24c --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.create_secret.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(parent, secretId, secret) { + // [START secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_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 resource name of the project to associate with the + * Secret google.cloud.secretmanager.v1beta2.Secret, in the format + * `projects/*` or `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. This must be unique within the project. + * A secret ID is a string with a maximum length of 255 characters and can + * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + * underscore (`_`) characters. + */ + // const secretId = 'abc123' + /** + * Required. A Secret google.cloud.secretmanager.v1beta2.Secret with + * initial field values. + */ + // const secret = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callCreateSecret() { + // Construct request + const request = { + parent, + secretId, + secret, + }; + + // Run request + const response = await secretmanagerClient.createSecret(request); + console.log(response); + } + + callCreateSecret(); + // [END secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js new file mode 100644 index 00000000000..e5e9a7c5add --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.delete_secret.js @@ -0,0 +1,69 @@ +// 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 secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_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 resource name of the + * Secret google.cloud.secretmanager.v1beta2.Secret to delete in the format + * `projects/* /secrets/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the Secret google.cloud.secretmanager.v1beta2.Secret. + * The request succeeds if it matches the etag of the currently stored secret + * object. If the etag is omitted, the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callDeleteSecret() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.deleteSecret(request); + console.log(response); + } + + callDeleteSecret(); + // [END secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.js new file mode 100644 index 00000000000..d2c99a85738 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.destroy_secret_version.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(name) { + // [START secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_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 resource name of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion to + * destroy in the format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion. The + * request succeeds if it matches the etag of the currently stored secret + * version object. If the etag is omitted, the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callDestroySecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.destroySecretVersion(request); + console.log(response); + } + + callDestroySecretVersion(); + // [END secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.js new file mode 100644 index 00000000000..579080ad463 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.disable_secret_version.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(name) { + // [START secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_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 resource name of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion to + * disable in the format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion. The + * request succeeds if it matches the etag of the currently stored secret + * version object. If the etag is omitted, the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callDisableSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.disableSecretVersion(request); + console.log(response); + } + + callDisableSecretVersion(); + // [END secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.js new file mode 100644 index 00000000000..bb98dacfbb8 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.enable_secret_version.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(name) { + // [START secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_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 resource name of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion to enable + * in the format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion. The + * request succeeds if it matches the etag of the currently stored secret + * version object. If the etag is omitted, the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callEnableSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.enableSecretVersion(request); + console.log(response); + } + + callEnableSecretVersion(); + // [END secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js new file mode 100644 index 00000000000..0ff5131b97a --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_iam_policy.js @@ -0,0 +1,67 @@ +// 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) { + // [START secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_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 resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await secretmanagerClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.js new file mode 100644 index 00000000000..be0269b392c --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret.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(name) { + // [START secretmanager_v1beta2_generated_SecretManagerService_GetSecret_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 resource name of the + * Secret google.cloud.secretmanager.v1beta2.Secret, in the format + * `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + */ + // const name = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callGetSecret() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.getSecret(request); + console.log(response); + } + + callGetSecret(); + // [END secretmanager_v1beta2_generated_SecretManagerService_GetSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js new file mode 100644 index 00000000000..c99471689d2 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.get_secret_version.js @@ -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 +// +// 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 secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_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 resource name of the + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion in the + * format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + * `projects/* /secrets/* /versions/latest` or + * `projects/* /locations/* /secrets/* /versions/latest` is an alias to the most + * recently created + * SecretVersion google.cloud.secretmanager.v1beta2.SecretVersion. + */ + // const name = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callGetSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.getSecretVersion(request); + console.log(response); + } + + callGetSecretVersion(); + // [END secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js new file mode 100644 index 00000000000..dccc7f1cebf --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secret_versions.js @@ -0,0 +1,85 @@ +// 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 secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_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 resource name of the + * Secret google.cloud.secretmanager.v1beta2.Secret associated with the + * SecretVersions google.cloud.secretmanager.v1beta2.SecretVersion to list, + * in the format `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListSecretVersionsResponse.next_page_token . + */ + // const pageToken = 'abc123' + /** + * Optional. Filter string, adhering to the rules in + * List-operation + * filtering (https://cloud.google.com/secret-manager/docs/filtering). List + * only secret versions matching the filter. If filter is empty, all secret + * versions are listed. + */ + // const filter = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callListSecretVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = secretmanagerClient.listSecretVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecretVersions(); + // [END secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.js new file mode 100644 index 00000000000..b8da5aeef80 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.list_secrets.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(parent) { + // [START secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_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 resource name of the project associated with the + * Secrets google.cloud.secretmanager.v1beta2.Secret, in the format + * `projects/*` or `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListSecretsResponse.next_page_token google.cloud.secretmanager.v1beta2.ListSecretsResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter string, adhering to the rules in + * List-operation + * filtering (https://cloud.google.com/secret-manager/docs/filtering). List + * only secrets matching the filter. If filter is empty, all secrets are + * listed. + */ + // const filter = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callListSecrets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = secretmanagerClient.listSecretsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecrets(); + // [END secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.js new file mode 100644 index 00000000000..1e5979ab344 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.set_iam_policy.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(resource, policy) { + // [START secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_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 resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await secretmanagerClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js new file mode 100644 index 00000000000..f6c59404155 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.test_iam_permissions.js @@ -0,0 +1,70 @@ +// 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, permissions) { + // [START secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_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 resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await secretmanagerClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js new file mode 100644 index 00000000000..6996027c71b --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/secret_manager_service.update_secret.js @@ -0,0 +1,67 @@ +// 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(secret, updateMask) { + // [START secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_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. Secret google.cloud.secretmanager.v1beta2.Secret with updated + * field values. + */ + // const secret = {} + /** + * Required. Specifies the fields to be updated. + */ + // const updateMask = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = require('@google-cloud/secretmanager').v1beta2; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callUpdateSecret() { + // Construct request + const request = { + secret, + updateMask, + }; + + // Run request + const response = await secretmanagerClient.updateSecret(request); + console.log(response); + } + + callUpdateSecret(); + // [END secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1beta2/snippet_metadata_google.cloud.secretmanager.v1beta2.json b/packages/google-cloud-secretmanager/samples/generated/v1beta2/snippet_metadata_google.cloud.secretmanager.v1beta2.json new file mode 100644 index 00000000000..6509fdc0e99 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1beta2/snippet_metadata_google.cloud.secretmanager.v1beta2.json @@ -0,0 +1,687 @@ +{ + "clientLibrary": { + "name": "nodejs-secretmanager", + "version": "5.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.secretmanager.v1beta2", + "version": "v1beta2" + } + ] + }, + "snippets": [ + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_async", + "title": "SecretManagerService listSecrets Sample", + "origin": "API_DEFINITION", + "description": " Lists [Secrets][google.cloud.secretmanager.v1beta2.Secret].", + "canonical": true, + "file": "secret_manager_service.list_secrets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSecrets", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecrets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.ListSecretsResponse", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "ListSecrets", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecrets", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_async", + "title": "SecretManagerService createSecret Sample", + "origin": "API_DEFINITION", + "description": " Creates a new [Secret][google.cloud.secretmanager.v1beta2.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion].", + "canonical": true, + "file": "secret_manager_service.create_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.CreateSecret", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "secret_id", + "type": "TYPE_STRING" + }, + { + "name": "secret", + "type": ".google.cloud.secretmanager.v1beta2.Secret" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.Secret", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "CreateSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.CreateSecret", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_async", + "title": "SecretManagerService addSecretVersion Sample", + "origin": "API_DEFINITION", + "description": " Creates a new [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1beta2.Secret].", + "canonical": true, + "file": "secret_manager_service.add_secret_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.secretmanager.v1beta2.SecretPayload" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.SecretVersion", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "AddSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_GetSecret_async", + "title": "SecretManagerService getSecret Sample", + "origin": "API_DEFINITION", + "description": " Gets metadata for a given [Secret][google.cloud.secretmanager.v1beta2.Secret].", + "canonical": true, + "file": "secret_manager_service.get_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecret", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.Secret", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "GetSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecret", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_async", + "title": "SecretManagerService updateSecret Sample", + "origin": "API_DEFINITION", + "description": " Updates metadata of an existing [Secret][google.cloud.secretmanager.v1beta2.Secret].", + "canonical": true, + "file": "secret_manager_service.update_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.UpdateSecret", + "async": true, + "parameters": [ + { + "name": "secret", + "type": ".google.cloud.secretmanager.v1beta2.Secret" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.Secret", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "UpdateSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.UpdateSecret", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_async", + "title": "SecretManagerService deleteSecret Sample", + "origin": "API_DEFINITION", + "description": " Deletes a [Secret][google.cloud.secretmanager.v1beta2.Secret].", + "canonical": true, + "file": "secret_manager_service.delete_secret.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.DeleteSecret", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "DeleteSecret", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.DeleteSecret", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_async", + "title": "SecretManagerService listSecretVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. This call does not return secret data.", + "canonical": true, + "file": "secret_manager_service.list_secret_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSecretVersions", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "ListSecretVersions", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersions", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_async", + "title": "SecretManagerService getSecretVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. `projects/*/secrets/*/versions/latest` is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion].", + "canonical": true, + "file": "secret_manager_service.get_secret_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.SecretVersion", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "GetSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretVersion", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_async", + "title": "SecretManagerService accessSecretVersion Sample", + "origin": "API_DEFINITION", + "description": " Accesses a [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. This call returns the secret data. `projects/*/secrets/*/versions/latest` is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion].", + "canonical": true, + "file": "secret_manager_service.access_secret_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AccessSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "AccessSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_async", + "title": "SecretManagerService disableSecretVersion Sample", + "origin": "API_DEFINITION", + "description": " Disables a [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DISABLED].", + "canonical": true, + "file": "secret_manager_service.disable_secret_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisableSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.DisableSecretVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.SecretVersion", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "DisableSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.DisableSecretVersion", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_async", + "title": "SecretManagerService enableSecretVersion Sample", + "origin": "API_DEFINITION", + "description": " Enables a [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.ENABLED].", + "canonical": true, + "file": "secret_manager_service.enable_secret_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnableSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.EnableSecretVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.SecretVersion", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "EnableSecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.EnableSecretVersion", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_async", + "title": "SecretManagerService destroySecretVersion Sample", + "origin": "API_DEFINITION", + "description": " Destroys a [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.", + "canonical": true, + "file": "secret_manager_service.destroy_secret_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DestroySecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.DestroySecretVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.secretmanager.v1beta2.SecretVersion", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "DestroySecretVersion", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.DestroySecretVersion", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_async", + "title": "SecretManagerService setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified secret. Replaces any existing policy. Permissions on [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] are enforced according to the policy set on the associated [Secret][google.cloud.secretmanager.v1beta2.Secret].", + "canonical": true, + "file": "secret_manager_service.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.SetIamPolicy", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_async", + "title": "SecretManagerService getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.", + "canonical": true, + "file": "secret_manager_service.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetIamPolicy", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + }, + { + "regionTag": "secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_async", + "title": "SecretManagerService testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + "canonical": true, + "file": "secret_manager_service.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecretManagerServiceClient", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerServiceClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService.TestIamPermissions", + "service": { + "shortName": "SecretManagerService", + "fullName": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-secretmanager/src/index.ts b/packages/google-cloud-secretmanager/src/index.ts index 8077742f098..6d9a1f34708 100644 --- a/packages/google-cloud-secretmanager/src/index.ts +++ b/packages/google-cloud-secretmanager/src/index.ts @@ -18,11 +18,12 @@ import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; +import * as v1beta2 from './v1beta2'; const SecretManagerServiceClient = v1.SecretManagerServiceClient; type SecretManagerServiceClient = v1.SecretManagerServiceClient; -export {v1, v1beta1, SecretManagerServiceClient}; -export default {v1, v1beta1, SecretManagerServiceClient}; +export {v1, v1beta1, v1beta2, SecretManagerServiceClient}; +export default {v1, v1beta1, v1beta2, SecretManagerServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-secretmanager/src/v1beta2/gapic_metadata.json b/packages/google-cloud-secretmanager/src/v1beta2/gapic_metadata.json new file mode 100644 index 00000000000..19d5571db19 --- /dev/null +++ b/packages/google-cloud-secretmanager/src/v1beta2/gapic_metadata.json @@ -0,0 +1,181 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.secretmanager.v1beta2", + "libraryPackage": "@google-cloud/secretmanager", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "SecretManagerServiceClient", + "rpcs": { + "CreateSecret": { + "methods": [ + "createSecret" + ] + }, + "AddSecretVersion": { + "methods": [ + "addSecretVersion" + ] + }, + "GetSecret": { + "methods": [ + "getSecret" + ] + }, + "UpdateSecret": { + "methods": [ + "updateSecret" + ] + }, + "DeleteSecret": { + "methods": [ + "deleteSecret" + ] + }, + "GetSecretVersion": { + "methods": [ + "getSecretVersion" + ] + }, + "AccessSecretVersion": { + "methods": [ + "accessSecretVersion" + ] + }, + "DisableSecretVersion": { + "methods": [ + "disableSecretVersion" + ] + }, + "EnableSecretVersion": { + "methods": [ + "enableSecretVersion" + ] + }, + "DestroySecretVersion": { + "methods": [ + "destroySecretVersion" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListSecrets": { + "methods": [ + "listSecrets", + "listSecretsStream", + "listSecretsAsync" + ] + }, + "ListSecretVersions": { + "methods": [ + "listSecretVersions", + "listSecretVersionsStream", + "listSecretVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecretManagerServiceClient", + "rpcs": { + "CreateSecret": { + "methods": [ + "createSecret" + ] + }, + "AddSecretVersion": { + "methods": [ + "addSecretVersion" + ] + }, + "GetSecret": { + "methods": [ + "getSecret" + ] + }, + "UpdateSecret": { + "methods": [ + "updateSecret" + ] + }, + "DeleteSecret": { + "methods": [ + "deleteSecret" + ] + }, + "GetSecretVersion": { + "methods": [ + "getSecretVersion" + ] + }, + "AccessSecretVersion": { + "methods": [ + "accessSecretVersion" + ] + }, + "DisableSecretVersion": { + "methods": [ + "disableSecretVersion" + ] + }, + "EnableSecretVersion": { + "methods": [ + "enableSecretVersion" + ] + }, + "DestroySecretVersion": { + "methods": [ + "destroySecretVersion" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListSecrets": { + "methods": [ + "listSecrets", + "listSecretsStream", + "listSecretsAsync" + ] + }, + "ListSecretVersions": { + "methods": [ + "listSecretVersions", + "listSecretVersionsStream", + "listSecretVersionsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-secretmanager/src/v1beta2/index.ts b/packages/google-cloud-secretmanager/src/v1beta2/index.ts new file mode 100644 index 00000000000..deae5b15fd8 --- /dev/null +++ b/packages/google-cloud-secretmanager/src/v1beta2/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 {SecretManagerServiceClient} from './secret_manager_service_client'; diff --git a/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_client.ts b/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_client.ts new file mode 100644 index 00000000000..c3ba3fb4c9d --- /dev/null +++ b/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_client.ts @@ -0,0 +1,2605 @@ +// 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, + LocationsClient, + LocationProtos, +} 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/v1beta2/secret_manager_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './secret_manager_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Secret Manager Service + * + * Manages secrets and operations using those secrets. Implements a REST + * model with the following objects: + * + * * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} + * * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} + * @class + * @memberof v1beta2 + */ +export class SecretManagerServiceClient { + 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}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + secretManagerServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecretManagerServiceClient. + * + * @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 SecretManagerServiceClient({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 SecretManagerServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + this._universeDomain = + opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + this._servicePath = 'secretmanager.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } 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 = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationSecretPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/secrets/{secret}' + ), + projectLocationSecretSecretVersionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}' + ), + projectSecretPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/secrets/{secret}' + ), + projectSecretSecretVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/secrets/{secret}/versions/{secret_version}' + ), + topicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}' + ), + }; + + // 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 = { + listSecrets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'secrets' + ), + listSecretVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'versions' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.secretmanager.v1beta2.SecretManagerService', + 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.secretManagerServiceStub) { + return this.secretManagerServiceStub; + } + + // Put together the "service stub" for + // google.cloud.secretmanager.v1beta2.SecretManagerService. + this.secretManagerServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.secretmanager.v1beta2.SecretManagerService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.secretmanager.v1beta2 + .SecretManagerService, + 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 secretManagerServiceStubMethods = [ + 'listSecrets', + 'createSecret', + 'addSecretVersion', + 'getSecret', + 'updateSecret', + 'deleteSecret', + 'listSecretVersions', + 'getSecretVersion', + 'accessSecretVersion', + 'disableSecretVersion', + 'enableSecretVersion', + 'destroySecretVersion', + 'setIamPolicy', + 'getIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of secretManagerServiceStubMethods) { + const callPromise = this.secretManagerServiceStub.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.secretManagerServiceStub; + } + + /** + * 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 !== undefined && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'secretmanager.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 !== undefined && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'secretmanager.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 new {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} + * containing no + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersions}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to associate with the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}, in the format + * `projects/*` or `projects/* /locations/*`. + * @param {string} request.secretId + * Required. This must be unique within the project. + * + * A secret ID is a string with a maximum length of 255 characters and can + * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + * underscore (`_`) characters. + * @param {google.cloud.secretmanager.v1beta2.Secret} request.secret + * Required. A {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} with + * initial field values. + * @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.secretmanager.v1beta2.Secret|Secret}. + * 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/v1beta2/secret_manager_service.create_secret.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_async + */ + createSecret( + request?: protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret, + ( + | protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest + | undefined + ), + {} | undefined, + ] + >; + createSecret( + request: protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSecret( + request: protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSecret( + request?: protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret, + ( + | protos.google.cloud.secretmanager.v1beta2.ICreateSecretRequest + | 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.createSecret(request, options, callback); + } + /** + * Creates a new + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} + * containing secret data and attaches it to an existing + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} to associate with the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} in the + * format `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + * @param {google.cloud.secretmanager.v1beta2.SecretPayload} request.payload + * Required. The secret payload of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * 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/v1beta2/secret_manager_service.add_secret_version.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_async + */ + addSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest + | undefined + ), + {} | undefined, + ] + >; + addSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IAddSecretVersionRequest + | 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.addSecretVersion(request, options, callback); + } + /** + * Gets metadata for a given + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}, in the format + * `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + * @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.secretmanager.v1beta2.Secret|Secret}. + * 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/v1beta2/secret_manager_service.get_secret.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_GetSecret_async + */ + getSecret( + request?: protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret, + protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest | undefined, + {} | undefined, + ] + >; + getSecret( + request: protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSecret( + request: protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSecret( + request?: protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret, + protos.google.cloud.secretmanager.v1beta2.IGetSecretRequest | 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.getSecret(request, options, callback); + } + /** + * Updates metadata of an existing + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.secretmanager.v1beta2.Secret} request.secret + * Required. {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} with updated + * field values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Specifies the fields to be updated. + * @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.secretmanager.v1beta2.Secret|Secret}. + * 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/v1beta2/secret_manager_service.update_secret.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_async + */ + updateSecret( + request?: protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret, + ( + | protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest + | undefined + ), + {} | undefined, + ] + >; + updateSecret( + request: protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecret( + request: protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecret( + request?: protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecret, + | protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret, + ( + | protos.google.cloud.secretmanager.v1beta2.IUpdateSecretRequest + | 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({ + 'secret.name': request.secret!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSecret(request, options, callback); + } + /** + * Deletes a {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} to delete in the format + * `projects/* /secrets/*`. + * @param {string} [request.etag] + * Optional. Etag of the {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}. + * The request succeeds if it matches the etag of the currently stored secret + * object. If the etag is omitted, the request succeeds. + * @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/v1beta2/secret_manager_service.delete_secret.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_async + */ + deleteSecret( + request?: protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest + | undefined + ), + {} | undefined, + ] + >; + deleteSecret( + request: protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSecret( + request: protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSecret( + request?: protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.secretmanager.v1beta2.IDeleteSecretRequest + | 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.deleteSecret(request, options, callback); + } + /** + * Gets metadata for a + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} in the + * format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + * + * `projects/* /secrets/* /versions/latest` or + * `projects/* /locations/* /secrets/* /versions/latest` is an alias to the most + * recently created + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * 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/v1beta2/secret_manager_service.get_secret_version.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_async + */ + getSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest + | undefined + ), + {} | undefined, + ] + >; + getSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IGetSecretVersionRequest + | 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.getSecretVersion(request, options, callback); + } + /** + * Accesses a + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. This + * call returns the secret data. + * + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} in the + * format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + * + * `projects/* /secrets/* /versions/latest` or + * `projects/* /locations/* /secrets/* /versions/latest` is an alias to the most + * recently created + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * @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.secretmanager.v1beta2.AccessSecretVersionResponse|AccessSecretVersionResponse}. + * 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/v1beta2/secret_manager_service.access_secret_version.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_async + */ + accessSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, + ( + | protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest + | undefined + ), + {} | undefined, + ] + >; + accessSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, + | protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + accessSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, + | protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + accessSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, + | protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, + | protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse, + ( + | protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionRequest + | 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.accessSecretVersion(request, options, callback); + } + /** + * Disables a + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * + * Sets the {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion.state|state} of + * the {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} to + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion.State.DISABLED|DISABLED}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} to + * disable in the format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + * @param {string} [request.etag] + * Optional. Etag of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. The + * request succeeds if it matches the etag of the currently stored secret + * version object. If the etag is omitted, the request succeeds. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * 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/v1beta2/secret_manager_service.disable_secret_version.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_async + */ + disableSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest + | undefined + ), + {} | undefined, + ] + >; + disableSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + disableSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + disableSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IDisableSecretVersionRequest + | 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.disableSecretVersion(request, options, callback); + } + /** + * Enables a + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * + * Sets the {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion.state|state} of + * the {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} to + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion.State.ENABLED|ENABLED}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} to enable + * in the format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + * @param {string} [request.etag] + * Optional. Etag of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. The + * request succeeds if it matches the etag of the currently stored secret + * version object. If the etag is omitted, the request succeeds. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * 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/v1beta2/secret_manager_service.enable_secret_version.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_async + */ + enableSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest + | undefined + ), + {} | undefined, + ] + >; + enableSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enableSecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enableSecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IEnableSecretVersionRequest + | 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.enableSecretVersion(request, options, callback); + } + /** + * Destroys a + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * + * Sets the {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion.state|state} of + * the {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} to + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion.State.DESTROYED|DESTROYED} + * and irrevocably destroys the secret data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion} to + * destroy in the format `projects/* /secrets/* /versions/*` or + * `projects/* /locations/* /secrets/* /versions/*`. + * @param {string} [request.etag] + * Optional. Etag of the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersion}. The + * request succeeds if it matches the etag of the currently stored secret + * version object. If the etag is omitted, the request succeeds. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * 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/v1beta2/secret_manager_service.destroy_secret_version.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_async + */ + destroySecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest + | undefined + ), + {} | undefined, + ] + >; + destroySecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + destroySecretVersion( + request: protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest, + callback: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + destroySecretVersion( + request?: protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + | protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion, + ( + | protos.google.cloud.secretmanager.v1beta2.IDestroySecretVersionRequest + | 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.destroySecretVersion(request, options, callback); + } + /** + * Sets the access control policy on the specified secret. Replaces any + * existing policy. + * + * Permissions on + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersions} are + * enforced according to the policy set on the associated + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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.iam.v1.Policy|Policy}. + * 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/v1beta2/secret_manager_service.set_iam_policy.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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.setIamPolicy(request, options, callback); + } + /** + * Gets the access control policy for a secret. + * Returns empty policy if the secret exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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.iam.v1.Policy|Policy}. + * 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/v1beta2/secret_manager_service.get_iam_policy.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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.getIamPolicy(request, options, callback); + } + /** + * Returns permissions that a caller has for the specified secret. + * If the secret does not exist, this call returns an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * 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/v1beta2/secret_manager_service.test_iam_permissions.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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.testIamPermissions(request, options, callback); + } + + /** + * Lists {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secrets}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project associated with the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secrets}, in the format + * `projects/*` or `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.secretmanager.v1beta2.ListSecretsResponse.next_page_token|ListSecretsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Filter string, adhering to the rules in + * [List-operation + * filtering](https://cloud.google.com/secret-manager/docs/filtering). List + * only secrets matching the filter. If filter is empty, all secrets are + * listed. + * @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.secretmanager.v1beta2.Secret|Secret}. + * 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 `listSecretsAsync()` + * 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. + */ + listSecrets( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret[], + protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest | null, + protos.google.cloud.secretmanager.v1beta2.IListSecretsResponse, + ] + >; + listSecrets( + request: protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecret + > + ): void; + listSecrets( + request: protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecret + > + ): void; + listSecrets( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecret + >, + callback?: PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecret + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecret[], + protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest | null, + protos.google.cloud.secretmanager.v1beta2.IListSecretsResponse, + ] + > | 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.listSecrets(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 resource name of the project associated with the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secrets}, in the format + * `projects/*` or `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.secretmanager.v1beta2.ListSecretsResponse.next_page_token|ListSecretsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Filter string, adhering to the rules in + * [List-operation + * filtering](https://cloud.google.com/secret-manager/docs/filtering). List + * only secrets matching the filter. If filter is empty, all secrets are + * listed. + * @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.secretmanager.v1beta2.Secret|Secret} 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 `listSecretsAsync()` + * 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. + */ + listSecretsStream( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + 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['listSecrets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSecrets.createStream( + this.innerApiCalls.listSecrets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSecrets`, 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 resource name of the project associated with the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secrets}, in the format + * `projects/*` or `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.secretmanager.v1beta2.ListSecretsResponse.next_page_token|ListSecretsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Filter string, adhering to the rules in + * [List-operation + * filtering](https://cloud.google.com/secret-manager/docs/filtering). List + * only secrets matching the filter. If filter is empty, all secrets are + * listed. + * @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.secretmanager.v1beta2.Secret|Secret}. 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/v1beta2/secret_manager_service.list_secrets.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_async + */ + listSecretsAsync( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretsRequest, + 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['listSecrets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSecrets.asyncIterate( + this.innerApiCalls['listSecrets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersions}. + * This call does not return secret data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} associated with the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersions} to list, + * in the format `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * ListSecretVersionsResponse.next_page_token][]. + * @param {string} [request.filter] + * Optional. Filter string, adhering to the rules in + * [List-operation + * filtering](https://cloud.google.com/secret-manager/docs/filtering). List + * only secret versions matching the filter. If filter is empty, all secret + * versions are listed. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion}. + * 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 `listSecretVersionsAsync()` + * 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. + */ + listSecretVersions( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion[], + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest | null, + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse, + ] + >; + listSecretVersions( + request: protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecretVersion + > + ): void; + listSecretVersions( + request: protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecretVersion + > + ): void; + listSecretVersions( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecretVersion + >, + callback?: PaginationCallback< + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + | protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1beta2.ISecretVersion + > + ): Promise< + [ + protos.google.cloud.secretmanager.v1beta2.ISecretVersion[], + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest | null, + protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsResponse, + ] + > | 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.listSecretVersions(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 resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} associated with the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersions} to list, + * in the format `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * ListSecretVersionsResponse.next_page_token][]. + * @param {string} [request.filter] + * Optional. Filter string, adhering to the rules in + * [List-operation + * filtering](https://cloud.google.com/secret-manager/docs/filtering). List + * only secret versions matching the filter. If filter is empty, all secret + * versions are listed. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion} 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 `listSecretVersionsAsync()` + * 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. + */ + listSecretVersionsStream( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + 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['listSecretVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSecretVersions.createStream( + this.innerApiCalls.listSecretVersions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSecretVersions`, 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 resource name of the + * {@link protos.google.cloud.secretmanager.v1beta2.Secret|Secret} associated with the + * {@link protos.google.cloud.secretmanager.v1beta2.SecretVersion|SecretVersions} to list, + * in the format `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * ListSecretVersionsResponse.next_page_token][]. + * @param {string} [request.filter] + * Optional. Filter string, adhering to the rules in + * [List-operation + * filtering](https://cloud.google.com/secret-manager/docs/filtering). List + * only secret versions matching the filter. If filter is empty, all secret + * versions are listed. + * @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.secretmanager.v1beta2.SecretVersion|SecretVersion}. 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/v1beta2/secret_manager_service.list_secret_versions.js + * region_tag:secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_async + */ + listSecretVersionsAsync( + request?: protos.google.cloud.secretmanager.v1beta2.IListSecretVersionsRequest, + 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['listSecretVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSecretVersions.asyncIterate( + this.innerApiCalls['listSecretVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list 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 google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * 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 projectLocationSecret resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} secret + * @returns {string} Resource name string. + */ + projectLocationSecretPath(project: string, location: string, secret: string) { + return this.pathTemplates.projectLocationSecretPathTemplate.render({ + project: project, + location: location, + secret: secret, + }); + } + + /** + * Parse the project from ProjectLocationSecret resource. + * + * @param {string} projectLocationSecretName + * A fully-qualified path representing project_location_secret resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecretName(projectLocationSecretName: string) { + return this.pathTemplates.projectLocationSecretPathTemplate.match( + projectLocationSecretName + ).project; + } + + /** + * Parse the location from ProjectLocationSecret resource. + * + * @param {string} projectLocationSecretName + * A fully-qualified path representing project_location_secret resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecretName( + projectLocationSecretName: string + ) { + return this.pathTemplates.projectLocationSecretPathTemplate.match( + projectLocationSecretName + ).location; + } + + /** + * Parse the secret from ProjectLocationSecret resource. + * + * @param {string} projectLocationSecretName + * A fully-qualified path representing project_location_secret resource. + * @returns {string} A string representing the secret. + */ + matchSecretFromProjectLocationSecretName(projectLocationSecretName: string) { + return this.pathTemplates.projectLocationSecretPathTemplate.match( + projectLocationSecretName + ).secret; + } + + /** + * Return a fully-qualified projectLocationSecretSecretVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} secret + * @param {string} secret_version + * @returns {string} Resource name string. + */ + projectLocationSecretSecretVersionPath( + project: string, + location: string, + secret: string, + secretVersion: string + ) { + return this.pathTemplates.projectLocationSecretSecretVersionPathTemplate.render( + { + project: project, + location: location, + secret: secret, + secret_version: secretVersion, + } + ); + } + + /** + * Parse the project from ProjectLocationSecretSecretVersion resource. + * + * @param {string} projectLocationSecretSecretVersionName + * A fully-qualified path representing project_location_secret_secret_version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecretSecretVersionName( + projectLocationSecretSecretVersionName: string + ) { + return this.pathTemplates.projectLocationSecretSecretVersionPathTemplate.match( + projectLocationSecretSecretVersionName + ).project; + } + + /** + * Parse the location from ProjectLocationSecretSecretVersion resource. + * + * @param {string} projectLocationSecretSecretVersionName + * A fully-qualified path representing project_location_secret_secret_version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecretSecretVersionName( + projectLocationSecretSecretVersionName: string + ) { + return this.pathTemplates.projectLocationSecretSecretVersionPathTemplate.match( + projectLocationSecretSecretVersionName + ).location; + } + + /** + * Parse the secret from ProjectLocationSecretSecretVersion resource. + * + * @param {string} projectLocationSecretSecretVersionName + * A fully-qualified path representing project_location_secret_secret_version resource. + * @returns {string} A string representing the secret. + */ + matchSecretFromProjectLocationSecretSecretVersionName( + projectLocationSecretSecretVersionName: string + ) { + return this.pathTemplates.projectLocationSecretSecretVersionPathTemplate.match( + projectLocationSecretSecretVersionName + ).secret; + } + + /** + * Parse the secret_version from ProjectLocationSecretSecretVersion resource. + * + * @param {string} projectLocationSecretSecretVersionName + * A fully-qualified path representing project_location_secret_secret_version resource. + * @returns {string} A string representing the secret_version. + */ + matchSecretVersionFromProjectLocationSecretSecretVersionName( + projectLocationSecretSecretVersionName: string + ) { + return this.pathTemplates.projectLocationSecretSecretVersionPathTemplate.match( + projectLocationSecretSecretVersionName + ).secret_version; + } + + /** + * Return a fully-qualified projectSecret resource name string. + * + * @param {string} project + * @param {string} secret + * @returns {string} Resource name string. + */ + projectSecretPath(project: string, secret: string) { + return this.pathTemplates.projectSecretPathTemplate.render({ + project: project, + secret: secret, + }); + } + + /** + * Parse the project from ProjectSecret resource. + * + * @param {string} projectSecretName + * A fully-qualified path representing project_secret resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSecretName(projectSecretName: string) { + return this.pathTemplates.projectSecretPathTemplate.match(projectSecretName) + .project; + } + + /** + * Parse the secret from ProjectSecret resource. + * + * @param {string} projectSecretName + * A fully-qualified path representing project_secret resource. + * @returns {string} A string representing the secret. + */ + matchSecretFromProjectSecretName(projectSecretName: string) { + return this.pathTemplates.projectSecretPathTemplate.match(projectSecretName) + .secret; + } + + /** + * Return a fully-qualified projectSecretSecretVersion resource name string. + * + * @param {string} project + * @param {string} secret + * @param {string} secret_version + * @returns {string} Resource name string. + */ + projectSecretSecretVersionPath( + project: string, + secret: string, + secretVersion: string + ) { + return this.pathTemplates.projectSecretSecretVersionPathTemplate.render({ + project: project, + secret: secret, + secret_version: secretVersion, + }); + } + + /** + * Parse the project from ProjectSecretSecretVersion resource. + * + * @param {string} projectSecretSecretVersionName + * A fully-qualified path representing project_secret_secret_version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSecretSecretVersionName( + projectSecretSecretVersionName: string + ) { + return this.pathTemplates.projectSecretSecretVersionPathTemplate.match( + projectSecretSecretVersionName + ).project; + } + + /** + * Parse the secret from ProjectSecretSecretVersion resource. + * + * @param {string} projectSecretSecretVersionName + * A fully-qualified path representing project_secret_secret_version resource. + * @returns {string} A string representing the secret. + */ + matchSecretFromProjectSecretSecretVersionName( + projectSecretSecretVersionName: string + ) { + return this.pathTemplates.projectSecretSecretVersionPathTemplate.match( + projectSecretSecretVersionName + ).secret; + } + + /** + * Parse the secret_version from ProjectSecretSecretVersion resource. + * + * @param {string} projectSecretSecretVersionName + * A fully-qualified path representing project_secret_secret_version resource. + * @returns {string} A string representing the secret_version. + */ + matchSecretVersionFromProjectSecretSecretVersionName( + projectSecretSecretVersionName: string + ) { + return this.pathTemplates.projectSecretSecretVersionPathTemplate.match( + projectSecretSecretVersionName + ).secret_version; + } + + /** + * Return a fully-qualified topic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + topicPath(project: string, topic: string) { + return this.pathTemplates.topicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from Topic resource. + * + * @param {string} topicName + * A fully-qualified path representing Topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTopicName(topicName: string) { + return this.pathTemplates.topicPathTemplate.match(topicName).project; + } + + /** + * Parse the topic from Topic resource. + * + * @param {string} topicName + * A fully-qualified path representing Topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromTopicName(topicName: string) { + return this.pathTemplates.topicPathTemplate.match(topicName).topic; + } + + /** + * 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.secretManagerServiceStub && !this._terminated) { + return this.secretManagerServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_client_config.json b/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_client_config.json new file mode 100644 index 00000000000..4f45667d6a5 --- /dev/null +++ b/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_client_config.json @@ -0,0 +1,114 @@ +{ + "interfaces": { + "google.cloud.secretmanager.v1beta2.SecretManagerService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "resource_exhausted_unavailable": [ + "RESOURCE_EXHAUSTED", + "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 + }, + "dd71b8c1d82d51c18ce5ba426d9acc4c44e7746e": { + "initial_retry_delay_millis": 2000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListSecrets": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecret": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddSecretVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSecret": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecret": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSecret": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSecretVersions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSecretVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AccessSecretVersion": { + "timeout_millis": 60000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "dd71b8c1d82d51c18ce5ba426d9acc4c44e7746e" + }, + "DisableSecretVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EnableSecretVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DestroySecretVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_proto_list.json b/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_proto_list.json new file mode 100644 index 00000000000..90178c6d95a --- /dev/null +++ b/packages/google-cloud-secretmanager/src/v1beta2/secret_manager_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/secretmanager/v1beta2/resources.proto", + "../../protos/google/cloud/secretmanager/v1beta2/service.proto" +] diff --git a/packages/google-cloud-secretmanager/test/gapic_secret_manager_service_v1.ts b/packages/google-cloud-secretmanager/test/gapic_secret_manager_service_v1.ts index 2eded744139..b90466a1bad 100644 --- a/packages/google-cloud-secretmanager/test/gapic_secret_manager_service_v1.ts +++ b/packages/google-cloud-secretmanager/test/gapic_secret_manager_service_v1.ts @@ -2217,9 +2217,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecrets.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); @@ -2269,9 +2269,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecrets.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); @@ -2319,9 +2319,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecrets.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); @@ -2362,9 +2362,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecrets.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); }); @@ -2557,9 +2557,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecretVersions.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); @@ -2608,9 +2608,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecretVersions.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); @@ -2659,9 +2659,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecretVersions.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); @@ -2701,9 +2701,9 @@ describe('v1.SecretManagerServiceClient', () => { assert( (client.descriptors.page.listSecretVersions.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); }); diff --git a/packages/google-cloud-secretmanager/test/gapic_secret_manager_service_v1beta2.ts b/packages/google-cloud-secretmanager/test/gapic_secret_manager_service_v1beta2.ts new file mode 100644 index 00000000000..4ae504d2b87 --- /dev/null +++ b/packages/google-cloud-secretmanager/test/gapic_secret_manager_service_v1beta2.ts @@ -0,0 +1,3325 @@ +// 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 secretmanagerserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LocationProtos} 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('v1beta2.SecretManagerServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'secretmanager.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process !== 'undefined' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + secretmanagerserviceModule.v1beta2.SecretManagerServiceClient + .servicePath; + assert.strictEqual(servicePath, 'secretmanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + secretmanagerserviceModule.v1beta2.SecretManagerServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'secretmanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'secretmanager.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'secretmanager.example.com'); + }); + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + secretmanagerserviceModule.v1beta2.SecretManagerServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.secretManagerServiceStub, undefined); + await client.initialize(); + assert(client.secretManagerServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.secretManagerServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.secretManagerServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + 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 secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + 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('createSecret', () => { + it('invokes createSecret without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.CreateSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.CreateSecretRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ); + client.innerApiCalls.createSecret = stubSimpleCall(expectedResponse); + const [response] = await client.createSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecret without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.CreateSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.CreateSecretRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ); + client.innerApiCalls.createSecret = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecret( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecret | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecret with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.CreateSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.CreateSecretRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecret = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createSecret(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecret with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.CreateSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.CreateSecretRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSecret(request), expectedError); + }); + }); + + describe('addSecretVersion', () => { + it('invokes addSecretVersion without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.addSecretVersion = stubSimpleCall(expectedResponse); + const [response] = await client.addSecretVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addSecretVersion without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.addSecretVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addSecretVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecretVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addSecretVersion with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addSecretVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addSecretVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.addSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addSecretVersion with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addSecretVersion(request), expectedError); + }); + }); + + describe('getSecret', () => { + it('invokes getSecret without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ); + client.innerApiCalls.getSecret = stubSimpleCall(expectedResponse); + const [response] = await client.getSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecret without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ); + client.innerApiCalls.getSecret = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSecret( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecret | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecret with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSecret(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecret with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSecret(request), expectedError); + }); + }); + + describe('updateSecret', () => { + it('invokes updateSecret without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.UpdateSecretRequest() + ); + request.secret ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.UpdateSecretRequest', + ['secret', 'name'] + ); + request.secret.name = defaultValue1; + const expectedHeaderRequestParams = `secret.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ); + client.innerApiCalls.updateSecret = stubSimpleCall(expectedResponse); + const [response] = await client.updateSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecret without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.UpdateSecretRequest() + ); + request.secret ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.UpdateSecretRequest', + ['secret', 'name'] + ); + request.secret.name = defaultValue1; + const expectedHeaderRequestParams = `secret.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ); + client.innerApiCalls.updateSecret = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecret( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecret | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecret with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.UpdateSecretRequest() + ); + request.secret ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.UpdateSecretRequest', + ['secret', 'name'] + ); + request.secret.name = defaultValue1; + const expectedHeaderRequestParams = `secret.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecret = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSecret(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecret with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.UpdateSecretRequest() + ); + request.secret ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.UpdateSecretRequest', + ['secret', 'name'] + ); + request.secret.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSecret(request), expectedError); + }); + }); + + describe('deleteSecret', () => { + it('invokes deleteSecret without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DeleteSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DeleteSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSecret = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecret without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DeleteSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DeleteSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSecret = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSecret( + 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.deleteSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecret with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DeleteSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DeleteSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecret = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSecret(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSecret as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecret as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecret with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DeleteSecretRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DeleteSecretRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSecret(request), expectedError); + }); + }); + + describe('getSecretVersion', () => { + it('invokes getSecretVersion without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.getSecretVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getSecretVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecretVersion without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.getSecretVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSecretVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecretVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecretVersion with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecretVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSecretVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecretVersion with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSecretVersion(request), expectedError); + }); + }); + + describe('accessSecretVersion', () => { + it('invokes accessSecretVersion without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse() + ); + client.innerApiCalls.accessSecretVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.accessSecretVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.accessSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.accessSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes accessSecretVersion without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse() + ); + client.innerApiCalls.accessSecretVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.accessSecretVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.IAccessSecretVersionResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.accessSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.accessSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes accessSecretVersion with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.accessSecretVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.accessSecretVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.accessSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.accessSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes accessSecretVersion with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.accessSecretVersion(request), expectedError); + }); + }); + + describe('disableSecretVersion', () => { + it('invokes disableSecretVersion without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.disableSecretVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.disableSecretVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disableSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableSecretVersion without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.disableSecretVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableSecretVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecretVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disableSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableSecretVersion with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableSecretVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.disableSecretVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.disableSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableSecretVersion with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.disableSecretVersion(request), expectedError); + }); + }); + + describe('enableSecretVersion', () => { + it('invokes enableSecretVersion without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.enableSecretVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.enableSecretVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enableSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableSecretVersion without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.enableSecretVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableSecretVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecretVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enableSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableSecretVersion with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableSecretVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.enableSecretVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.enableSecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableSecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableSecretVersion with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.enableSecretVersion(request), expectedError); + }); + }); + + describe('destroySecretVersion', () => { + it('invokes destroySecretVersion without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.destroySecretVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.destroySecretVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.destroySecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.destroySecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes destroySecretVersion without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ); + client.innerApiCalls.destroySecretVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.destroySecretVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecretVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.destroySecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.destroySecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes destroySecretVersion with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.destroySecretVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.destroySecretVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.destroySecretVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.destroySecretVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes destroySecretVersion with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.destroySecretVersion(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('listSecrets', () => { + it('invokes listSecrets without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + ]; + client.innerApiCalls.listSecrets = stubSimpleCall(expectedResponse); + const [response] = await client.listSecrets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecrets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecrets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecrets without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + ]; + client.innerApiCalls.listSecrets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSecrets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.secretmanager.v1beta2.ISecret[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecrets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecrets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecrets with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecrets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSecrets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSecrets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecrets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecretsStream without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + ]; + client.descriptors.page.listSecrets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSecretsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.secretmanager.v1beta2.Secret[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.secretmanager.v1beta2.Secret) => { + 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.listSecrets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecrets, request) + ); + assert( + (client.descriptors.page.listSecrets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listSecretsStream with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecrets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSecretsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.secretmanager.v1beta2.Secret[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.secretmanager.v1beta2.Secret) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSecrets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecrets, request) + ); + assert( + (client.descriptors.page.listSecrets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listSecrets without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.Secret() + ), + ]; + client.descriptors.page.listSecrets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.secretmanager.v1beta2.ISecret[] = []; + const iterable = client.listSecretsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSecrets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSecrets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listSecrets with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecrets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSecretsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.secretmanager.v1beta2.ISecret[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSecrets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSecrets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listSecretVersions', () => { + it('invokes listSecretVersions without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + ]; + client.innerApiCalls.listSecretVersions = + stubSimpleCall(expectedResponse); + const [response] = await client.listSecretVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecretVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecretVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecretVersions without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + ]; + client.innerApiCalls.listSecretVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSecretVersions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.secretmanager.v1beta2.ISecretVersion[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecretVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecretVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecretVersions with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecretVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSecretVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSecretVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecretVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecretVersionsStream without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + ]; + client.descriptors.page.listSecretVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSecretVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.secretmanager.v1beta2.SecretVersion[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.secretmanager.v1beta2.SecretVersion + ) => { + 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.listSecretVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecretVersions, request) + ); + assert( + (client.descriptors.page.listSecretVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listSecretVersionsStream with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecretVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSecretVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.secretmanager.v1beta2.SecretVersion[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.secretmanager.v1beta2.SecretVersion + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSecretVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecretVersions, request) + ); + assert( + (client.descriptors.page.listSecretVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listSecretVersions without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.SecretVersion() + ), + ]; + client.descriptors.page.listSecretVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.secretmanager.v1beta2.ISecretVersion[] = + []; + const iterable = client.listSecretVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSecretVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSecretVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listSecretVersions with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecretVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSecretVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.secretmanager.v1beta2.ISecretVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSecretVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSecretVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + 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('projectLocationSecret', () => { + const fakePath = '/rendered/path/projectLocationSecret'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + secret: 'secretValue', + }; + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationSecretPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationSecretPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationSecretPath', () => { + const result = client.projectLocationSecretPath( + 'projectValue', + 'locationValue', + 'secretValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationSecretPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationSecretName', () => { + const result = + client.matchProjectFromProjectLocationSecretName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationSecretPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationSecretName', () => { + const result = + client.matchLocationFromProjectLocationSecretName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationSecretPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretFromProjectLocationSecretName', () => { + const result = + client.matchSecretFromProjectLocationSecretName(fakePath); + assert.strictEqual(result, 'secretValue'); + assert( + ( + client.pathTemplates.projectLocationSecretPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationSecretSecretVersion', () => { + const fakePath = '/rendered/path/projectLocationSecretSecretVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + secret: 'secretValue', + secret_version: 'secretVersionValue', + }; + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationSecretSecretVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecretSecretVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecretSecretVersionPath', () => { + const result = client.projectLocationSecretSecretVersionPath( + 'projectValue', + 'locationValue', + 'secretValue', + 'secretVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationSecretSecretVersionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationSecretSecretVersionName', () => { + const result = + client.matchProjectFromProjectLocationSecretSecretVersionName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationSecretSecretVersionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationSecretSecretVersionName', () => { + const result = + client.matchLocationFromProjectLocationSecretSecretVersionName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationSecretSecretVersionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretFromProjectLocationSecretSecretVersionName', () => { + const result = + client.matchSecretFromProjectLocationSecretSecretVersionName( + fakePath + ); + assert.strictEqual(result, 'secretValue'); + assert( + ( + client.pathTemplates.projectLocationSecretSecretVersionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretVersionFromProjectLocationSecretSecretVersionName', () => { + const result = + client.matchSecretVersionFromProjectLocationSecretSecretVersionName( + fakePath + ); + assert.strictEqual(result, 'secretVersionValue'); + assert( + ( + client.pathTemplates.projectLocationSecretSecretVersionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSecret', () => { + const fakePath = '/rendered/path/projectSecret'; + const expectedParameters = { + project: 'projectValue', + secret: 'secretValue', + }; + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSecretPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSecretPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSecretPath', () => { + const result = client.projectSecretPath('projectValue', 'secretValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSecretPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSecretName', () => { + const result = client.matchProjectFromProjectSecretName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSecretPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretFromProjectSecretName', () => { + const result = client.matchSecretFromProjectSecretName(fakePath); + assert.strictEqual(result, 'secretValue'); + assert( + (client.pathTemplates.projectSecretPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSecretSecretVersion', () => { + const fakePath = '/rendered/path/projectSecretSecretVersion'; + const expectedParameters = { + project: 'projectValue', + secret: 'secretValue', + secret_version: 'secretVersionValue', + }; + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSecretSecretVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSecretSecretVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSecretSecretVersionPath', () => { + const result = client.projectSecretSecretVersionPath( + 'projectValue', + 'secretValue', + 'secretVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSecretSecretVersionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSecretSecretVersionName', () => { + const result = + client.matchProjectFromProjectSecretSecretVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSecretSecretVersionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretFromProjectSecretSecretVersionName', () => { + const result = + client.matchSecretFromProjectSecretSecretVersionName(fakePath); + assert.strictEqual(result, 'secretValue'); + assert( + ( + client.pathTemplates.projectSecretSecretVersionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretVersionFromProjectSecretSecretVersionName', () => { + const result = + client.matchSecretVersionFromProjectSecretSecretVersionName(fakePath); + assert.strictEqual(result, 'secretVersionValue'); + assert( + ( + client.pathTemplates.projectSecretSecretVersionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('topic', () => { + const fakePath = '/rendered/path/topic'; + const expectedParameters = { + project: 'projectValue', + topic: 'topicValue', + }; + const client = + new secretmanagerserviceModule.v1beta2.SecretManagerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.topicPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.topicPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('topicPath', () => { + const result = client.topicPath('projectValue', 'topicValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.topicPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTopicName', () => { + const result = client.matchProjectFromTopicName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.topicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTopicFromTopicName', () => { + const result = client.matchTopicFromTopicName(fakePath); + assert.strictEqual(result, 'topicValue'); + assert( + (client.pathTemplates.topicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +});