google-cloud-secret_manager 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b0e24aa6a40071285c85b3ad924dc4944c8f312662ddb7450fa03131c2c6727
4
- data.tar.gz: 3651786b9db5a35d5e3011e5879cd257ee88c94d2ef81db5146648b4d701bc72
3
+ metadata.gz: 8373f4a03484cf4a9d31a7850441cda4966dea4b5893ca6b1b340b1f138b5e3b
4
+ data.tar.gz: e076631abe13ec64f62cf5265de6adec1c004fa0d73603a5d47700fded83787d
5
5
  SHA512:
6
- metadata.gz: 847af64fb43ca5453aa9539b1c5c16946af1f00aa87c5e40777c322ce53a5451b447b41ac2ec11082863fe9b133421e365011f2ea82a193026f029a26f43d4d9
7
- data.tar.gz: 162d6a7cfc91b609654770ca681251e1f500adfc1bf6f782fa27a7214de81d49fbb9072b1df615f30f0a49c30a8883471b2c744b2ae4ddbc63764dc23c00e5e3
6
+ metadata.gz: 9bac30126f4ca90133f635333cc45def7eff75abf59b6b7b8db5b3acc8fa316022e008a525e6eb5da5a37fd72b30e17fdc101ffa80fc40612817096654daad96
7
+ data.tar.gz: 4ba82c18d647532a63deb514cc4909ca36087d7e34a1c5bb971b9bef7cad8504649f9a5d6ef463916eb55b099165ee27b07bca25e7086245ed602aab6c3382c5
data/AUTHENTICATION.md CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
56
56
  ```ruby
57
57
  require "google/cloud/secret_manager"
58
58
 
59
- client = Google::Cloud::SecretManager.secret_manager_service do |config|
59
+ client = Google::Cloud::SecretManager.secret_operations_service do |config|
60
60
  config.credentials = "path/to/credentialfile.json"
61
61
  end
62
62
  ```
@@ -70,7 +70,7 @@ Google::Cloud::SecretManager.configure do |config|
70
70
  config.credentials = "path/to/credentialfile.json"
71
71
  end
72
72
 
73
- client = Google::Cloud::SecretManager.secret_manager_service
73
+ client = Google::Cloud::SecretManager.secret_operations_service
74
74
  ```
75
75
 
76
76
  ### Environment Variables
@@ -100,7 +100,7 @@ require "google/cloud/secret_manager"
100
100
 
101
101
  ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
102
102
 
103
- client = Google::Cloud::SecretManager.secret_manager_service
103
+ client = Google::Cloud::SecretManager.secret_operations_service
104
104
  ```
105
105
 
106
106
  ### Local ADC file
data/README.md CHANGED
@@ -36,9 +36,9 @@ In order to use this library, you first need to go through the following steps:
36
36
  ```ruby
37
37
  require "google/cloud/secret_manager"
38
38
 
39
- client = Google::Cloud::SecretManager.secret_manager_service
40
- request = ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new # (request fields as keyword arguments...)
41
- response = client.list_secrets request
39
+ client = Google::Cloud::SecretManager.secret_operations_service
40
+ request = ::Google::Cloud::SecretManager::V1::ListBackupsRequest.new # (request fields as keyword arguments...)
41
+ response = client.list_backups request
42
42
  ```
43
43
 
44
44
  ## Debug Logging
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module SecretManager
19
- VERSION = "3.0.0".freeze
19
+ VERSION = "3.1.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -45,6 +45,84 @@ end
45
45
  module Google
46
46
  module Cloud
47
47
  module SecretManager
48
+ ##
49
+ # Create a new client object for SecretOperationsService.
50
+ #
51
+ # By default, this returns an instance of
52
+ # [Google::Cloud::SecretManager::V1::SecretOperationsService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-SecretOperationsService-Client)
53
+ # for a gRPC client for version V1 of the API.
54
+ # However, you can specify a different API version by passing it in the
55
+ # `version` parameter. If the SecretOperationsService service is
56
+ # supported by that API version, and the corresponding gem is available, the
57
+ # appropriate versioned client will be returned.
58
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
59
+ # the `transport` parameter.
60
+ #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the SecretOperationsService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::SecretManager.secret_operations_service_available?}.
65
+ #
66
+ # ## About SecretOperationsService
67
+ #
68
+ # Secret Operations Service
69
+ #
70
+ # Manages backups of secrets. Implements a REST model with the following
71
+ # objects:
72
+ #
73
+ # * Backup
74
+ #
75
+ # Note: `SecretOperationsService` is a regional service and must be called
76
+ # using regional endpoints (`secretmanager.{location}.rep.googleapis.com`).
77
+ #
78
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
79
+ # Defaults to `:v1`.
80
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
81
+ # @return [::Object] A client object for the specified version.
82
+ #
83
+ def self.secret_operations_service version: :v1, transport: :grpc, &block
84
+ require "google/cloud/secret_manager/#{version.to_s.downcase}"
85
+
86
+ package_name = Google::Cloud::SecretManager
87
+ .constants
88
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
89
+ .first
90
+ service_module = Google::Cloud::SecretManager.const_get(package_name).const_get(:SecretOperationsService)
91
+ service_module = service_module.const_get(:Rest) if transport == :rest
92
+ service_module.const_get(:Client).new(&block)
93
+ end
94
+
95
+ ##
96
+ # Determines whether the SecretOperationsService service is supported by the current client.
97
+ # If true, you can retrieve a client object by calling {Google::Cloud::SecretManager.secret_operations_service}.
98
+ # If false, that method will raise an exception. This could happen if the given
99
+ # API version does not exist or does not support the SecretOperationsService service,
100
+ # or if the versioned client gem needs an update to support the SecretOperationsService service.
101
+ #
102
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
103
+ # Defaults to `:v1`.
104
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
105
+ # @return [boolean] Whether the service is available.
106
+ #
107
+ def self.secret_operations_service_available? version: :v1, transport: :grpc
108
+ require "google/cloud/secret_manager/#{version.to_s.downcase}"
109
+ package_name = Google::Cloud::SecretManager
110
+ .constants
111
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
112
+ .first
113
+ return false unless package_name
114
+ service_module = Google::Cloud::SecretManager.const_get package_name
115
+ return false unless service_module.const_defined? :SecretOperationsService
116
+ service_module = service_module.const_get :SecretOperationsService
117
+ if transport == :rest
118
+ return false unless service_module.const_defined? :Rest
119
+ service_module = service_module.const_get :Rest
120
+ end
121
+ service_module.const_defined? :Client
122
+ rescue ::LoadError
123
+ false
124
+ end
125
+
48
126
  ##
49
127
  # Create a new client object for SecretManagerService.
50
128
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-secret_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC