google-cloud-gke_hub-v1 0.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.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +139 -0
  6. data/lib/google/cloud/gke_hub/v1/gke_hub/client.rb +1388 -0
  7. data/lib/google/cloud/gke_hub/v1/gke_hub/credentials.rb +51 -0
  8. data/lib/google/cloud/gke_hub/v1/gke_hub/operations.rb +664 -0
  9. data/lib/google/cloud/gke_hub/v1/gke_hub/paths.rb +88 -0
  10. data/lib/google/cloud/gke_hub/v1/gke_hub.rb +63 -0
  11. data/lib/google/cloud/gke_hub/v1/version.rb +28 -0
  12. data/lib/google/cloud/gke_hub/v1.rb +38 -0
  13. data/lib/google/cloud/gkehub/v1/configmanagement/configmanagement_pb.rb +179 -0
  14. data/lib/google/cloud/gkehub/v1/feature_pb.rb +86 -0
  15. data/lib/google/cloud/gkehub/v1/membership_pb.rb +77 -0
  16. data/lib/google/cloud/gkehub/v1/multiclusteringress/multiclusteringress_pb.rb +25 -0
  17. data/lib/google/cloud/gkehub/v1/service_pb.rb +135 -0
  18. data/lib/google/cloud/gkehub/v1/service_services_pb.rb +89 -0
  19. data/lib/google-cloud-gke_hub-v1.rb +21 -0
  20. data/proto_docs/README.md +4 -0
  21. data/proto_docs/google/api/field_behavior.rb +71 -0
  22. data/proto_docs/google/api/resource.rb +283 -0
  23. data/proto_docs/google/cloud/gkehub/v1/configmanagement/configmanagement.rb +446 -0
  24. data/proto_docs/google/cloud/gkehub/v1/feature.rb +230 -0
  25. data/proto_docs/google/cloud/gkehub/v1/membership.rb +229 -0
  26. data/proto_docs/google/cloud/gkehub/v1/multiclusteringress/multiclusteringress.rb +39 -0
  27. data/proto_docs/google/cloud/gkehub/v1/service.rb +473 -0
  28. data/proto_docs/google/longrunning/operations.rb +164 -0
  29. data/proto_docs/google/protobuf/any.rb +141 -0
  30. data/proto_docs/google/protobuf/duration.rb +98 -0
  31. data/proto_docs/google/protobuf/empty.rb +36 -0
  32. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  33. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  34. data/proto_docs/google/rpc/status.rb +46 -0
  35. metadata +225 -0
