google-cloud-redis-cluster-v1 0.4.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -125,14 +125,6 @@ module Google
125
125
  # Lists operations that match the specified filter in the request. If the
126
126
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
127
127
  #
128
- # NOTE: the `name` binding allows API services to override the binding
129
- # to use different resource name schemes, such as `users/*/operations`. To
130
- # override the binding, API services can add a binding such as
131
- # `"/v1/{name=users/*}/operations"` to their service configuration.
132
- # For backwards compatibility, the default name includes the operations
133
- # collection id, however overriding users must ensure the name binding
134
- # is the parent resource, without the operations collection id.
135
- #
136
128
  # @overload list_operations(request, options = nil)
137
129
  # Pass arguments to `list_operations` via a request object, either of type
138
130
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -222,7 +214,7 @@ module Google
222
214
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
223
215
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
224
216
  yield response, operation if block_given?
225
- return response
217
+ throw :response, response
226
218
  end
227
219
  rescue ::GRPC::BadStatus => e
228
220
  raise ::Google::Cloud::Error.from_error(e)
@@ -318,7 +310,7 @@ module Google
318
310
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
319
311
  response = ::Gapic::Operation.new response, @operations_client, options: options
320
312
  yield response, operation if block_given?
321
- return response
313
+ throw :response, response
322
314
  end
323
315
  rescue ::GRPC::BadStatus => e
324
316
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +399,6 @@ module Google
407
399
 
408
400
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
409
401
  yield response, operation if block_given?
410
- return response
411
402
  end
412
403
  rescue ::GRPC::BadStatus => e
413
404
  raise ::Google::Cloud::Error.from_error(e)
@@ -422,8 +413,9 @@ module Google
422
413
  # other methods to check whether the cancellation succeeded or whether the
423
414
  # operation completed despite cancellation. On successful cancellation,
424
415
  # the operation is not deleted; instead, it becomes an operation with
425
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
426
- # corresponding to `Code.CANCELLED`.
416
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
417
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
418
+ # `Code.CANCELLED`.
427
419
  #
428
420
  # @overload cancel_operation(request, options = nil)
429
421
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -502,7 +494,6 @@ module Google
502
494
 
503
495
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
504
496
  yield response, operation if block_given?
505
- return response
506
497
  end
507
498
  rescue ::GRPC::BadStatus => e
508
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +591,7 @@ module Google
600
591
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
601
592
  response = ::Gapic::Operation.new response, @operations_client, options: options
602
593
  yield response, operation if block_given?
603
- return response
594
+ throw :response, response
604
595
  end
605
596
  rescue ::GRPC::BadStatus => e
606
597
  raise ::Google::Cloud::Error.from_error(e)
@@ -650,6 +641,13 @@ module Google
650
641
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
651
642
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
652
643
  # * (`nil`) indicating no credentials
644
+ #
645
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
646
+ # external source for authentication to Google Cloud, you must validate it before
647
+ # providing it to a Google API client library. Providing an unvalidated credential
648
+ # configuration to Google APIs can compromise the security of your systems and data.
649
+ # For more information, refer to [Validate credential configurations from external
650
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
653
651
  # @return [::Object]
654
652
  # @!attribute [rw] scope
655
653
  # The OAuth scopes
@@ -689,6 +687,11 @@ module Google
689
687
  # default endpoint URL. The default value of nil uses the environment
690
688
  # universe (usually the default "googleapis.com" universe).
691
689
  # @return [::String,nil]
690
+ # @!attribute [rw] logger
691
+ # A custom logger to use for request/response debug logging, or the value
692
+ # `:default` (the default) to construct a default logger, or `nil` to
693
+ # explicitly disable logging.
694
+ # @return [::Logger,:default,nil]
692
695
  #
693
696
  class Configuration
694
697
  extend ::Gapic::Config
@@ -713,6 +716,7 @@ module Google
713
716
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
714
717
  config_attr :quota_project, nil, ::String, nil
715
718
  config_attr :universe_domain, nil, ::String, nil
719
+ config_attr :logger, :default, ::Logger, nil, :default
716
720
 
717
721
  # @private
718
722
  def initialize parent_config = nil
@@ -25,6 +25,46 @@ module Google
25
25
  module CloudRedisCluster
