# Secret Manager V1BETA2 API - Class Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client (v0.8.0)

0.8.0 (latest) 0.7.1 0.6.0 0.5.1 0.4.0 0.3.1 0.2.0 0.1.1 Reference documentation and code samples for the Secret Manager V1BETA2 API class Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.

REST client for the SecretManagerService service.

Secret Manager Service

Manages secrets and operations using those secrets. Implements a REST
model with the following objects:

- [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)")
- [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)")

## Inherits

- Object

## Includes

- [Google::Cloud::SecretManager::V1beta2::SecretManagerService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the SecretManagerService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client-Configuration "Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all SecretManagerService clients
::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #access_secret_version

    def access_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse
    def access_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse

Accesses a
[SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)"). This
call returns the secret data.


<br />

`projects//secrets//versions/latest` is an alias to the most recently
created [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").
**Overloads**

    def access_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse

Pass arguments to `access_secret_version` via a request object, either of type [AccessSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-AccessSecretVersionRequest "Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-AccessSecretVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def access_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse

Pass arguments to `access_secret_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-AccessSecretVersionResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-AccessSecretVersionResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new

# Call the access_secret_version method.
result = client.access_secret_version request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.
p result
```

### #add_secret_version

    def add_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion
    def add_secret_version(parent: nil, payload: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Creates a new
[SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)")
containing secret data and attaches it to an existing
[Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)").
**Overloads**

    def add_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `add_secret_version` via a request object, either of type [AddSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-AddSecretVersionRequest "Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-AddSecretVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def add_secret_version(parent: nil, payload: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `add_secret_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The resource name of the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") to associate with the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
- **payload** ([::Google::Cloud::SecretManager::V1beta2::SecretPayload](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretPayload), ::Hash) --- Required. The secret payload of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new

# Call the add_secret_version method.
result = client.add_secret_version request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the SecretManagerService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client#Google__Cloud__SecretManager__V1beta2__SecretManagerService__Rest__Client_configure_class_ "Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client-Configuration "Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client-Configuration))

### #create_secret

    def create_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret
    def create_secret(parent: nil, secret_id: nil, secret: nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Creates a new [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)")
containing no
[SecretVersions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").
**Overloads**

    def create_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Pass arguments to `create_secret` via a request object, either of type [CreateSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-CreateSecretRequest "Google::Cloud::SecretManager::V1beta2::CreateSecretRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-CreateSecretRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_secret(parent: nil, secret_id: nil, secret: nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Pass arguments to `create_secret` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The resource name of the project to associate with the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)"), in the format `projects/*` or `projects/*/locations/*`.
- **secret_id** (::String) --- 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.
- **secret** ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret), ::Hash) --- Required. A [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") with initial field values.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new

# Call the create_secret method.
result = client.create_secret request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret.
p result
```

### #delete_secret

    def delete_secret(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_secret(name: nil, etag: nil) -> ::Google::Protobuf::Empty

Deletes a [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)").
**Overloads**

    def delete_secret(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_secret` via a request object, either of type [DeleteSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-DeleteSecretRequest "Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-DeleteSecretRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_secret(name: nil, etag: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_secret` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") to delete in the format `projects/*/secrets/*`.
- **etag** (::String) --- Optional. Etag of the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)"). The request succeeds if it matches the etag of the currently stored secret object. If the etag is omitted, the request succeeds.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new

# Call the delete_secret method.
result = client.delete_secret request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #destroy_secret_version

    def destroy_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion
    def destroy_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Destroys a
[SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").


<br />

Sets the [state](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion#Google__Cloud__SecretManager__V1beta2__SecretVersion_state_instance_ "Google::Cloud::SecretManager::V1beta2::SecretVersion#state (method)") of
the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") to
[DESTROYED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion-State#Google__Cloud__SecretManager__V1beta2__SecretVersion__State__DESTROYED "Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED (constant)")
and irrevocably destroys the secret data.
**Overloads**

    def destroy_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `destroy_secret_version` via a request object, either of type [DestroySecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-DestroySecretVersionRequest "Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-DestroySecretVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def destroy_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `destroy_secret_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") to destroy in the format `projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/*`.
- **etag** (::String) --- Optional. Etag of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)"). The request succeeds if it matches the etag of the currently stored secret version object. If the etag is omitted, the request succeeds.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new

# Call the destroy_secret_version method.
result = client.destroy_secret_version request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
p result
```

### #disable_secret_version

    def disable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion
    def disable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Disables a
[SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").


<br />

Sets the [state](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion#Google__Cloud__SecretManager__V1beta2__SecretVersion_state_instance_ "Google::Cloud::SecretManager::V1beta2::SecretVersion#state (method)") of
the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") to
[DISABLED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion-State#Google__Cloud__SecretManager__V1beta2__SecretVersion__State__DISABLED "Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DISABLED (constant)").
**Overloads**

    def disable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `disable_secret_version` via a request object, either of type [DisableSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-DisableSecretVersionRequest "Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-DisableSecretVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def disable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `disable_secret_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") to disable in the format `projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/*`.
- **etag** (::String) --- Optional. Etag of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)"). The request succeeds if it matches the etag of the currently stored secret version object. If the etag is omitted, the request succeeds.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new

# Call the disable_secret_version method.
result = client.disable_secret_version request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
p result
```

### #enable_secret_version

    def enable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion
    def enable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Enables a
[SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").


<br />

Sets the [state](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion#Google__Cloud__SecretManager__V1beta2__SecretVersion_state_instance_ "Google::Cloud::SecretManager::V1beta2::SecretVersion#state (method)") of
the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") to
[ENABLED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion-State#Google__Cloud__SecretManager__V1beta2__SecretVersion__State__ENABLED "Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED (constant)").
**Overloads**

    def enable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `enable_secret_version` via a request object, either of type [EnableSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-EnableSecretVersionRequest "Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-EnableSecretVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def enable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `enable_secret_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") to enable in the format `projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/*`.
- **etag** (::String) --- Optional. Etag of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)"). The request succeeds if it matches the etag of the currently stored secret version object. If the etag is omitted, the request succeeds.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new

# Call the enable_secret_version method.
result = client.enable_secret_version request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
p result
```

### #get_iam_policy

    def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
    def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy

Gets the access control policy for a secret.
Returns empty policy if the secret exists and does not have a policy set.
**Overloads**

    def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy

Pass arguments to `get_iam_policy` via a request object, either of type [Iam::V1::GetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-GetIamPolicyRequest "Google::Iam::V1::GetIamPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Iam::V1::GetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-GetIamPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy

Pass arguments to `get_iam_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **resource** (::String) --- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
- **options** ([::Google::Iam::V1::GetPolicyOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-GetPolicyOptions), ::Hash) --- OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-Policy))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-Policy))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result
```

### #get_secret

    def get_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret
    def get_secret(name: nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Gets metadata for a given
[Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)").
**Overloads**

    def get_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Pass arguments to `get_secret` via a request object, either of type [GetSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-GetSecretRequest "Google::Cloud::SecretManager::V1beta2::GetSecretRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::GetSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-GetSecretRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_secret(name: nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Pass arguments to `get_secret` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)"), in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new

# Call the get_secret method.
result = client.get_secret request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret.
p result
```