@@ -0,0 +1,1388 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/gkehub/v1/service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module GkeHub
25
+ module V1
26
+ module GkeHub
27
+ ##
28
+ # Client for the GkeHub service.
29
+ #
30
+ # The GKE Hub service handles the registration of many Kubernetes clusters to
31
+ # Google Cloud, and the management of multi-cluster features over those
32
+ # clusters.
33
+ #
34
+ # The GKE Hub service operates on the following resources:
35
+ #
36
+ # * {::Google::Cloud::GkeHub::V1::Membership Membership}
37
+ # * {::Google::Cloud::GkeHub::V1::Feature Feature}
38
+ #
39
+ # GKE Hub is currently only available in the global region.
40
+ #
41
+ # **Membership management may be non-trivial:** it is recommended to use one
42
+ # of the Google-provided client libraries or tools where possible when working
43
+ # with Membership resources.
44
+ #
45
+ class Client
46
+ include Paths
47
+
48
+ # @private
49
+ attr_reader :gke_hub_stub
50
+
51
+ ##
52
+ # Configure the GkeHub Client class.
53
+ #
54
+ # See {::Google::Cloud::GkeHub::V1::GkeHub::Client::Configuration}
55
+ # for a description of the configuration fields.
56
+ #
57
+ # @example
58
+ #
59
+ # # Modify the configuration for all GkeHub clients
60
+ # ::Google::Cloud::GkeHub::V1::GkeHub::Client.configure do |config|
61
+ # config.timeout = 10.0
62
+ # end
63
+ #
64
+ # @yield [config] Configure the Client client.
65
+ # @yieldparam config [Client::Configuration]
66
+ #
67
+ # @return [Client::Configuration]
68
+ #
69
+ def self.configure
70
+ @configure ||= begin
71
+ namespace = ["Google", "Cloud", "GkeHub", "V1"]
72
+ parent_config = while namespace.any?
73
+ parent_name = namespace.join "::"
74
+ parent_const = const_get parent_name
75
+ break parent_const.configure if parent_const.respond_to? :configure
76
+ namespace.pop
77
+ end
78
+ default_config = Client::Configuration.new parent_config
79
+
80
+ default_config.timeout = 60.0
81
+ default_config.retry_policy = {
82
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
83
+ }
84
+
85
+ default_config
86
+ end
87
+ yield @configure if block_given?
88
+ @configure
89
+ end
90
+
91
+ ##
92
+ # Configure the GkeHub Client instance.
93
+ #
94
+ # The configuration is set to the derived mode, meaning that values can be changed,
95
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
96
+ # should be made on {Client.configure}.
97
+ #
98
+ # See {::Google::Cloud::GkeHub::V1::GkeHub::Client::Configuration}
99
+ # for a description of the configuration fields.
100
+ #
101
+ # @yield [config] Configure the Client client.
102
+ # @yieldparam config [Client::Configuration]
103
+ #
104
+ # @return [Client::Configuration]
105
+ #
106
+ def configure
107
+ yield @config if block_given?
108
+ @config
109
+ end
110
+
111
+ ##
112
+ # Create a new GkeHub client object.
113
+ #
114
+ # @example
115
+ #
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
123
+ #
124
+ # @yield [config] Configure the GkeHub client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ def initialize
128
+ # These require statements are intentionally placed here to initialize
129
+ # the gRPC module only when it's required.
130
+ # See https://github.com/googleapis/toolkit/issues/446
131
+ require "gapic/grpc"
132
+ require "google/cloud/gkehub/v1/service_services_pb"
133
+
134
+ # Create the configuration object
135
+ @config = Configuration.new Client.configure
136
+
137
+ # Yield the configuration if needed
138
+ yield @config if block_given?
139
+
140
+ # Create credentials
141
+ credentials = @config.credentials
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
143
+ # but only if the default endpoint does not have a region prefix.
144
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
145
+ !@config.endpoint.split(".").first.include?("-")
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @operations_client = Operations.new do |config|
155
+ config.credentials = credentials
156
+ config.endpoint = @config.endpoint
157
+ end
158
+
159
+ @gke_hub_stub = ::Gapic::ServiceStub.new(
160
+ ::Google::Cloud::GkeHub::V1::GkeHub::Stub,
161
+ credentials: credentials,
162
+ endpoint: @config.endpoint,
163
+ channel_args: @config.channel_args,
164
+ interceptors: @config.interceptors
165
+ )
166
+ end
167
+
168
+ ##
169
+ # Get the associated client for long-running operations.
170
+ #
171
+ # @return [::Google::Cloud::GkeHub::V1::GkeHub::Operations]
172
+ #
173
+ attr_reader :operations_client
174
+
175
+ # Service calls
176
+
177
+ ##
178
+ # Lists Memberships in a given project and location.
179
+ #
180
+ # @overload list_memberships(request, options = nil)
181
+ # Pass arguments to `list_memberships` via a request object, either of type
182
+ # {::Google::Cloud::GkeHub::V1::ListMembershipsRequest} or an equivalent Hash.
183
+ #
184
+ # @param request [::Google::Cloud::GkeHub::V1::ListMembershipsRequest, ::Hash]
185
+ # A request object representing the call parameters. Required. To specify no
186
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
187
+ # @param options [::Gapic::CallOptions, ::Hash]
188
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
189
+ #
190
+ # @overload list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
191
+ # Pass arguments to `list_memberships` via keyword arguments. Note that at
192
+ # least one keyword argument is required. To specify no parameters, or to keep all
193
+ # the default parameter values, pass an empty Hash as a request object (see above).
194
+ #
195
+ # @param parent [::String]
196
+ # Required. The parent (project and location) where the Memberships will be listed.
197
+ # Specified in the format `projects/*/locations/*`.
198
+ # @param page_size [::Integer]
199
+ # Optional. When requesting a 'page' of resources, `page_size` specifies number of
200
+ # resources to return. If unspecified or set to 0, all resources will
201
+ # be returned.
202
+ # @param page_token [::String]
203
+ # Optional. Token returned by previous call to `ListMemberships` which
204
+ # specifies the position in the list from where to continue listing the
205
+ # resources.
206
+ # @param filter [::String]
207
+ # Optional. Lists Memberships that match the filter expression, following the syntax
208
+ # outlined in https://google.aip.dev/160.
209
+ #
210
+ # Examples:
211
+ #
212
+ # - Name is `bar` in project `foo-proj` and location `global`:
213
+ #
214
+ # name = "projects/foo-proj/locations/global/membership/bar"
215
+ #
216
+ # - Memberships that have a label called `foo`:
217
+ #
218
+ # labels.foo:*
219
+ #
220
+ # - Memberships that have a label called `foo` whose value is `bar`:
221
+ #
222
+ # labels.foo = bar
223
+ #
224
+ # - Memberships in the CREATING state:
225
+ #
226
+ # state = CREATING
227
+ # @param order_by [::String]
228
+ # Optional. One or more fields to compare and use to sort the output.
229
+ # See https://google.aip.dev/132#ordering.
230
+ #
231
+ # @yield [response, operation] Access the result along with the RPC operation
232
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Membership>]
233
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
234
+ #
235
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Membership>]
236
+ #
237
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
238
+ #
239
+ def list_memberships request, options = nil
240
+ raise ::ArgumentError, "request must be provided" if request.nil?
241
+
242
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListMembershipsRequest
243
+
244
+ # Converts hash and nil to an options object
245
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
246
+
247
+ # Customize the options with defaults
248
+ metadata = @config.rpcs.list_memberships.metadata.to_h
249
+
250
+ # Set x-goog-api-client and x-goog-user-project headers
251
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
252
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
253
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
254
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
255
+
256
+ header_params = {
257
+ "parent" => request.parent
258
+ }
259
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
260
+ metadata[:"x-goog-request-params"] ||= request_params_header
261
+
262
+ options.apply_defaults timeout: @config.rpcs.list_memberships.timeout,
263
+ metadata: metadata,
264
+ retry_policy: @config.rpcs.list_memberships.retry_policy
265
+
266
+ options.apply_defaults timeout: @config.timeout,
267
+ metadata: @config.metadata,
268
+ retry_policy: @config.retry_policy
269
+
270
+ @gke_hub_stub.call_rpc :list_memberships, request, options: options do |response, operation|
271
+ response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_memberships, request, response, operation, options
272
+ yield response, operation if block_given?
273
+ return response
274
+ end
275
+ rescue ::GRPC::BadStatus => e
276
+ raise ::Google::Cloud::Error.from_error(e)
277
+ end
278
+
279
+ ##
280
+ # Lists Features in a given project and location.
281
+ #
282
+ # @overload list_features(request, options = nil)
283
+ # Pass arguments to `list_features` via a request object, either of type
284
+ # {::Google::Cloud::GkeHub::V1::ListFeaturesRequest} or an equivalent Hash.
285
+ #
286
+ # @param request [::Google::Cloud::GkeHub::V1::ListFeaturesRequest, ::Hash]
287
+ # A request object representing the call parameters. Required. To specify no
288
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
289
+ # @param options [::Gapic::CallOptions, ::Hash]
290
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
291
+ #
292
+ # @overload list_features(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
293
+ # Pass arguments to `list_features` via keyword arguments. Note that at
294
+ # least one keyword argument is required. To specify no parameters, or to keep all
295
+ # the default parameter values, pass an empty Hash as a request object (see above).
296
+ #
297
+ # @param parent [::String]
298
+ # The parent (project and location) where the Features will be listed.
299
+ # Specified in the format `projects/*/locations/*`.
300
+ # @param page_size [::Integer]
301
+ # When requesting a 'page' of resources, `page_size` specifies number of
302
+ # resources to return. If unspecified or set to 0, all resources will
303
+ # be returned.
304
+ # @param page_token [::String]
305
+ # Token returned by previous call to `ListFeatures` which
306
+ # specifies the position in the list from where to continue listing the
307
+ # resources.
308
+ # @param filter [::String]
309
+ # Lists Features that match the filter expression, following the syntax
310
+ # outlined in https://google.aip.dev/160.
311
+ #
312
+ # Examples:
313
+ #
314
+ # - Feature with the name "servicemesh" in project "foo-proj":
315
+ #
316
+ # name = "projects/foo-proj/locations/global/features/servicemesh"
317
+ #
318
+ # - Features that have a label called `foo`:
319
+ #
320
+ # labels.foo:*
321
+ #
322
+ # - Features that have a label called `foo` whose value is `bar`:
323
+ #
324
+ # labels.foo = bar
325
+ # @param order_by [::String]
326
+ # One or more fields to compare and use to sort the output.
327
+ # See https://google.aip.dev/132#ordering.
328
+ #
329
+ # @yield [response, operation] Access the result along with the RPC operation
330
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Feature>]
331
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
332
+ #
333
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1::Feature>]
334
+ #
335
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
336
+ #
337
+ def list_features request, options = nil
338
+ raise ::ArgumentError, "request must be provided" if request.nil?
339
+
340
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::ListFeaturesRequest
341
+
342
+ # Converts hash and nil to an options object
343
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
344
+
345
+ # Customize the options with defaults
346
+ metadata = @config.rpcs.list_features.metadata.to_h
347
+
348
+ # Set x-goog-api-client and x-goog-user-project headers
349
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
350
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
351
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
352
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
+
354
+ header_params = {
355
+ "parent" => request.parent
356
+ }
357
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
358
+ metadata[:"x-goog-request-params"] ||= request_params_header
359
+
360
+ options.apply_defaults timeout: @config.rpcs.list_features.timeout,
361
+ metadata: metadata,
362
+ retry_policy: @config.rpcs.list_features.retry_policy
363
+
364
+ options.apply_defaults timeout: @config.timeout,
365
+ metadata: @config.metadata,
366
+ retry_policy: @config.retry_policy
367
+
368
+ @gke_hub_stub.call_rpc :list_features, request, options: options do |response, operation|
369
+ response = ::Gapic::PagedEnumerable.new @gke_hub_stub, :list_features, request, response, operation, options
370
+ yield response, operation if block_given?
371
+ return response
372
+ end
373
+ rescue ::GRPC::BadStatus => e
374
+ raise ::Google::Cloud::Error.from_error(e)
375
+ end
376
+
377
+ ##
378
+ # Gets the details of a Membership.
379
+ #
380
+ # @overload get_membership(request, options = nil)
381
+ # Pass arguments to `get_membership` via a request object, either of type
382
+ # {::Google::Cloud::GkeHub::V1::GetMembershipRequest} or an equivalent Hash.
383
+ #
384
+ # @param request [::Google::Cloud::GkeHub::V1::GetMembershipRequest, ::Hash]
385
+ # A request object representing the call parameters. Required. To specify no
386
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
387
+ # @param options [::Gapic::CallOptions, ::Hash]
388
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
389
+ #
390
+ # @overload get_membership(name: nil)
391
+ # Pass arguments to `get_membership` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param name [::String]
396
+ # Required. The Membership resource name in the format
397
+ # `projects/*/locations/*/memberships/*`.
398
+ #
399
+ # @yield [response, operation] Access the result along with the RPC operation
400
+ # @yieldparam response [::Google::Cloud::GkeHub::V1::Membership]
401
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
402
+ #
403
+ # @return [::Google::Cloud::GkeHub::V1::Membership]
404
+ #
405
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
406
+ #
407
+ def get_membership request, options = nil
408
+ raise ::ArgumentError, "request must be provided" if request.nil?
409
+
410
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetMembershipRequest
411
+
412
+ # Converts hash and nil to an options object
413
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
414
+
415
+ # Customize the options with defaults
416
+ metadata = @config.rpcs.get_membership.metadata.to_h
417
+
418
+ # Set x-goog-api-client and x-goog-user-project headers
419
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
420
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
421
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
422
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
423
+
424
+ header_params = {
425
+ "name" => request.name
426
+ }
427
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
428
+ metadata[:"x-goog-request-params"] ||= request_params_header
429
+
430
+ options.apply_defaults timeout: @config.rpcs.get_membership.timeout,
431
+ metadata: metadata,
432
+ retry_policy: @config.rpcs.get_membership.retry_policy
433
+
434
+ options.apply_defaults timeout: @config.timeout,
435
+ metadata: @config.metadata,
436
+ retry_policy: @config.retry_policy
437
+
438
+ @gke_hub_stub.call_rpc :get_membership, request, options: options do |response, operation|
439
+ yield response, operation if block_given?
440
+ return response
441
+ end
442
+ rescue ::GRPC::BadStatus => e
443
+ raise ::Google::Cloud::Error.from_error(e)
444
+ end
445
+
446
+ ##
447
+ # Gets details of a single Feature.
448
+ #
449
+ # @overload get_feature(request, options = nil)
450
+ # Pass arguments to `get_feature` via a request object, either of type
451
+ # {::Google::Cloud::GkeHub::V1::GetFeatureRequest} or an equivalent Hash.
452
+ #
453
+ # @param request [::Google::Cloud::GkeHub::V1::GetFeatureRequest, ::Hash]
454
+ # A request object representing the call parameters. Required. To specify no
455
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
456
+ # @param options [::Gapic::CallOptions, ::Hash]
457
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
458
+ #
459
+ # @overload get_feature(name: nil)
460
+ # Pass arguments to `get_feature` via keyword arguments. Note that at
461
+ # least one keyword argument is required. To specify no parameters, or to keep all
462
+ # the default parameter values, pass an empty Hash as a request object (see above).
463
+ #
464
+ # @param name [::String]
465
+ # The Feature resource name in the format
466
+ # `projects/*/locations/*/features/*`
467
+ #
468
+ # @yield [response, operation] Access the result along with the RPC operation
469
+ # @yieldparam response [::Google::Cloud::GkeHub::V1::Feature]
470
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
471
+ #
472
+ # @return [::Google::Cloud::GkeHub::V1::Feature]
473
+ #
474
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
475
+ #
476
+ def get_feature request, options = nil
477
+ raise ::ArgumentError, "request must be provided" if request.nil?
478
+
479
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GetFeatureRequest
480
+
481
+ # Converts hash and nil to an options object
482
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
483
+
484
+ # Customize the options with defaults
485
+ metadata = @config.rpcs.get_feature.metadata.to_h
486
+
487
+ # Set x-goog-api-client and x-goog-user-project headers
488
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
489
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
490
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
491
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
492
+
493
+ header_params = {
494
+ "name" => request.name
495
+ }
496
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
497
+ metadata[:"x-goog-request-params"] ||= request_params_header
498
+
499
+ options.apply_defaults timeout: @config.rpcs.get_feature.timeout,
500
+ metadata: metadata,
501
+ retry_policy: @config.rpcs.get_feature.retry_policy
502
+
503
+ options.apply_defaults timeout: @config.timeout,
504
+ metadata: @config.metadata,
505
+ retry_policy: @config.retry_policy
506
+
507
+ @gke_hub_stub.call_rpc :get_feature, request, options: options do |response, operation|
508
+ yield response, operation if block_given?
509
+ return response
510
+ end
511
+ rescue ::GRPC::BadStatus => e
512
+ raise ::Google::Cloud::Error.from_error(e)
513
+ end
514
+
515
+ ##
516
+ # Creates a new Membership.
517
+ #
518
+ # **This is currently only supported for GKE clusters on Google Cloud**.
519
+ # To register other clusters, follow the instructions at
520
+ # https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
521
+ #
522
+ # @overload create_membership(request, options = nil)
523
+ # Pass arguments to `create_membership` via a request object, either of type
524
+ # {::Google::Cloud::GkeHub::V1::CreateMembershipRequest} or an equivalent Hash.
525
+ #
526
+ # @param request [::Google::Cloud::GkeHub::V1::CreateMembershipRequest, ::Hash]
527
+ # A request object representing the call parameters. Required. To specify no
528
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
529
+ # @param options [::Gapic::CallOptions, ::Hash]
530
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
531
+ #
532
+ # @overload create_membership(parent: nil, membership_id: nil, resource: nil, request_id: nil)
533
+ # Pass arguments to `create_membership` via keyword arguments. Note that at
534
+ # least one keyword argument is required. To specify no parameters, or to keep all
535
+ # the default parameter values, pass an empty Hash as a request object (see above).
536
+ #
537
+ # @param parent [::String]
538
+ # Required. The parent (project and location) where the Memberships will be created.
539
+ # Specified in the format `projects/*/locations/*`.
540
+ # @param membership_id [::String]
541
+ # Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
542
+ # 1123 compliant DNS label:
543
+ #
544
+ # 1. At most 63 characters in length
545
+ # 2. It must consist of lower case alphanumeric characters or `-`
546
+ # 3. It must start and end with an alphanumeric character
547
+ #
548
+ # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
549
+ # with a maximum length of 63 characters.
550
+ # @param resource [::Google::Cloud::GkeHub::V1::Membership, ::Hash]
551
+ # Required. The membership to create.
552
+ # @param request_id [::String]
553
+ # Optional. A request ID to identify requests. Specify a unique request ID
554
+ # so that if you must retry your request, the server will know to ignore
555
+ # the request if it has already been completed. The server will guarantee
556
+ # that for at least 60 minutes after the first request.
557
+ #
558
+ # For example, consider a situation where you make an initial request and
559
+ # the request times out. If you make the request again with the same request
560
+ # ID, the server can check if original operation with the same request ID
561
+ # was received, and if so, will ignore the second request. This prevents
562
+ # clients from accidentally creating duplicate commitments.
563
+ #
564
+ # The request ID must be a valid UUID with the exception that zero UUID is
565
+ # not supported (00000000-0000-0000-0000-000000000000).
566
+ #
567
+ # @yield [response, operation] Access the result along with the RPC operation
568
+ # @yieldparam response [::Gapic::Operation]
569
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
570
+ #
571
+ # @return [::Gapic::Operation]
572
+ #
573
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
574
+ #
575
+ def create_membership request, options = nil
576
+ raise ::ArgumentError, "request must be provided" if request.nil?
577
+
578
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateMembershipRequest
579
+
580
+ # Converts hash and nil to an options object
581
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
582
+
583
+ # Customize the options with defaults
584
+ metadata = @config.rpcs.create_membership.metadata.to_h
585
+
586
+ # Set x-goog-api-client and x-goog-user-project headers
587
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
588
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
589
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
590
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
591
+
592
+ header_params = {
593
+ "parent" => request.parent
594
+ }
595
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
596
+ metadata[:"x-goog-request-params"] ||= request_params_header
597
+
598
+ options.apply_defaults timeout: @config.rpcs.create_membership.timeout,
599
+ metadata: metadata,
600
+ retry_policy: @config.rpcs.create_membership.retry_policy
601
+
602
+ options.apply_defaults timeout: @config.timeout,
603
+ metadata: @config.metadata,
604
+ retry_policy: @config.retry_policy
605
+
606
+ @gke_hub_stub.call_rpc :create_membership, request, options: options do |response, operation|
607
+ response = ::Gapic::Operation.new response, @operations_client, options: options
608
+ yield response, operation if block_given?
609
+ return response
610
+ end
611
+ rescue ::GRPC::BadStatus => e
612
+ raise ::Google::Cloud::Error.from_error(e)
613
+ end
614
+
615
+ ##
616
+ # Adds a new Feature.
617
+ #
618
+ # @overload create_feature(request, options = nil)
619
+ # Pass arguments to `create_feature` via a request object, either of type
620
+ # {::Google::Cloud::GkeHub::V1::CreateFeatureRequest} or an equivalent Hash.
621
+ #
622
+ # @param request [::Google::Cloud::GkeHub::V1::CreateFeatureRequest, ::Hash]
623
+ # A request object representing the call parameters. Required. To specify no
624
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
625
+ # @param options [::Gapic::CallOptions, ::Hash]
626
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
627
+ #
628
+ # @overload create_feature(parent: nil, feature_id: nil, resource: nil, request_id: nil)
629
+ # Pass arguments to `create_feature` via keyword arguments. Note that at
630
+ # least one keyword argument is required. To specify no parameters, or to keep all
631
+ # the default parameter values, pass an empty Hash as a request object (see above).
632
+ #
633
+ # @param parent [::String]
634
+ # The parent (project and location) where the Feature will be created.
635
+ # Specified in the format `projects/*/locations/*`.
636
+ # @param feature_id [::String]
637
+ # The ID of the feature to create.
638
+ # @param resource [::Google::Cloud::GkeHub::V1::Feature, ::Hash]
639
+ # The Feature resource to create.
640
+ # @param request_id [::String]
641
+ # Optional. A request ID to identify requests. Specify a unique request ID
642
+ # so that if you must retry your request, the server will know to ignore
643
+ # the request if it has already been completed. The server will guarantee
644
+ # that for at least 60 minutes after the first request.
645
+ #
646
+ # For example, consider a situation where you make an initial request and
647
+ # the request times out. If you make the request again with the same request
648
+ # ID, the server can check if original operation with the same request ID
649
+ # was received, and if so, will ignore the second request. This prevents
650
+ # clients from accidentally creating duplicate commitments.
651
+ #
652
+ # The request ID must be a valid UUID with the exception that zero UUID is
653
+ # not supported (00000000-0000-0000-0000-000000000000).
654
+ #
655
+ # @yield [response, operation] Access the result along with the RPC operation
656
+ # @yieldparam response [::Gapic::Operation]
657
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
658
+ #
659
+ # @return [::Gapic::Operation]
660
+ #
661
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
662
+ #
663
+ def create_feature request, options = nil
664
+ raise ::ArgumentError, "request must be provided" if request.nil?
665
+
666
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::CreateFeatureRequest
667
+
668
+ # Converts hash and nil to an options object
669
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
670
+
671
+ # Customize the options with defaults
672
+ metadata = @config.rpcs.create_feature.metadata.to_h
673
+
674
+ # Set x-goog-api-client and x-goog-user-project headers
675
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
676
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
677
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
678
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
679
+
680
+ header_params = {
681
+ "parent" => request.parent
682
+ }
683
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
684
+ metadata[:"x-goog-request-params"] ||= request_params_header
685
+
686
+ options.apply_defaults timeout: @config.rpcs.create_feature.timeout,
687
+ metadata: metadata,
688
+ retry_policy: @config.rpcs.create_feature.retry_policy
689
+
690
+ options.apply_defaults timeout: @config.timeout,
691
+ metadata: @config.metadata,
692
+ retry_policy: @config.retry_policy
693
+
694
+ @gke_hub_stub.call_rpc :create_feature, request, options: options do |response, operation|
695
+ response = ::Gapic::Operation.new response, @operations_client, options: options
696
+ yield response, operation if block_given?
697
+ return response
698
+ end
699
+ rescue ::GRPC::BadStatus => e
700
+ raise ::Google::Cloud::Error.from_error(e)
701
+ end
702
+
703
+ ##
704
+ # Removes a Membership.
705
+ #
706
+ # **This is currently only supported for GKE clusters on Google Cloud**.
707
+ # To unregister other clusters, follow the instructions at
708
+ # https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
709
+ #
710
+ # @overload delete_membership(request, options = nil)
711
+ # Pass arguments to `delete_membership` via a request object, either of type
712
+ # {::Google::Cloud::GkeHub::V1::DeleteMembershipRequest} or an equivalent Hash.
713
+ #
714
+ # @param request [::Google::Cloud::GkeHub::V1::DeleteMembershipRequest, ::Hash]
715
+ # A request object representing the call parameters. Required. To specify no
716
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
717
+ # @param options [::Gapic::CallOptions, ::Hash]
718
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
719
+ #
720
+ # @overload delete_membership(name: nil, request_id: nil)
721
+ # Pass arguments to `delete_membership` via keyword arguments. Note that at
722
+ # least one keyword argument is required. To specify no parameters, or to keep all
723
+ # the default parameter values, pass an empty Hash as a request object (see above).
724
+ #
725
+ # @param name [::String]
726
+ # Required. The Membership resource name in the format
727
+ # `projects/*/locations/*/memberships/*`.
728
+ # @param request_id [::String]
729
+ # Optional. A request ID to identify requests. Specify a unique request ID
730
+ # so that if you must retry your request, the server will know to ignore
731
+ # the request if it has already been completed. The server will guarantee
732
+ # that for at least 60 minutes after the first request.
733
+ #
734
+ # For example, consider a situation where you make an initial request and
735
+ # the request times out. If you make the request again with the same request
736
+ # ID, the server can check if original operation with the same request ID
737
+ # was received, and if so, will ignore the second request. This prevents
738
+ # clients from accidentally creating duplicate commitments.
739
+ #
740
+ # The request ID must be a valid UUID with the exception that zero UUID is
741
+ # not supported (00000000-0000-0000-0000-000000000000).
742
+ #
743
+ # @yield [response, operation] Access the result along with the RPC operation
744
+ # @yieldparam response [::Gapic::Operation]
745
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
746
+ #
747
+ # @return [::Gapic::Operation]
748
+ #
749
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
750
+ #
751
+ def delete_membership request, options = nil
752
+ raise ::ArgumentError, "request must be provided" if request.nil?
753
+
754
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteMembershipRequest
755
+
756
+ # Converts hash and nil to an options object
757
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
758
+
759
+ # Customize the options with defaults
760
+ metadata = @config.rpcs.delete_membership.metadata.to_h
761
+
762
+ # Set x-goog-api-client and x-goog-user-project headers
763
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
764
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
765
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
766
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
767
+
768
+ header_params = {
769
+ "name" => request.name
770
+ }
771
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
772
+ metadata[:"x-goog-request-params"] ||= request_params_header
773
+
774
+ options.apply_defaults timeout: @config.rpcs.delete_membership.timeout,
775
+ metadata: metadata,
776
+ retry_policy: @config.rpcs.delete_membership.retry_policy
777
+
778
+ options.apply_defaults timeout: @config.timeout,
779
+ metadata: @config.metadata,
780
+ retry_policy: @config.retry_policy
781
+
782
+ @gke_hub_stub.call_rpc :delete_membership, request, options: options do |response, operation|
783
+ response = ::Gapic::Operation.new response, @operations_client, options: options
784
+ yield response, operation if block_given?
785
+ return response
786
+ end
787
+ rescue ::GRPC::BadStatus => e
788
+ raise ::Google::Cloud::Error.from_error(e)
789
+ end
790
+
791
+ ##
792
+ # Removes a Feature.
793
+ #
794
+ # @overload delete_feature(request, options = nil)
795
+ # Pass arguments to `delete_feature` via a request object, either of type
796
+ # {::Google::Cloud::GkeHub::V1::DeleteFeatureRequest} or an equivalent Hash.
797
+ #
798
+ # @param request [::Google::Cloud::GkeHub::V1::DeleteFeatureRequest, ::Hash]
799
+ # A request object representing the call parameters. Required. To specify no
800
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
801
+ # @param options [::Gapic::CallOptions, ::Hash]
802
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
803
+ #
804
+ # @overload delete_feature(name: nil, force: nil, request_id: nil)
805
+ # Pass arguments to `delete_feature` via keyword arguments. Note that at
806
+ # least one keyword argument is required. To specify no parameters, or to keep all
807
+ # the default parameter values, pass an empty Hash as a request object (see above).
808
+ #
809
+ # @param name [::String]
810
+ # The Feature resource name in the format
811
+ # `projects/*/locations/*/features/*`.
812
+ # @param force [::Boolean]
813
+ # If set to true, the delete will ignore any outstanding resources for
814
+ # this Feature (that is, `FeatureState.has_resources` is set to true). These
815
+ # resources will NOT be cleaned up or modified in any way.
816
+ # @param request_id [::String]
817
+ # Optional. A request ID to identify requests. Specify a unique request ID
818
+ # so that if you must retry your request, the server will know to ignore
819
+ # the request if it has already been completed. The server will guarantee
820
+ # that for at least 60 minutes after the first request.
821
+ #
822
+ # For example, consider a situation where you make an initial request and
823
+ # the request times out. If you make the request again with the same request
824
+ # ID, the server can check if original operation with the same request ID
825
+ # was received, and if so, will ignore the second request. This prevents
826
+ # clients from accidentally creating duplicate commitments.
827
+ #
828
+ # The request ID must be a valid UUID with the exception that zero UUID is
829
+ # not supported (00000000-0000-0000-0000-000000000000).
830
+ #
831
+ # @yield [response, operation] Access the result along with the RPC operation
832
+ # @yieldparam response [::Gapic::Operation]
833
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
834
+ #
835
+ # @return [::Gapic::Operation]
836
+ #
837
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
838
+ #
839
+ def delete_feature request, options = nil
840
+ raise ::ArgumentError, "request must be provided" if request.nil?
841
+
842
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::DeleteFeatureRequest
843
+
844
+ # Converts hash and nil to an options object
845
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
846
+
847
+ # Customize the options with defaults
848
+ metadata = @config.rpcs.delete_feature.metadata.to_h
849
+
850
+ # Set x-goog-api-client and x-goog-user-project headers
851
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
852
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
853
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
854
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
855
+
856
+ header_params = {
857
+ "name" => request.name
858
+ }
859
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
860
+ metadata[:"x-goog-request-params"] ||= request_params_header
861
+
862
+ options.apply_defaults timeout: @config.rpcs.delete_feature.timeout,
863
+ metadata: metadata,
864
+ retry_policy: @config.rpcs.delete_feature.retry_policy
865
+
866
+ options.apply_defaults timeout: @config.timeout,
867
+ metadata: @config.metadata,
868
+ retry_policy: @config.retry_policy
869
+
870
+ @gke_hub_stub.call_rpc :delete_feature, request, options: options do |response, operation|
871
+ response = ::Gapic::Operation.new response, @operations_client, options: options
872
+ yield response, operation if block_given?
873
+ return response
874
+ end
875
+ rescue ::GRPC::BadStatus => e
876
+ raise ::Google::Cloud::Error.from_error(e)
877
+ end
878
+
879
+ ##
880
+ # Updates an existing Membership.
881
+ #
882
+ # @overload update_membership(request, options = nil)
883
+ # Pass arguments to `update_membership` via a request object, either of type
884
+ # {::Google::Cloud::GkeHub::V1::UpdateMembershipRequest} or an equivalent Hash.
885
+ #
886
+ # @param request [::Google::Cloud::GkeHub::V1::UpdateMembershipRequest, ::Hash]
887
+ # A request object representing the call parameters. Required. To specify no
888
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
889
+ # @param options [::Gapic::CallOptions, ::Hash]
890
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
891
+ #
892
+ # @overload update_membership(name: nil, update_mask: nil, resource: nil, request_id: nil)
893
+ # Pass arguments to `update_membership` via keyword arguments. Note that at
894
+ # least one keyword argument is required. To specify no parameters, or to keep all
895
+ # the default parameter values, pass an empty Hash as a request object (see above).
896
+ #
897
+ # @param name [::String]
898
+ # Required. The Membership resource name in the format
899
+ # `projects/*/locations/*/memberships/*`.
900
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
901
+ # Required. Mask of fields to update.
902
+ # @param resource [::Google::Cloud::GkeHub::V1::Membership, ::Hash]
903
+ # Required. Only fields specified in update_mask are updated.
904
+ # If you specify a field in the update_mask but don't specify its value here
905
+ # that field will be deleted.
906
+ # If you are updating a map field, set the value of a key to null or empty
907
+ # string to delete the key from the map. It's not possible to update a key's
908
+ # value to the empty string.
909
+ # If you specify the update_mask to be a special path "*", fully replaces all
910
+ # user-modifiable fields to match `resource`.
911
+ # @param request_id [::String]
912
+ # Optional. A request ID to identify requests. Specify a unique request ID
913
+ # so that if you must retry your request, the server will know to ignore
914
+ # the request if it has already been completed. The server will guarantee
915
+ # that for at least 60 minutes after the first request.
916
+ #
917
+ # For example, consider a situation where you make an initial request and
918
+ # the request times out. If you make the request again with the same request
919
+ # ID, the server can check if original operation with the same request ID
920
+ # was received, and if so, will ignore the second request. This prevents
921
+ # clients from accidentally creating duplicate commitments.
922
+ #
923
+ # The request ID must be a valid UUID with the exception that zero UUID is
924
+ # not supported (00000000-0000-0000-0000-000000000000).
925
+ #
926
+ # @yield [response, operation] Access the result along with the RPC operation
927
+ # @yieldparam response [::Gapic::Operation]
928
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
929
+ #
930
+ # @return [::Gapic::Operation]
931
+ #
932
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
933
+ #
934
+ def update_membership request, options = nil
935
+ raise ::ArgumentError, "request must be provided" if request.nil?
936
+
937
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateMembershipRequest
938
+
939
+ # Converts hash and nil to an options object
940
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
941
+
942
+ # Customize the options with defaults
943
+ metadata = @config.rpcs.update_membership.metadata.to_h
944
+
945
+ # Set x-goog-api-client and x-goog-user-project headers
946
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
947
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
948
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
949
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
950
+
951
+ header_params = {
952
+ "name" => request.name
953
+ }
954
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
955
+ metadata[:"x-goog-request-params"] ||= request_params_header
956
+
957
+ options.apply_defaults timeout: @config.rpcs.update_membership.timeout,
958
+ metadata: metadata,
959
+ retry_policy: @config.rpcs.update_membership.retry_policy
960
+
961
+ options.apply_defaults timeout: @config.timeout,
962
+ metadata: @config.metadata,
963
+ retry_policy: @config.retry_policy
964
+
965
+ @gke_hub_stub.call_rpc :update_membership, request, options: options do |response, operation|
966
+ response = ::Gapic::Operation.new response, @operations_client, options: options
967
+ yield response, operation if block_given?
968
+ return response
969
+ end
970
+ rescue ::GRPC::BadStatus => e
971
+ raise ::Google::Cloud::Error.from_error(e)
972
+ end
973
+
974
+ ##
975
+ # Updates an existing Feature.
976
+ #
977
+ # @overload update_feature(request, options = nil)
978
+ # Pass arguments to `update_feature` via a request object, either of type
979
+ # {::Google::Cloud::GkeHub::V1::UpdateFeatureRequest} or an equivalent Hash.
980
+ #
981
+ # @param request [::Google::Cloud::GkeHub::V1::UpdateFeatureRequest, ::Hash]
982
+ # A request object representing the call parameters. Required. To specify no
983
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
984
+ # @param options [::Gapic::CallOptions, ::Hash]
985
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
986
+ #
987
+ # @overload update_feature(name: nil, update_mask: nil, resource: nil, request_id: nil)
988
+ # Pass arguments to `update_feature` via keyword arguments. Note that at
989
+ # least one keyword argument is required. To specify no parameters, or to keep all
990
+ # the default parameter values, pass an empty Hash as a request object (see above).
991
+ #
992
+ # @param name [::String]
993
+ # The Feature resource name in the format
994
+ # `projects/*/locations/*/features/*`.
995
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
996
+ # Mask of fields to update.
997
+ # @param resource [::Google::Cloud::GkeHub::V1::Feature, ::Hash]
998
+ # Only fields specified in update_mask are updated.
999
+ # If you specify a field in the update_mask but don't specify its value here
1000
+ # that field will be deleted.
1001
+ # If you are updating a map field, set the value of a key to null or empty
1002
+ # string to delete the key from the map. It's not possible to update a key's
1003
+ # value to the empty string.
1004
+ # If you specify the update_mask to be a special path "*", fully replaces all
1005
+ # user-modifiable fields to match `resource`.
1006
+ # @param request_id [::String]
1007
+ # Optional. A request ID to identify requests. Specify a unique request ID
1008
+ # so that if you must retry your request, the server will know to ignore
1009
+ # the request if it has already been completed. The server will guarantee
1010
+ # that for at least 60 minutes after the first request.
1011
+ #
1012
+ # For example, consider a situation where you make an initial request and
1013
+ # the request times out. If you make the request again with the same request
1014
+ # ID, the server can check if original operation with the same request ID
1015
+ # was received, and if so, will ignore the second request. This prevents
1016
+ # clients from accidentally creating duplicate commitments.
1017
+ #
1018
+ # The request ID must be a valid UUID with the exception that zero UUID is
1019
+ # not supported (00000000-0000-0000-0000-000000000000).
1020
+ #
1021
+ # @yield [response, operation] Access the result along with the RPC operation
1022
+ # @yieldparam response [::Gapic::Operation]
1023
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1024
+ #
1025
+ # @return [::Gapic::Operation]
1026
+ #
1027
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1028
+ #
1029
+ def update_feature request, options = nil
1030
+ raise ::ArgumentError, "request must be provided" if request.nil?
1031
+
1032
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::UpdateFeatureRequest
1033
+
1034
+ # Converts hash and nil to an options object
1035
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1036
+
1037
+ # Customize the options with defaults
1038
+ metadata = @config.rpcs.update_feature.metadata.to_h
1039
+
1040
+ # Set x-goog-api-client and x-goog-user-project headers
1041
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1042
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1043
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
1044
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1045
+
1046
+ header_params = {
1047
+ "name" => request.name
1048
+ }
1049
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1050
+ metadata[:"x-goog-request-params"] ||= request_params_header
1051
+
1052
+ options.apply_defaults timeout: @config.rpcs.update_feature.timeout,
1053
+ metadata: metadata,
1054
+ retry_policy: @config.rpcs.update_feature.retry_policy
1055
+
1056
+ options.apply_defaults timeout: @config.timeout,
1057
+ metadata: @config.metadata,
1058
+ retry_policy: @config.retry_policy
1059
+
1060
+ @gke_hub_stub.call_rpc :update_feature, request, options: options do |response, operation|
1061
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1062
+ yield response, operation if block_given?
1063
+ return response
1064
+ end
1065
+ rescue ::GRPC::BadStatus => e
1066
+ raise ::Google::Cloud::Error.from_error(e)
1067
+ end
1068
+
1069
+ ##
1070
+ # Generates the manifest for deployment of the GKE connect agent.
1071
+ #
1072
+ # **This method is used internally by Google-provided libraries.**
1073
+ # Most clients should not need to call this method directly.
1074
+ #
1075
+ # @overload generate_connect_manifest(request, options = nil)
1076
+ # Pass arguments to `generate_connect_manifest` via a request object, either of type
1077
+ # {::Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest} or an equivalent Hash.
1078
+ #
1079
+ # @param request [::Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest, ::Hash]
1080
+ # A request object representing the call parameters. Required. To specify no
1081
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1082
+ # @param options [::Gapic::CallOptions, ::Hash]
1083
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1084
+ #
1085
+ # @overload generate_connect_manifest(name: nil, namespace: nil, proxy: nil, version: nil, is_upgrade: nil, registry: nil, image_pull_secret_content: nil)
1086
+ # Pass arguments to `generate_connect_manifest` via keyword arguments. Note that at
1087
+ # least one keyword argument is required. To specify no parameters, or to keep all
1088
+ # the default parameter values, pass an empty Hash as a request object (see above).
1089
+ #
1090
+ # @param name [::String]
1091
+ # Required. The Membership resource name the Agent will associate with, in the format
1092
+ # `projects/*/locations/*/memberships/*`.
1093
+ # @param namespace [::String]
1094
+ # Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
1095
+ #
1096
+ # The Connect Agent is authorized automatically when run in the default
1097
+ # namespace. Otherwise, explicit authorization must be granted with an
1098
+ # additional IAM binding.
1099
+ # @param proxy [::String]
1100
+ # Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
1101
+ # requires the use of a proxy. Format must be in the form
1102
+ # `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
1103
+ # supported by the proxy. This will direct the connect agent's outbound
1104
+ # traffic through a HTTP(S) proxy.
1105
+ # @param version [::String]
1106
+ # Optional. The Connect agent version to use. Defaults to the most current version.
1107
+ # @param is_upgrade [::Boolean]
1108
+ # Optional. If true, generate the resources for upgrade only. Some resources
1109
+ # generated only for installation (e.g. secrets) will be excluded.
1110
+ # @param registry [::String]
1111
+ # Optional. The registry to fetch the connect agent image from. Defaults to
1112
+ # gcr.io/gkeconnect.
1113
+ # @param image_pull_secret_content [::String]
1114
+ # Optional. The image pull secret content for the registry, if not public.
1115
+ #
1116
+ # @yield [response, operation] Access the result along with the RPC operation
1117
+ # @yieldparam response [::Google::Cloud::GkeHub::V1::GenerateConnectManifestResponse]
1118
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1119
+ #
1120
+ # @return [::Google::Cloud::GkeHub::V1::GenerateConnectManifestResponse]
1121
+ #
1122
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1123
+ #
1124
+ def generate_connect_manifest request, options = nil
1125
+ raise ::ArgumentError, "request must be provided" if request.nil?
1126
+
1127
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest
1128
+
1129
+ # Converts hash and nil to an options object
1130
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1131
+
1132
+ # Customize the options with defaults
1133
+ metadata = @config.rpcs.generate_connect_manifest.metadata.to_h
1134
+
1135
+ # Set x-goog-api-client and x-goog-user-project headers
1136
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1137
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1138
+ gapic_version: ::Google::Cloud::GkeHub::V1::VERSION
1139
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1140
+
1141
+ header_params = {
1142
+ "name" => request.name
1143
+ }
1144
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1145
+ metadata[:"x-goog-request-params"] ||= request_params_header
1146
+
1147
+ options.apply_defaults timeout: @config.rpcs.generate_connect_manifest.timeout,
1148
+ metadata: metadata,
1149
+ retry_policy: @config.rpcs.generate_connect_manifest.retry_policy
1150
+
1151
+ options.apply_defaults timeout: @config.timeout,
1152
+ metadata: @config.metadata,
1153
+ retry_policy: @config.retry_policy
1154
+
1155
+ @gke_hub_stub.call_rpc :generate_connect_manifest, request, options: options do |response, operation|
1156
+ yield response, operation if block_given?
1157
+ return response
1158
+ end
1159
+ rescue ::GRPC::BadStatus => e
1160
+ raise ::Google::Cloud::Error.from_error(e)
1161
+ end
1162
+
1163
+ ##
1164
+ # Configuration class for the GkeHub API.
1165
+ #
1166
+ # This class represents the configuration for GkeHub,
1167
+ # providing control over timeouts, retry behavior, logging, transport
1168
+ # parameters, and other low-level controls. Certain parameters can also be
1169
+ # applied individually to specific RPCs. See
1170
+ # {::Google::Cloud::GkeHub::V1::GkeHub::Client::Configuration::Rpcs}
1171
+ # for a list of RPCs that can be configured independently.
1172
+ #
1173
+ # Configuration can be applied globally to all clients, or to a single client
1174
+ # on construction.
1175
+ #
1176
+ # @example
1177
+ #
1178
+ # # Modify the global config, setting the timeout for
1179
+ # # list_memberships to 20 seconds,
1180
+ # # and all remaining timeouts to 10 seconds.
1181
+ # ::Google::Cloud::GkeHub::V1::GkeHub::Client.configure do |config|
1182
+ # config.timeout = 10.0
1183
+ # config.rpcs.list_memberships.timeout = 20.0
1184
+ # end
1185
+ #
1186
+ # # Apply the above configuration only to a new client.
1187
+ # client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config|
1188
+ # config.timeout = 10.0
1189
+ # config.rpcs.list_memberships.timeout = 20.0
1190
+ # end
1191
+ #
1192
+ # @!attribute [rw] endpoint
1193
+ # The hostname or hostname:port of the service endpoint.
1194
+ # Defaults to `"gkehub.googleapis.com"`.
1195
+ # @return [::String]
1196
+ # @!attribute [rw] credentials
1197
+ # Credentials to send with calls. You may provide any of the following types:
1198
+ # * (`String`) The path to a service account key file in JSON format
1199
+ # * (`Hash`) A service account key as a Hash
1200
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1201
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1202
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1203
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1204
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1205
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1206
+ # * (`nil`) indicating no credentials
1207
+ # @return [::Object]
1208
+ # @!attribute [rw] scope
1209
+ # The OAuth scopes
1210
+ # @return [::Array<::String>]
1211
+ # @!attribute [rw] lib_name
1212
+ # The library name as recorded in instrumentation and logging
1213
+ # @return [::String]
1214
+ # @!attribute [rw] lib_version
1215
+ # The library version as recorded in instrumentation and logging
1216
+ # @return [::String]
1217
+ # @!attribute [rw] channel_args
1218
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1219
+ # `GRPC::Core::Channel` object is provided as the credential.
1220
+ # @return [::Hash]
1221
+ # @!attribute [rw] interceptors
1222
+ # An array of interceptors that are run before calls are executed.
1223
+ # @return [::Array<::GRPC::ClientInterceptor>]
1224
+ # @!attribute [rw] timeout
1225
+ # The call timeout in seconds.
1226
+ # @return [::Numeric]
1227
+ # @!attribute [rw] metadata
1228
+ # Additional gRPC headers to be sent with the call.
1229
+ # @return [::Hash{::Symbol=>::String}]
1230
+ # @!attribute [rw] retry_policy
1231
+ # The retry policy. The value is a hash with the following keys:
1232
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1233
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1234
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1235
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1236
+ # trigger a retry.
1237
+ # @return [::Hash]
1238
+ # @!attribute [rw] quota_project
1239
+ # A separate project against which to charge quota.
1240
+ # @return [::String]
1241
+ #
1242
+ class Configuration
1243
+ extend ::Gapic::Config
1244
+
1245
+ config_attr :endpoint, "gkehub.googleapis.com", ::String
1246
+ config_attr :credentials, nil do |value|
1247
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1248
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1249
+ allowed.any? { |klass| klass === value }
1250
+ end
1251
+ config_attr :scope, nil, ::String, ::Array, nil
1252
+ config_attr :lib_name, nil, ::String, nil
1253
+ config_attr :lib_version, nil, ::String, nil
1254
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1255
+ config_attr :interceptors, nil, ::Array, nil
1256
+ config_attr :timeout, nil, ::Numeric, nil
1257
+ config_attr :metadata, nil, ::Hash, nil
1258
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1259
+ config_attr :quota_project, nil, ::String, nil
1260
+
1261
+ # @private
1262
+ def initialize parent_config = nil
1263
+ @parent_config = parent_config unless parent_config.nil?
1264
+
1265
+ yield self if block_given?
1266
+ end
1267
+
1268
+ ##
1269
+ # Configurations for individual RPCs
1270
+ # @return [Rpcs]
1271
+ #
1272
+ def rpcs
1273
+ @rpcs ||= begin
1274
+ parent_rpcs = nil
1275
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1276
+ Rpcs.new parent_rpcs
1277
+ end
1278
+ end
1279
+
1280
+ ##
1281
+ # Configuration RPC class for the GkeHub API.
1282
+ #
1283
+ # Includes fields providing the configuration for each RPC in this service.
1284
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1285
+ # the following configuration fields:
1286
+ #
1287
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1288
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1289
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1290
+ # include the following keys:
1291
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1292
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1293
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1294
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1295
+ # trigger a retry.
1296
+ #
1297
+ class Rpcs
1298
+ ##
1299
+ # RPC-specific configuration for `list_memberships`
1300
+ # @return [::Gapic::Config::Method]
1301
+ #
1302
+ attr_reader :list_memberships
1303
+ ##
1304
+ # RPC-specific configuration for `list_features`
1305
+ # @return [::Gapic::Config::Method]
1306
+ #
1307
+ attr_reader :list_features
1308
+ ##
1309
+ # RPC-specific configuration for `get_membership`
1310
+ # @return [::Gapic::Config::Method]
1311
+ #
1312
+ attr_reader :get_membership
1313
+ ##
1314
+ # RPC-specific configuration for `get_feature`
1315
+ # @return [::Gapic::Config::Method]
1316
+ #
1317
+ attr_reader :get_feature
1318
+ ##
1319
+ # RPC-specific configuration for `create_membership`
1320
+ # @return [::Gapic::Config::Method]
1321
+ #
1322
+ attr_reader :create_membership
1323
+ ##
1324
+ # RPC-specific configuration for `create_feature`
1325
+ # @return [::Gapic::Config::Method]
1326
+ #
1327
+ attr_reader :create_feature
1328
+ ##
1329
+ # RPC-specific configuration for `delete_membership`
1330
+ # @return [::Gapic::Config::Method]
1331
+ #
1332
+ attr_reader :delete_membership
1333
+ ##
1334
+ # RPC-specific configuration for `delete_feature`
1335
+ # @return [::Gapic::Config::Method]
1336
+ #
1337
+ attr_reader :delete_feature
1338
+ ##
1339
+ # RPC-specific configuration for `update_membership`
1340
+ # @return [::Gapic::Config::Method]
1341
+ #
1342
+ attr_reader :update_membership
1343
+ ##
1344
+ # RPC-specific configuration for `update_feature`
1345
+ # @return [::Gapic::Config::Method]
1346
+ #
1347
+ attr_reader :update_feature
1348
+ ##
1349
+ # RPC-specific configuration for `generate_connect_manifest`
1350
+ # @return [::Gapic::Config::Method]
1351
+ #
1352
+ attr_reader :generate_connect_manifest
1353
+
1354
+ # @private
1355
+ def initialize parent_rpcs = nil
1356
+ list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships
1357
+ @list_memberships = ::Gapic::Config::Method.new list_memberships_config
1358
+ list_features_config = parent_rpcs.list_features if parent_rpcs.respond_to? :list_features
1359
+ @list_features = ::Gapic::Config::Method.new list_features_config
1360
+ get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership
1361
+ @get_membership = ::Gapic::Config::Method.new get_membership_config
1362
+ get_feature_config = parent_rpcs.get_feature if parent_rpcs.respond_to? :get_feature
1363
+ @get_feature = ::Gapic::Config::Method.new get_feature_config
1364
+ create_membership_config = parent_rpcs.create_membership if parent_rpcs.respond_to? :create_membership
1365
+ @create_membership = ::Gapic::Config::Method.new create_membership_config
1366
+ create_feature_config = parent_rpcs.create_feature if parent_rpcs.respond_to? :create_feature
1367
+ @create_feature = ::Gapic::Config::Method.new create_feature_config
1368
+ delete_membership_config = parent_rpcs.delete_membership if parent_rpcs.respond_to? :delete_membership
1369
+ @delete_membership = ::Gapic::Config::Method.new delete_membership_config
1370
+ delete_feature_config = parent_rpcs.delete_feature if parent_rpcs.respond_to? :delete_feature
1371
+ @delete_feature = ::Gapic::Config::Method.new delete_feature_config
1372
+ update_membership_config = parent_rpcs.update_membership if parent_rpcs.respond_to? :update_membership
1373
+ @update_membership = ::Gapic::Config::Method.new update_membership_config
1374
+ update_feature_config = parent_rpcs.update_feature if parent_rpcs.respond_to? :update_feature
1375
+ @update_feature = ::Gapic::Config::Method.new update_feature_config
1376
+ generate_connect_manifest_config = parent_rpcs.generate_connect_manifest if parent_rpcs.respond_to? :generate_connect_manifest
1377
+ @generate_connect_manifest = ::Gapic::Config::Method.new generate_connect_manifest_config
1378
+
1379
+ yield self if block_given?
1380
+ end
1381
+ end
1382
+ end
1383
+ end
1384
+ end
1385
+ end
1386
+ end
1387
+ end
1388
+ end