google-cloud-kms-v1 0.1.0 → 0.2.3
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 +4 -4
- data/AUTHENTICATION.md +6 -6
- data/README.md +5 -1
- data/lib/google/cloud/kms/v1.rb +1 -1
- data/lib/google/cloud/kms/v1/iam_policy.rb +1 -1
- data/lib/google/cloud/kms/v1/iam_policy/client.rb +96 -91
- data/lib/google/cloud/kms/v1/iam_policy/credentials.rb +1 -1
- data/lib/google/cloud/kms/v1/key_management_service.rb +5 -5
- data/lib/google/cloud/kms/v1/key_management_service/client.rb +604 -599
- data/lib/google/cloud/kms/v1/key_management_service/credentials.rb +1 -1
- data/lib/google/cloud/kms/v1/key_management_service/paths.rb +18 -18
- data/lib/google/cloud/kms/v1/service_services_pb.rb +23 -23
- data/lib/google/cloud/kms/v1/version.rb +1 -1
- data/lib/google/iam/v1/iam_policy_services_pb.rb +3 -3
- data/proto_docs/google/api/resource.rb +12 -12
- data/proto_docs/google/cloud/kms/v1/resources.rb +203 -203
- data/proto_docs/google/cloud/kms/v1/service.rb +272 -272
- data/proto_docs/google/iam/v1/iam_policy.rb +15 -15
- data/proto_docs/google/iam/v1/options.rb +3 -3
- data/proto_docs/google/iam/v1/policy.rb +26 -26
- data/proto_docs/google/protobuf/duration.rb +4 -4
- data/proto_docs/google/protobuf/field_mask.rb +3 -3
- data/proto_docs/google/protobuf/timestamp.rb +4 -4
- data/proto_docs/google/type/expr.rb +6 -6
- metadata +35 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9851510a2f38f69ea373f9a9ef0241a24066e27974d39ab758fd7b8a43ac1eb7
|
4
|
+
data.tar.gz: 4e22136425f9ee567c6074478e42ed50034bb8dbabaaf060e046584967c177d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bf2b2956292a674e0b4434c9b59d89b929d026edfa1acc073c2d878f407c0b23fd354bbaff61bc1dd5f6d0f809cb35c2f739708bc323bc457ad12fa5f6e2d32
|
7
|
+
data.tar.gz: 611f3b2eeee8c54b299565feeb9cf2b99d105339051fb36502b022ed8fc8710bba943fe426e73139106d15574e0c98a1de3a2199e18a99dec028f82dd8eb3c62
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export KMS_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/kms/v1"
|
29
29
|
|
30
|
-
client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
30
|
+
client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
31
31
|
```
|
32
32
|
|
33
33
|
## Credential Lookup
|
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
|
|
64
64
|
|
65
65
|
The environment variables that google-cloud-kms-v1
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{Google::Cloud::Kms::V1::KeyManagementService::Credentials}):
|
67
|
+
{::Google::Cloud::Kms::V1::KeyManagementService::Credentials}):
|
68
68
|
|
69
69
|
1. `KMS_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
70
|
2. `KMS_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -77,7 +77,7 @@ require "google/cloud/kms/v1"
|
|
77
77
|
|
78
78
|
ENV["KMS_CREDENTIALS"] = "path/to/keyfile.json"
|
79
79
|
|
80
|
-
client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
80
|
+
client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
81
81
|
```
|
82
82
|
|
83
83
|
### Configuration
|
@@ -88,7 +88,7 @@ environment variables. Either on an individual client initialization:
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/kms/v1"
|
90
90
|
|
91
|
-
client = Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config|
|
91
|
+
client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config|
|
92
92
|
config.credentials = "path/to/keyfile.json"
|
93
93
|
end
|
94
94
|
```
|
@@ -98,11 +98,11 @@ Or configured globally for all clients:
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/kms/v1"
|
100
100
|
|
101
|
-
Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config|
|
101
|
+
::Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config|
|
102
102
|
config.credentials = "path/to/keyfile.json"
|
103
103
|
end
|
104
104
|
|
105
|
-
client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
105
|
+
client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
106
106
|
```
|
107
107
|
|
108
108
|
### Cloud SDK
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
|
|
18
18
|
|
19
19
|
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
20
20
|
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
21
|
+
1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudkms.googleapis.com)
|
21
22
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
22
23
|
|
23
24
|
## Quick Start
|
@@ -25,7 +26,7 @@ In order to use this library, you first need to go through the following steps:
|
|
25
26
|
```ruby
|
26
27
|
require "google/cloud/kms/v1"
|
27
28
|
|
28
|
-
client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
29
|
+
client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
29
30
|
request = my_create_request
|
30
31
|
response = client.list_key_rings request
|
31
32
|
```
|
@@ -33,6 +34,9 @@ response = client.list_key_rings request
|
|
33
34
|
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-kms-v1/latest)
|
34
35
|
for class and method documentation.
|
35
36
|
|
37
|
+
See also the [Product Documentation](https://cloud.google.com/kms)
|
38
|
+
for general usage information.
|
39
|
+
|
36
40
|
## Enabling Logging
|
37
41
|
|
38
42
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
data/lib/google/cloud/kms/v1.rb
CHANGED
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
# To load this package, including all its services, and instantiate a client:
|
28
28
|
#
|
29
29
|
# require "google/cloud/kms/v1"
|
30
|
-
# client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
30
|
+
# client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
31
31
|
#
|
32
32
|
module V1
|
33
33
|
end
|
@@ -59,7 +59,7 @@ module Google
|
|
59
59
|
# To load this service and instantiate a client:
|
60
60
|
#
|
61
61
|
# require "google/cloud/kms/v1/iam_policy"
|
62
|
-
# client = Google::Cloud::Kms::V1::IAMPolicy::Client.new
|
62
|
+
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new
|
63
63
|
#
|
64
64
|
module IAMPolicy
|
65
65
|
end
|
@@ -60,15 +60,15 @@ module Google
|
|
60
60
|
##
|
61
61
|
# Configure the IAMPolicy Client class.
|
62
62
|
#
|
63
|
-
# See {Google::Cloud::Kms::V1::IAMPolicy::Client::Configuration}
|
63
|
+
# See {::Google::Cloud::Kms::V1::IAMPolicy::Client::Configuration}
|
64
64
|
# for a description of the configuration fields.
|
65
65
|
#
|
66
66
|
# ## Example
|
67
67
|
#
|
68
68
|
# To modify the configuration for all IAMPolicy clients:
|
69
69
|
#
|
70
|
-
# Google::Cloud::Kms::V1::IAMPolicy::Client.configure do |config|
|
71
|
-
# config.timeout =
|
70
|
+
# ::Google::Cloud::Kms::V1::IAMPolicy::Client.configure do |config|
|
71
|
+
# config.timeout = 10.0
|
72
72
|
# end
|
73
73
|
#
|
74
74
|
# @yield [config] Configure the Client client.
|
@@ -100,7 +100,7 @@ module Google
|
|
100
100
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
101
101
|
# should be made on {Client.configure}.
|
102
102
|
#
|
103
|
-
# See {Google::Cloud::Kms::V1::IAMPolicy::Client::Configuration}
|
103
|
+
# See {::Google::Cloud::Kms::V1::IAMPolicy::Client::Configuration}
|
104
104
|
# for a description of the configuration fields.
|
105
105
|
#
|
106
106
|
# @yield [config] Configure the Client client.
|
@@ -121,13 +121,13 @@ module Google
|
|
121
121
|
# To create a new IAMPolicy client with the default
|
122
122
|
# configuration:
|
123
123
|
#
|
124
|
-
# client = Google::Cloud::Kms::V1::IAMPolicy::Client.new
|
124
|
+
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new
|
125
125
|
#
|
126
126
|
# To create a new IAMPolicy client with a custom
|
127
127
|
# configuration:
|
128
128
|
#
|
129
|
-
# client = Google::Cloud::Kms::V1::IAMPolicy::Client.new do |config|
|
130
|
-
# config.timeout =
|
129
|
+
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new do |config|
|
130
|
+
# config.timeout = 10.0
|
131
131
|
# end
|
132
132
|
#
|
133
133
|
# @yield [config] Configure the IAMPolicy client.
|
@@ -152,10 +152,11 @@ module Google
|
|
152
152
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
153
153
|
credentials = Credentials.new credentials, scope: @config.scope
|
154
154
|
end
|
155
|
-
@quota_project_id =
|
155
|
+
@quota_project_id = @config.quota_project
|
156
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
156
157
|
|
157
|
-
@iam_policy_stub = Gapic::ServiceStub.new(
|
158
|
-
Google::Iam::V1::IAMPolicy::Stub,
|
158
|
+
@iam_policy_stub = ::Gapic::ServiceStub.new(
|
159
|
+
::Google::Iam::V1::IAMPolicy::Stub,
|
159
160
|
credentials: credentials,
|
160
161
|
endpoint: @config.endpoint,
|
161
162
|
channel_args: @config.channel_args,
|
@@ -171,12 +172,12 @@ module Google
|
|
171
172
|
#
|
172
173
|
# @overload set_iam_policy(request, options = nil)
|
173
174
|
# Pass arguments to `set_iam_policy` via a request object, either of type
|
174
|
-
# {Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
|
175
|
+
# {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
|
175
176
|
#
|
176
|
-
# @param request [Google::Iam::V1::SetIamPolicyRequest, Hash]
|
177
|
+
# @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
|
177
178
|
# A request object representing the call parameters. Required. To specify no
|
178
179
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
179
|
-
# @param options [Gapic::CallOptions, Hash]
|
180
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
180
181
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
181
182
|
#
|
182
183
|
# @overload set_iam_policy(resource: nil, policy: nil)
|
@@ -184,36 +185,36 @@ module Google
|
|
184
185
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
185
186
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
186
187
|
#
|
187
|
-
# @param resource [String]
|
188
|
+
# @param resource [::String]
|
188
189
|
# REQUIRED: The resource for which the policy is being specified.
|
189
190
|
# See the operation documentation for the appropriate value for this field.
|
190
|
-
# @param policy [Google::Iam::V1::Policy, Hash]
|
191
|
+
# @param policy [::Google::Iam::V1::Policy, ::Hash]
|
191
192
|
# REQUIRED: The complete policy to be applied to the `resource`. The size of
|
192
193
|
# the policy is limited to a few 10s of KB. An empty policy is a
|
193
194
|
# valid policy but certain Cloud Platform services (such as Projects)
|
194
195
|
# might reject them.
|
195
196
|
#
|
196
197
|
# @yield [response, operation] Access the result along with the RPC operation
|
197
|
-
# @yieldparam response [Google::Iam::V1::Policy]
|
198
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
198
|
+
# @yieldparam response [::Google::Iam::V1::Policy]
|
199
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
199
200
|
#
|
200
|
-
# @return [Google::Iam::V1::Policy]
|
201
|
+
# @return [::Google::Iam::V1::Policy]
|
201
202
|
#
|
202
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
203
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
203
204
|
#
|
204
205
|
def set_iam_policy request, options = nil
|
205
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
206
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
206
207
|
|
207
|
-
request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::SetIamPolicyRequest
|
208
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
|
208
209
|
|
209
210
|
# Converts hash and nil to an options object
|
210
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
211
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
211
212
|
|
212
213
|
# Customize the options with defaults
|
213
214
|
metadata = @config.rpcs.set_iam_policy.metadata.to_h
|
214
215
|
|
215
216
|
# Set x-goog-api-client and x-goog-user-project headers
|
216
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
217
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
217
218
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
218
219
|
gapic_version: ::Google::Cloud::Kms::V1::VERSION
|
219
220
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -234,8 +235,8 @@ module Google
|
|
234
235
|
yield response, operation if block_given?
|
235
236
|
return response
|
236
237
|
end
|
237
|
-
rescue GRPC::BadStatus => e
|
238
|
-
raise Google::Cloud::Error.from_error(e)
|
238
|
+
rescue ::GRPC::BadStatus => e
|
239
|
+
raise ::Google::Cloud::Error.from_error(e)
|
239
240
|
end
|
240
241
|
|
241
242
|
##
|
@@ -245,12 +246,12 @@ module Google
|
|
245
246
|
#
|
246
247
|
# @overload get_iam_policy(request, options = nil)
|
247
248
|
# Pass arguments to `get_iam_policy` via a request object, either of type
|
248
|
-
# {Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
|
249
|
+
# {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
|
249
250
|
#
|
250
|
-
# @param request [Google::Iam::V1::GetIamPolicyRequest, Hash]
|
251
|
+
# @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
|
251
252
|
# A request object representing the call parameters. Required. To specify no
|
252
253
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
253
|
-
# @param options [Gapic::CallOptions, Hash]
|
254
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
254
255
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
255
256
|
#
|
256
257
|
# @overload get_iam_policy(resource: nil, options: nil)
|
@@ -258,34 +259,34 @@ module Google
|
|
258
259
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
259
260
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
260
261
|
#
|
261
|
-
# @param resource [String]
|
262
|
+
# @param resource [::String]
|
262
263
|
# REQUIRED: The resource for which the policy is being requested.
|
263
264
|
# See the operation documentation for the appropriate value for this field.
|
264
|
-
# @param options [Google::Iam::V1::GetPolicyOptions, Hash]
|
265
|
+
# @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
|
265
266
|
# OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
266
267
|
# `GetIamPolicy`. This field is only used by Cloud IAM.
|
267
268
|
#
|
268
269
|
# @yield [response, operation] Access the result along with the RPC operation
|
269
|
-
# @yieldparam response [Google::Iam::V1::Policy]
|
270
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
270
|
+
# @yieldparam response [::Google::Iam::V1::Policy]
|
271
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
271
272
|
#
|
272
|
-
# @return [Google::Iam::V1::Policy]
|
273
|
+
# @return [::Google::Iam::V1::Policy]
|
273
274
|
#
|
274
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
275
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
275
276
|
#
|
276
277
|
def get_iam_policy request, options = nil
|
277
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
278
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
278
279
|
|
279
|
-
request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::GetIamPolicyRequest
|
280
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
|
280
281
|
|
281
282
|
# Converts hash and nil to an options object
|
282
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
283
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
283
284
|
|
284
285
|
# Customize the options with defaults
|
285
286
|
metadata = @config.rpcs.get_iam_policy.metadata.to_h
|
286
287
|
|
287
288
|
# Set x-goog-api-client and x-goog-user-project headers
|
288
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
289
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
289
290
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
290
291
|
gapic_version: ::Google::Cloud::Kms::V1::VERSION
|
291
292
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -306,8 +307,8 @@ module Google
|
|
306
307
|
yield response, operation if block_given?
|
307
308
|
return response
|
308
309
|
end
|
309
|
-
rescue GRPC::BadStatus => e
|
310
|
-
raise Google::Cloud::Error.from_error(e)
|
310
|
+
rescue ::GRPC::BadStatus => e
|
311
|
+
raise ::Google::Cloud::Error.from_error(e)
|
311
312
|
end
|
312
313
|
|
313
314
|
##
|
@@ -321,12 +322,12 @@ module Google
|
|
321
322
|
#
|
322
323
|
# @overload test_iam_permissions(request, options = nil)
|
323
324
|
# Pass arguments to `test_iam_permissions` via a request object, either of type
|
324
|
-
# {Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
|
325
|
+
# {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
|
325
326
|
#
|
326
|
-
# @param request [Google::Iam::V1::TestIamPermissionsRequest, Hash]
|
327
|
+
# @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
|
327
328
|
# A request object representing the call parameters. Required. To specify no
|
328
329
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
329
|
-
# @param options [Gapic::CallOptions, Hash]
|
330
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
330
331
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
331
332
|
#
|
332
333
|
# @overload test_iam_permissions(resource: nil, permissions: nil)
|
@@ -334,36 +335,36 @@ module Google
|
|
334
335
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
335
336
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
336
337
|
#
|
337
|
-
# @param resource [String]
|
338
|
+
# @param resource [::String]
|
338
339
|
# REQUIRED: The resource for which the policy detail is being requested.
|
339
340
|
# See the operation documentation for the appropriate value for this field.
|
340
|
-
# @param permissions [Array
|
341
|
+
# @param permissions [::Array<::String>]
|
341
342
|
# The set of permissions to check for the `resource`. Permissions with
|
342
343
|
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
343
344
|
# information see
|
344
345
|
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
345
346
|
#
|
346
347
|
# @yield [response, operation] Access the result along with the RPC operation
|
347
|
-
# @yieldparam response [Google::Iam::V1::TestIamPermissionsResponse]
|
348
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
348
|
+
# @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
|
349
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
349
350
|
#
|
350
|
-
# @return [Google::Iam::V1::TestIamPermissionsResponse]
|
351
|
+
# @return [::Google::Iam::V1::TestIamPermissionsResponse]
|
351
352
|
#
|
352
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
353
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
353
354
|
#
|
354
355
|
def test_iam_permissions request, options = nil
|
355
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
356
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
356
357
|
|
357
|
-
request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::TestIamPermissionsRequest
|
358
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
|
358
359
|
|
359
360
|
# Converts hash and nil to an options object
|
360
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
361
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
361
362
|
|
362
363
|
# Customize the options with defaults
|
363
364
|
metadata = @config.rpcs.test_iam_permissions.metadata.to_h
|
364
365
|
|
365
366
|
# Set x-goog-api-client and x-goog-user-project headers
|
366
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
367
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
367
368
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
368
369
|
gapic_version: ::Google::Cloud::Kms::V1::VERSION
|
369
370
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -384,8 +385,8 @@ module Google
|
|
384
385
|
yield response, operation if block_given?
|
385
386
|
return response
|
386
387
|
end
|
387
|
-
rescue GRPC::BadStatus => e
|
388
|
-
raise Google::Cloud::Error.from_error(e)
|
388
|
+
rescue ::GRPC::BadStatus => e
|
389
|
+
raise ::Google::Cloud::Error.from_error(e)
|
389
390
|
end
|
390
391
|
|
391
392
|
##
|
@@ -395,7 +396,7 @@ module Google
|
|
395
396
|
# providing control over timeouts, retry behavior, logging, transport
|
396
397
|
# parameters, and other low-level controls. Certain parameters can also be
|
397
398
|
# applied individually to specific RPCs. See
|
398
|
-
# {Google::Cloud::Kms::V1::IAMPolicy::Client::Configuration::Rpcs}
|
399
|
+
# {::Google::Cloud::Kms::V1::IAMPolicy::Client::Configuration::Rpcs}
|
399
400
|
# for a list of RPCs that can be configured independently.
|
400
401
|
#
|
401
402
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -406,22 +407,22 @@ module Google
|
|
406
407
|
# To modify the global config, setting the timeout for set_iam_policy
|
407
408
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
408
409
|
#
|
409
|
-
# Google::Cloud::Kms::V1::IAMPolicy::Client.configure do |config|
|
410
|
-
# config.timeout =
|
411
|
-
# config.rpcs.set_iam_policy.timeout =
|
410
|
+
# ::Google::Cloud::Kms::V1::IAMPolicy::Client.configure do |config|
|
411
|
+
# config.timeout = 10.0
|
412
|
+
# config.rpcs.set_iam_policy.timeout = 20.0
|
412
413
|
# end
|
413
414
|
#
|
414
415
|
# To apply the above configuration only to a new client:
|
415
416
|
#
|
416
|
-
# client = Google::Cloud::Kms::V1::IAMPolicy::Client.new do |config|
|
417
|
-
# config.timeout =
|
418
|
-
# config.rpcs.set_iam_policy.timeout =
|
417
|
+
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new do |config|
|
418
|
+
# config.timeout = 10.0
|
419
|
+
# config.rpcs.set_iam_policy.timeout = 20.0
|
419
420
|
# end
|
420
421
|
#
|
421
422
|
# @!attribute [rw] endpoint
|
422
423
|
# The hostname or hostname:port of the service endpoint.
|
423
424
|
# Defaults to `"cloudkms.googleapis.com"`.
|
424
|
-
# @return [String]
|
425
|
+
# @return [::String]
|
425
426
|
# @!attribute [rw] credentials
|
426
427
|
# Credentials to send with calls. You may provide any of the following types:
|
427
428
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -433,29 +434,29 @@ module Google
|
|
433
434
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
434
435
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
435
436
|
# * (`nil`) indicating no credentials
|
436
|
-
# @return [Object]
|
437
|
+
# @return [::Object]
|
437
438
|
# @!attribute [rw] scope
|
438
439
|
# The OAuth scopes
|
439
|
-
# @return [Array
|
440
|
+
# @return [::Array<::String>]
|
440
441
|
# @!attribute [rw] lib_name
|
441
442
|
# The library name as recorded in instrumentation and logging
|
442
|
-
# @return [String]
|
443
|
+
# @return [::String]
|
443
444
|
# @!attribute [rw] lib_version
|
444
445
|
# The library version as recorded in instrumentation and logging
|
445
|
-
# @return [String]
|
446
|
+
# @return [::String]
|
446
447
|
# @!attribute [rw] channel_args
|
447
448
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
448
449
|
# `GRPC::Core::Channel` object is provided as the credential.
|
449
|
-
# @return [Hash]
|
450
|
+
# @return [::Hash]
|
450
451
|
# @!attribute [rw] interceptors
|
451
452
|
# An array of interceptors that are run before calls are executed.
|
452
|
-
# @return [Array
|
453
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
453
454
|
# @!attribute [rw] timeout
|
454
|
-
# The call timeout in
|
455
|
-
# @return [Numeric]
|
455
|
+
# The call timeout in seconds.
|
456
|
+
# @return [::Numeric]
|
456
457
|
# @!attribute [rw] metadata
|
457
458
|
# Additional gRPC headers to be sent with the call.
|
458
|
-
# @return [Hash{Symbol
|
459
|
+
# @return [::Hash{::Symbol=>::String}]
|
459
460
|
# @!attribute [rw] retry_policy
|
460
461
|
# The retry policy. The value is a hash with the following keys:
|
461
462
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -463,25 +464,29 @@ module Google
|
|
463
464
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
464
465
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
465
466
|
# trigger a retry.
|
466
|
-
# @return [Hash]
|
467
|
+
# @return [::Hash]
|
468
|
+
# @!attribute [rw] quota_project
|
469
|
+
# A separate project against which to charge quota.
|
470
|
+
# @return [::String]
|
467
471
|
#
|
468
472
|
class Configuration
|
469
|
-
extend Gapic::Config
|
473
|
+
extend ::Gapic::Config
|
470
474
|
|
471
|
-
config_attr :endpoint,
|
472
|
-
config_attr :credentials,
|
475
|
+
config_attr :endpoint, "cloudkms.googleapis.com", ::String
|
476
|
+
config_attr :credentials, nil do |value|
|
473
477
|
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
474
478
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
475
479
|
allowed.any? { |klass| klass === value }
|
476
480
|
end
|
477
|
-
config_attr :scope,
|
478
|
-
config_attr :lib_name,
|
479
|
-
config_attr :lib_version,
|
480
|
-
config_attr(:channel_args,
|
481
|
-
config_attr :interceptors,
|
482
|
-
config_attr :timeout,
|
483
|
-
config_attr :metadata,
|
484
|
-
config_attr :retry_policy,
|
481
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
482
|
+
config_attr :lib_name, nil, ::String, nil
|
483
|
+
config_attr :lib_version, nil, ::String, nil
|
484
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
485
|
+
config_attr :interceptors, nil, ::Array, nil
|
486
|
+
config_attr :timeout, nil, ::Numeric, nil
|
487
|
+
config_attr :metadata, nil, ::Hash, nil
|
488
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
489
|
+
config_attr :quota_project, nil, ::String, nil
|
485
490
|
|
486
491
|
# @private
|
487
492
|
def initialize parent_config = nil
|
@@ -497,7 +502,7 @@ module Google
|
|
497
502
|
def rpcs
|
498
503
|
@rpcs ||= begin
|
499
504
|
parent_rpcs = nil
|
500
|
-
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to?
|
505
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
501
506
|
Rpcs.new parent_rpcs
|
502
507
|
end
|
503
508
|
end
|
@@ -522,28 +527,28 @@ module Google
|
|
522
527
|
class Rpcs
|
523
528
|
##
|
524
529
|
# RPC-specific configuration for `set_iam_policy`
|
525
|
-
# @return [Gapic::Config::Method]
|
530
|
+
# @return [::Gapic::Config::Method]
|
526
531
|
#
|
527
532
|
attr_reader :set_iam_policy
|
528
533
|
##
|
529
534
|
# RPC-specific configuration for `get_iam_policy`
|
530
|
-
# @return [Gapic::Config::Method]
|
535
|
+
# @return [::Gapic::Config::Method]
|
531
536
|
#
|
532
537
|
attr_reader :get_iam_policy
|
533
538
|
##
|
534
539
|
# RPC-specific configuration for `test_iam_permissions`
|
535
|
-
# @return [Gapic::Config::Method]
|
540
|
+
# @return [::Gapic::Config::Method]
|
536
541
|
#
|
537
542
|
attr_reader :test_iam_permissions
|
538
543
|
|
539
544
|
# @private
|
540
545
|
def initialize parent_rpcs = nil
|
541
546
|
set_iam_policy_config = parent_rpcs&.set_iam_policy if parent_rpcs&.respond_to? :set_iam_policy
|
542
|
-
@set_iam_policy = Gapic::Config::Method.new set_iam_policy_config
|
547
|
+
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
543
548
|
get_iam_policy_config = parent_rpcs&.get_iam_policy if parent_rpcs&.respond_to? :get_iam_policy
|
544
|
-
@get_iam_policy = Gapic::Config::Method.new get_iam_policy_config
|
549
|
+
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
545
550
|
test_iam_permissions_config = parent_rpcs&.test_iam_permissions if parent_rpcs&.respond_to? :test_iam_permissions
|
546
|
-
@test_iam_permissions = Gapic::Config::Method.new test_iam_permissions_config
|
551
|
+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
547
552
|
|
548
553
|
yield self if block_given?
|
549
554
|
end
|