### #get_secret_version

    def get_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion
    def get_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Gets metadata for a
[SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").


<br />

`projects//secrets//versions/latest` is an alias to the most recently
created [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").
**Overloads**

    def get_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `get_secret_version` via a request object, either of type [GetSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-GetSecretVersionRequest "Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-GetSecretVersionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1beta2::SecretVersion

Pass arguments to `get_secret_version` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the [SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new

# Call the get_secret_version method.
result = client.get_secret_version request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new SecretManagerService REST client object.
**Yields**

- (config) --- Configure the SecretManagerService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretManagerService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_secret_versions

    def list_secret_versions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>
    def list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>

Lists [SecretVersions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)").
This call does not return secret data.
**Overloads**

    def list_secret_versions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>

Pass arguments to `list_secret_versions` via a request object, either of type [ListSecretVersionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-ListSecretVersionsRequest "Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-ListSecretVersionsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>

Pass arguments to `list_secret_versions` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The resource name of the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") associated with the [SecretVersions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") to list, in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
- **page_size** (::Integer) --- 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.
- **page_token** (::String) --- Optional. Pagination token, returned earlier via ListSecretVersionsResponse.next_page_token\]\[\].
- **filter** (::String) --- 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.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::SecretManager::V1beta2::SecretVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new

# Call the list_secret_versions method.
result = client.list_secret_versions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion.
  p item
end
```

### #list_secrets

    def list_secrets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>
    def list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>

Lists [Secrets](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)").
**Overloads**

    def list_secrets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>

Pass arguments to `list_secrets` via a request object, either of type [ListSecretsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-ListSecretsRequest "Google::Cloud::SecretManager::V1beta2::ListSecretsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-ListSecretsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>

Pass arguments to `list_secrets` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The resource name of the project associated with the [Secrets](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)"), in the format `projects/*` or `projects/*/locations/*`
- **page_size** (::Integer) --- 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.
- **page_token** (::String) --- Optional. Pagination token, returned earlier via [ListSecretsResponse.next_page_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-ListSecretsResponse#Google__Cloud__SecretManager__V1beta2__ListSecretsResponse_next_page_token_instance_ "Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token (method)").
- **filter** (::String) --- 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.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new

# Call the list_secrets method.
result = client.list_secrets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #set_iam_policy

    def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
    def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy

Sets the access control policy on the specified secret. Replaces any
existing policy.


<br />

Permissions on
[SecretVersions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-SecretVersion "Google::Cloud::SecretManager::V1beta2::SecretVersion (class)") are
enforced according to the policy set on the associated
[Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)").
**Overloads**

    def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy

Pass arguments to `set_iam_policy` via a request object, either of type [Iam::V1::SetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-SetIamPolicyRequest "Google::Iam::V1::SetIamPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Iam::V1::SetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-SetIamPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy

Pass arguments to `set_iam_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **resource** (::String) --- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
- **policy** ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-Policy), ::Hash) --- 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.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Protobuf-FieldMask), ::Hash) --- 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"`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-Policy))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-Policy))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result
```

### #test_iam_permissions

    def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
    def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

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.


<br />

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.
**Overloads**

    def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

Pass arguments to `test_iam_permissions` via a request object, either of type [Iam::V1::TestIamPermissionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-TestIamPermissionsRequest "Google::Iam::V1::TestIamPermissionsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Iam::V1::TestIamPermissionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-TestIamPermissionsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

Pass arguments to `test_iam_permissions` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **resource** (::String) --- REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
- **permissions** (::Array\<::String\>) --- 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).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Iam::V1::TestIamPermissionsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-TestIamPermissionsResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Iam::V1::TestIamPermissionsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Iam-V1-TestIamPermissionsResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_secret

    def update_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret
    def update_secret(secret: nil, update_mask: nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Updates metadata of an existing
[Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)").
**Overloads**

    def update_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Pass arguments to `update_secret` via a request object, either of type [UpdateSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-UpdateSecretRequest "Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-UpdateSecretRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_secret(secret: nil, update_mask: nil) -> ::Google::Cloud::SecretManager::V1beta2::Secret

Pass arguments to `update_secret` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **secret** ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret), ::Hash) --- Required. [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") with updated field values.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Protobuf-FieldMask), ::Hash) --- Required. Specifies the fields to be updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::SecretManager::V1beta2::Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/secret_manager/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new

# Call the update_secret method.
result = client.update_secret request

# The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret.
p result
```