26
26
  # Path helper methods for the CloudRedisCluster API.
27
27
  module Paths
28
+ ##
29
+ # Create a fully-qualified Backup resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param backup_collection [String]
38
+ # @param backup [String]
39
+ #
40
+ # @return [::String]
41
+ def backup_path project:, location:, backup_collection:, backup:
42
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
43
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
44
+ raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/"
45
+
46
+ "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}"
47
+ end
48
+
49
+ ##
50
+ # Create a fully-qualified BackupCollection resource string.
51
+ #
52
+ # The resource will be in the following format:
53
+ #
54
+ # `projects/{project}/locations/{location}/backupCollections/{backup_collection}`
55
+ #
56
+ # @param project [String]
57
+ # @param location [String]
58
+ # @param backup_collection [String]
59
+ #
60
+ # @return [::String]
61
+ def backup_collection_path project:, location:, backup_collection:
62
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
63
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
64
+
65
+ "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}"
66
+ end
67
+
28
68
  ##
29
69
  # Create a fully-qualified CertificateAuthority resource string.
30
70
  #
@@ -63,6 +103,69 @@ module Google
63
103
  "projects/#{project}/locations/#{location}/clusters/#{cluster}"
64
104
  end
65
105
 
106
+ ##
107
+ # Create a fully-qualified CryptoKey resource string.
108
+ #
109
+ # The resource will be in the following format:
110
+ #
111
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
112
+ #
113
+ # @param project [String]
114
+ # @param location [String]
115
+ # @param key_ring [String]
116
+ # @param crypto_key [String]
117
+ #
118
+ # @return [::String]
119
+ def crypto_key_path project:, location:, key_ring:, crypto_key:
120
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
121
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
122
+ raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
123
+
124
+ "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
125
+ end
126
+
127
+ ##
128
+ # Create a fully-qualified CryptoKeyVersion resource string.
129
+ #
130
+ # The resource will be in the following format:
131
+ #
132
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
133
+ #
134
+ # @param project [String]
135
+ # @param location [String]
136
+ # @param key_ring [String]
137
+ # @param crypto_key [String]
138
+ # @param crypto_key_version [String]
139
+ #
140
+ # @return [::String]
141
+ def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version:
142
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
143
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
144
+ raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
145
+ raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/"
146
+
147
+ "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
148
+ end
149
+
150
+ ##
151
+ # Create a fully-qualified ForwardingRule resource string.
152
+ #
153
+ # The resource will be in the following format:
154
+ #
155
+ # `projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}`
156
+ #
157
+ # @param project [String]
158
+ # @param region [String]
159
+ # @param forwarding_rule [String]
160
+ #
161
+ # @return [::String]
162
+ def forwarding_rule_path project:, region:, forwarding_rule:
163
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
164
+ raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/"
165
+
166
+ "projects/#{project}/regions/#{region}/forwardingRules/#{forwarding_rule}"
167
+ end
168
+
66
169
  ##
67
170
  # Create a fully-qualified Location resource string.
68
171
  #
@@ -80,6 +183,42 @@ module Google
80
183
  "projects/#{project}/locations/#{location}"
81
184
  end
82
185
 
186
+ ##
187
+ # Create a fully-qualified Network resource string.
188
+ #
189
+ # The resource will be in the following format:
190
+ #
191
+ # `projects/{project}/global/networks/{network}`
192
+ #
193
+ # @param project [String]
194
+ # @param network [String]
195
+ #
196
+ # @return [::String]
197
+ def network_path project:, network:
198
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
199
+
200
+ "projects/#{project}/global/networks/#{network}"
201
+ end
202
+
203
+ ##
204
+ # Create a fully-qualified ServiceAttachment resource string.
205
+ #
206
+ # The resource will be in the following format:
207
+ #
208
+ # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`
209
+ #
210
+ # @param project [String]
211
+ # @param region [String]
212
+ # @param service_attachment [String]
213
+ #
214
+ # @return [::String]
215
+ def service_attachment_path project:, region:, service_attachment:
216
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
217
+ raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/"
218
+
219
+ "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}"
220
+ end
221
+
83
222
  extend self
84
223
  end
85
224
  end