Module: Google::Cloud::SecretManager::V1::SecretManagerService::Paths
- Extended by:
- Paths
- Defined in:
- lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb
Overview
Path helper methods for the SecretManagerService API.
Instance Method Summary collapse
-
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
-
#secret_path(project:, secret:) ⇒ ::String
Create a fully-qualified Secret resource string.
-
#secret_version_path(project:, secret:, secret_version:) ⇒ ::String
Create a fully-qualified SecretVersion resource string.
Instance Method Details
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
The resource will be in the following format:
projects/{project}
37 38 39 |
# File 'lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb', line 37 def project_path project: "projects/#{project}" end |
#secret_path(project:, secret:) ⇒ ::String
Create a fully-qualified Secret resource string.
The resource will be in the following format:
projects/{project}/secrets/{secret}
52 53 54 55 56 |
# File 'lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb', line 52 def secret_path project:, secret: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/secrets/#{secret}" end |
#secret_version_path(project:, secret:, secret_version:) ⇒ ::String
Create a fully-qualified SecretVersion resource string.
The resource will be in the following format:
projects/{project}/secrets/{secret}/versions/{secret_version}
70 71 72 73 74 75 |
# File 'lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb', line 70 def secret_version_path project:, secret:, secret_version: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" end |