google-cloud-gke_hub-v1beta1 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,8 +27,14 @@ module Google
27
27
  ##
28
28
  # Client for the GkeHubMembershipService service.
29
29
  #
30
- # GKE Hub CRUD API for the Membership resource.
31
- # The Membership service is currently only available in the global location.
30
+ # The GKE Hub MembershipService handles the registration of many Kubernetes
31
+ # clusters to Google Cloud, represented with the {::Google::Cloud::GkeHub::V1beta1::Membership Membership} resource.
32
+ #
33
+ # GKE Hub is currently only available in the global region.
34
+ #
35
+ # **Membership management may be non-trivial:** it is recommended to use one
36
+ # of the Google-provided client libraries or tools where possible when working
37
+ # with Membership resources.
32
38
  #
33
39
  class Client
34
40
  include Paths
@@ -42,13 +48,12 @@ module Google
42
48
  # See {::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client::Configuration}
43
49
  # for a description of the configuration fields.
44
50
  #
45
- # ## Example
46
- #
47
- # To modify the configuration for all GkeHubMembershipService clients:
51
+ # @example
48
52
  #
49
- # ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
53
+ # # Modify the configuration for all GkeHubMembershipService clients
54
+ # ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
52
57
  #
53
58
  # @yield [config] Configure the Client client.
54
59
  # @yieldparam config [Client::Configuration]
@@ -68,10 +73,7 @@ module Google
68
73
 
69
74
  default_config.timeout = 60.0
70
75
  default_config.retry_policy = {
71
- initial_delay: 1.0,
72
- max_delay: 10.0,
73
- multiplier: 1.3,
74
- retry_codes: [14]
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
75
77
  }
76
78
 
77
79
  default_config
@@ -103,19 +105,15 @@ module Google
103
105
  ##
104
106
  # Create a new GkeHubMembershipService client object.
105
107
  #
106
- # ## Examples
107
- #
108
- # To create a new GkeHubMembershipService client with the default
109
- # configuration:
110
- #
111
- # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
108
+ # @example
112
109
  #
113
- # To create a new GkeHubMembershipService client with a custom
114
- # configuration:
110
+ # # Create a client using the default configuration
111
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
115
112
  #
116
- # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config|
117
- # config.timeout = 10.0
118
- # end
113
+ # # Create a client using a custom configuration
114
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config|
115
+ # config.timeout = 10.0
116
+ # end
119
117
  #
120
118
  # @yield [config] Configure the GkeHubMembershipService client.
121
119
  # @yieldparam config [Client::Configuration]
@@ -135,14 +133,13 @@ module Google
135
133
 
136
134
  # Create credentials
137
135
  credentials = @config.credentials
138
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
136
+ # Use self-signed JWT if the endpoint is unchanged from default,
139
137
  # but only if the default endpoint does not have a region prefix.
140
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
141
- @config.endpoint == Client.configure.endpoint &&
138
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
142
139
  !@config.endpoint.split(".").first.include?("-")
143
140
  credentials ||= Credentials.default scope: @config.scope,
144
141
  enable_self_signed_jwt: enable_self_signed_jwt
145
- if credentials.is_a?(String) || credentials.is_a?(Hash)
142
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
146
143
  credentials = Credentials.new credentials, scope: @config.scope
147
144
  end
148
145
  @quota_project_id = @config.quota_project
@@ -233,6 +230,27 @@ module Google
233
230
  #
234
231
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
235
232
  #
233
+ # @example Basic example
234
+ # require "google/cloud/gke_hub/v1beta1"
235
+ #
236
+ # # Create a client object. The client can be reused for multiple calls.
237
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
238
+ #
239
+ # # Create a request. To set request fields, pass in keyword arguments.
240
+ # request = Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest.new
241
+ #
242
+ # # Call the list_memberships method.
243
+ # result = client.list_memberships request
244
+ #
245
+ # # The returned object is of type Gapic::PagedEnumerable. You can
246
+ # # iterate over all elements by calling #each, and the enumerable
247
+ # # will lazily make API calls to fetch subsequent pages. Other
248
+ # # methods are also available for managing paging directly.
249
+ # result.each do |response|
250
+ # # Each element is of type ::Google::Cloud::GkeHub::V1beta1::Membership.
251
+ # p response
252
+ # end
253
+ #
236
254
  def list_memberships request, options = nil
237
255
  raise ::ArgumentError, "request must be provided" if request.nil?
238
256
 
@@ -250,16 +268,20 @@ module Google
250
268
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
251
269
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
252
270
 
253
- header_params = {
254
- "parent" => request.parent
255
- }
271
+ header_params = {}
272
+ if request.parent
273
+ header_params["parent"] = request.parent
274
+ end
275
+
256
276
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
257
277
  metadata[:"x-goog-request-params"] ||= request_params_header
258
278
 
259
279
  options.apply_defaults timeout: @config.rpcs.list_memberships.timeout,
260
280
  metadata: metadata,
261
281
  retry_policy: @config.rpcs.list_memberships.retry_policy
262
- options.apply_defaults metadata: @config.metadata,
282
+
283
+ options.apply_defaults timeout: @config.timeout,
284
+ metadata: @config.metadata,
263
285
  retry_policy: @config.retry_policy
264
286
 
265
287
  @gke_hub_membership_service_stub.call_rpc :list_memberships, request, options: options do |response, operation|
@@ -301,6 +323,21 @@ module Google
301
323
  #
302
324
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
303
325
  #
326
+ # @example Basic example
327
+ # require "google/cloud/gke_hub/v1beta1"
328
+ #
329
+ # # Create a client object. The client can be reused for multiple calls.
330
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
331
+ #
332
+ # # Create a request. To set request fields, pass in keyword arguments.
333
+ # request = Google::Cloud::GkeHub::V1beta1::GetMembershipRequest.new
334
+ #
335
+ # # Call the get_membership method.
336
+ # result = client.get_membership request
337
+ #
338
+ # # The returned object is of type Google::Cloud::GkeHub::V1beta1::Membership.
339
+ # p result
340
+ #
304
341
  def get_membership request, options = nil
305
342
  raise ::ArgumentError, "request must be provided" if request.nil?
306
343
 
@@ -318,16 +355,20 @@ module Google
318
355
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
319
356
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
320
357
 
321
- header_params = {
322
- "name" => request.name
323
- }
358
+ header_params = {}
359
+ if request.name
360
+ header_params["name"] = request.name
361
+ end
362
+
324
363
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
325
364
  metadata[:"x-goog-request-params"] ||= request_params_header
326
365
 
327
366
  options.apply_defaults timeout: @config.rpcs.get_membership.timeout,
328
367
  metadata: metadata,
329
368
  retry_policy: @config.rpcs.get_membership.retry_policy
330
- options.apply_defaults metadata: @config.metadata,
369
+
370
+ options.apply_defaults timeout: @config.timeout,
371
+ metadata: @config.metadata,
331
372
  retry_policy: @config.retry_policy
332
373
 
333
374
  @gke_hub_membership_service_stub.call_rpc :get_membership, request, options: options do |response, operation|
@@ -339,7 +380,11 @@ module Google
339
380
  end
340
381
 
341
382
  ##
342
- # Adds a new Membership.
383
+ # Creates a new Membership.
384
+ #
385
+ # **This is currently only supported for GKE clusters on Google Cloud**.
386
+ # To register other clusters, follow the instructions at
387
+ # https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
343
388
  #
344
389
  # @overload create_membership(request, options = nil)
345
390
  # Pass arguments to `create_membership` via a request object, either of type
@@ -351,7 +396,7 @@ module Google
351
396
  # @param options [::Gapic::CallOptions, ::Hash]
352
397
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
353
398
  #
354
- # @overload create_membership(parent: nil, membership_id: nil, resource: nil)
399
+ # @overload create_membership(parent: nil, membership_id: nil, resource: nil, request_id: nil)
355
400
  # Pass arguments to `create_membership` via keyword arguments. Note that at
356
401
  # least one keyword argument is required. To specify no parameters, or to keep all
357
402
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -371,6 +416,20 @@ module Google
371
416
  # with a maximum length of 63 characters.
372
417
  # @param resource [::Google::Cloud::GkeHub::V1beta1::Membership, ::Hash]
373
418
  # Required. The membership to create.
419
+ # @param request_id [::String]
420
+ # Optional. A request ID to identify requests. Specify a unique request ID
421
+ # so that if you must retry your request, the server will know to ignore
422
+ # the request if it has already been completed. The server will guarantee
423
+ # that for at least 60 minutes after the first request.
424
+ #
425
+ # For example, consider a situation where you make an initial request and
426
+ # the request times out. If you make the request again with the same request
427
+ # ID, the server can check if original operation with the same request ID
428
+ # was received, and if so, will ignore the second request. This prevents
429
+ # clients from accidentally creating duplicate commitments.
430
+ #
431
+ # The request ID must be a valid UUID with the exception that zero UUID is
432
+ # not supported (00000000-0000-0000-0000-000000000000).
374
433
  #
375
434
  # @yield [response, operation] Access the result along with the RPC operation
376
435
  # @yieldparam response [::Gapic::Operation]
@@ -380,6 +439,28 @@ module Google
380
439
  #
381
440
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
382
441
  #
442
+ # @example Basic example
443
+ # require "google/cloud/gke_hub/v1beta1"
444
+ #
445
+ # # Create a client object. The client can be reused for multiple calls.
446
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
447
+ #
448
+ # # Create a request. To set request fields, pass in keyword arguments.
449
+ # request = Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest.new
450
+ #
451
+ # # Call the create_membership method.
452
+ # result = client.create_membership request
453
+ #
454
+ # # The returned object is of type Gapic::Operation. You can use this
455
+ # # object to check the status of an operation, cancel it, or wait
456
+ # # for results. Here is how to block until completion:
457
+ # result.wait_until_done! timeout: 60
458
+ # if result.response?
459
+ # p result.response
460
+ # else
461
+ # puts "Error!"
462
+ # end
463
+ #
383
464
  def create_membership request, options = nil
384
465
  raise ::ArgumentError, "request must be provided" if request.nil?
385
466
 
@@ -397,16 +478,20 @@ module Google
397
478
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
398
479
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
399
480
 
400
- header_params = {
401
- "parent" => request.parent
402
- }
481
+ header_params = {}
482
+ if request.parent
483
+ header_params["parent"] = request.parent
484
+ end
485
+
403
486
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
404
487
  metadata[:"x-goog-request-params"] ||= request_params_header
405
488
 
406
489
  options.apply_defaults timeout: @config.rpcs.create_membership.timeout,
407
490
  metadata: metadata,
408
491
  retry_policy: @config.rpcs.create_membership.retry_policy
409
- options.apply_defaults metadata: @config.metadata,
492
+
493
+ options.apply_defaults timeout: @config.timeout,
494
+ metadata: @config.metadata,
410
495
  retry_policy: @config.retry_policy
411
496
 
412
497
  @gke_hub_membership_service_stub.call_rpc :create_membership, request, options: options do |response, operation|
@@ -421,6 +506,10 @@ module Google
421
506
  ##
422
507
  # Removes a Membership.
423
508
  #
509
+ # **This is currently only supported for GKE clusters on Google Cloud**.
510
+ # To unregister other clusters, follow the instructions at
511
+ # https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
512
+ #
424
513
  # @overload delete_membership(request, options = nil)
425
514
  # Pass arguments to `delete_membership` via a request object, either of type
426
515
  # {::Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest} or an equivalent Hash.
@@ -431,7 +520,7 @@ module Google
431
520
  # @param options [::Gapic::CallOptions, ::Hash]
432
521
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
433
522
  #
434
- # @overload delete_membership(name: nil)
523
+ # @overload delete_membership(name: nil, request_id: nil)
435
524
  # Pass arguments to `delete_membership` via keyword arguments. Note that at
436
525
  # least one keyword argument is required. To specify no parameters, or to keep all
437
526
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -439,6 +528,20 @@ module Google
439
528
  # @param name [::String]
440
529
  # Required. The Membership resource name in the format
441
530
  # `projects/*/locations/*/memberships/*`.
531
+ # @param request_id [::String]
532
+ # Optional. A request ID to identify requests. Specify a unique request ID
533
+ # so that if you must retry your request, the server will know to ignore
534
+ # the request if it has already been completed. The server will guarantee
535
+ # that for at least 60 minutes after the first request.
536
+ #
537
+ # For example, consider a situation where you make an initial request and
538
+ # the request times out. If you make the request again with the same request
539
+ # ID, the server can check if original operation with the same request ID
540
+ # was received, and if so, will ignore the second request. This prevents
541
+ # clients from accidentally creating duplicate commitments.
542
+ #
543
+ # The request ID must be a valid UUID with the exception that zero UUID is
544
+ # not supported (00000000-0000-0000-0000-000000000000).
442
545
  #
443
546
  # @yield [response, operation] Access the result along with the RPC operation
444
547
  # @yieldparam response [::Gapic::Operation]
@@ -448,6 +551,28 @@ module Google
448
551
  #
449
552
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
450
553
  #
554
+ # @example Basic example
555
+ # require "google/cloud/gke_hub/v1beta1"
556
+ #
557
+ # # Create a client object. The client can be reused for multiple calls.
558
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
559
+ #
560
+ # # Create a request. To set request fields, pass in keyword arguments.
561
+ # request = Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest.new
562
+ #
563
+ # # Call the delete_membership method.
564
+ # result = client.delete_membership request
565
+ #
566
+ # # The returned object is of type Gapic::Operation. You can use this
567
+ # # object to check the status of an operation, cancel it, or wait
568
+ # # for results. Here is how to block until completion:
569
+ # result.wait_until_done! timeout: 60
570
+ # if result.response?
571
+ # p result.response
572
+ # else
573
+ # puts "Error!"
574
+ # end
575
+ #
451
576
  def delete_membership request, options = nil
452
577
  raise ::ArgumentError, "request must be provided" if request.nil?
453
578
 
@@ -465,16 +590,20 @@ module Google
465
590
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
466
591
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
467
592
 
468
- header_params = {
469
- "name" => request.name
470
- }
593
+ header_params = {}
594
+ if request.name
595
+ header_params["name"] = request.name
596
+ end
597
+
471
598
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
472
599
  metadata[:"x-goog-request-params"] ||= request_params_header
473
600
 
474
601
  options.apply_defaults timeout: @config.rpcs.delete_membership.timeout,
475
602
  metadata: metadata,
476
603
  retry_policy: @config.rpcs.delete_membership.retry_policy
477
- options.apply_defaults metadata: @config.metadata,
604
+
605
+ options.apply_defaults timeout: @config.timeout,
606
+ metadata: @config.metadata,
478
607
  retry_policy: @config.retry_policy
479
608
 
480
609
  @gke_hub_membership_service_stub.call_rpc :delete_membership, request, options: options do |response, operation|
@@ -499,7 +628,7 @@ module Google
499
628
  # @param options [::Gapic::CallOptions, ::Hash]
500
629
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
501
630
  #
502
- # @overload update_membership(name: nil, update_mask: nil, resource: nil)
631
+ # @overload update_membership(name: nil, update_mask: nil, resource: nil, request_id: nil)
503
632
  # Pass arguments to `update_membership` via keyword arguments. Note that at
504
633
  # least one keyword argument is required. To specify no parameters, or to keep all
505
634
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -517,6 +646,22 @@ module Google
517
646
  # If you are updating a map field, set the value of a key to null or empty
518
647
  # string to delete the key from the map. It's not possible to update a key's
519
648
  # value to the empty string.
649
+ # If you specify the update_mask to be a special path "*", fully replaces all
650
+ # user-modifiable fields to match `resource`.
651
+ # @param request_id [::String]
652
+ # Optional. A request ID to identify requests. Specify a unique request ID
653
+ # so that if you must retry your request, the server will know to ignore
654
+ # the request if it has already been completed. The server will guarantee
655
+ # that for at least 60 minutes after the first request.
656
+ #
657
+ # For example, consider a situation where you make an initial request and
658
+ # the request times out. If you make the request again with the same request
659
+ # ID, the server can check if original operation with the same request ID
660
+ # was received, and if so, will ignore the second request. This prevents
661
+ # clients from accidentally creating duplicate commitments.
662
+ #
663
+ # The request ID must be a valid UUID with the exception that zero UUID is
664
+ # not supported (00000000-0000-0000-0000-000000000000).
520
665
  #
521
666
  # @yield [response, operation] Access the result along with the RPC operation
522
667
  # @yieldparam response [::Gapic::Operation]
@@ -526,6 +671,28 @@ module Google
526
671
  #
527
672
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
528
673
  #
674
+ # @example Basic example
675
+ # require "google/cloud/gke_hub/v1beta1"
676
+ #
677
+ # # Create a client object. The client can be reused for multiple calls.
678
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
679
+ #
680
+ # # Create a request. To set request fields, pass in keyword arguments.
681
+ # request = Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest.new
682
+ #
683
+ # # Call the update_membership method.
684
+ # result = client.update_membership request
685
+ #
686
+ # # The returned object is of type Gapic::Operation. You can use this
687
+ # # object to check the status of an operation, cancel it, or wait
688
+ # # for results. Here is how to block until completion:
689
+ # result.wait_until_done! timeout: 60
690
+ # if result.response?
691
+ # p result.response
692
+ # else
693
+ # puts "Error!"
694
+ # end
695
+ #
529
696
  def update_membership request, options = nil
530
697
  raise ::ArgumentError, "request must be provided" if request.nil?
531
698
 
@@ -543,16 +710,20 @@ module Google
543
710
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
544
711
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
545
712
 
546
- header_params = {
547
- "name" => request.name
548
- }
713
+ header_params = {}
714
+ if request.name
715
+ header_params["name"] = request.name
716
+ end
717
+
549
718
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
550
719
  metadata[:"x-goog-request-params"] ||= request_params_header
551
720
 
552
721
  options.apply_defaults timeout: @config.rpcs.update_membership.timeout,
553
722
  metadata: metadata,
554
723
  retry_policy: @config.rpcs.update_membership.retry_policy
555
- options.apply_defaults metadata: @config.metadata,
724
+
725
+ options.apply_defaults timeout: @config.timeout,
726
+ metadata: @config.metadata,
556
727
  retry_policy: @config.retry_policy
557
728
 
558
729
  @gke_hub_membership_service_stub.call_rpc :update_membership, request, options: options do |response, operation|
@@ -567,6 +738,9 @@ module Google
567
738
  ##
568
739
  # Generates the manifest for deployment of the GKE connect agent.
569
740
  #
741
+ # **This method is used internally by Google-provided libraries.**
742
+ # Most clients should not need to call this method directly.
743
+ #
570
744
  # @overload generate_connect_manifest(request, options = nil)
571
745
  # Pass arguments to `generate_connect_manifest` via a request object, either of type
572
746
  # {::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest} or an equivalent Hash.
@@ -606,6 +780,21 @@ module Google
606
780
  #
607
781
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
608
782
  #
783
+ # @example Basic example
784
+ # require "google/cloud/gke_hub/v1beta1"
785
+ #
786
+ # # Create a client object. The client can be reused for multiple calls.
787
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
788
+ #
789
+ # # Create a request. To set request fields, pass in keyword arguments.
790
+ # request = Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest.new
791
+ #
792
+ # # Call the generate_connect_manifest method.
793
+ # result = client.generate_connect_manifest request
794
+ #
795
+ # # The returned object is of type Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestResponse.
796
+ # p result
797
+ #
609
798
  def generate_connect_manifest request, options = nil
610
799
  raise ::ArgumentError, "request must be provided" if request.nil?
611
800
 
@@ -623,16 +812,20 @@ module Google
623
812
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
624
813
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
625
814
 
626
- header_params = {
627
- "name" => request.name
628
- }
815
+ header_params = {}
816
+ if request.name
817
+ header_params["name"] = request.name
818
+ end
819
+
629
820
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
630
821
  metadata[:"x-goog-request-params"] ||= request_params_header
631
822
 
632
823
  options.apply_defaults timeout: @config.rpcs.generate_connect_manifest.timeout,
633
824
  metadata: metadata,
634
825
  retry_policy: @config.rpcs.generate_connect_manifest.retry_policy
635
- options.apply_defaults metadata: @config.metadata,
826
+
827
+ options.apply_defaults timeout: @config.timeout,
828
+ metadata: @config.metadata,
636
829
  retry_policy: @config.retry_policy
637
830
 
638
831
  @gke_hub_membership_service_stub.call_rpc :generate_connect_manifest, request, options: options do |response, operation|
@@ -680,6 +873,21 @@ module Google
680
873
  #
681
874
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
682
875
  #
876
+ # @example Basic example
877
+ # require "google/cloud/gke_hub/v1beta1"
878
+ #
879
+ # # Create a client object. The client can be reused for multiple calls.
880
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
881
+ #
882
+ # # Create a request. To set request fields, pass in keyword arguments.
883
+ # request = Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest.new
884
+ #
885
+ # # Call the validate_exclusivity method.
886
+ # result = client.validate_exclusivity request
887
+ #
888
+ # # The returned object is of type Google::Cloud::GkeHub::V1beta1::ValidateExclusivityResponse.
889
+ # p result
890
+ #
683
891
  def validate_exclusivity request, options = nil
684
892
  raise ::ArgumentError, "request must be provided" if request.nil?
685
893
 
@@ -697,16 +905,20 @@ module Google
697
905
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
698
906
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
699
907
 
700
- header_params = {
701
- "parent" => request.parent
702
- }
908
+ header_params = {}
909
+ if request.parent
910
+ header_params["parent"] = request.parent
911
+ end
912
+
703
913
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
704
914
  metadata[:"x-goog-request-params"] ||= request_params_header
705
915
 
706
916
  options.apply_defaults timeout: @config.rpcs.validate_exclusivity.timeout,
707
917
  metadata: metadata,
708
918
  retry_policy: @config.rpcs.validate_exclusivity.retry_policy
709
- options.apply_defaults metadata: @config.metadata,
919
+
920
+ options.apply_defaults timeout: @config.timeout,
921
+ metadata: @config.metadata,
710
922
  retry_policy: @config.retry_policy
711
923
 
712
924
  @gke_hub_membership_service_stub.call_rpc :validate_exclusivity, request, options: options do |response, operation|
@@ -766,6 +978,21 @@ module Google
766
978
  #
767
979
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
768
980
  #
981
+ # @example Basic example
982
+ # require "google/cloud/gke_hub/v1beta1"
983
+ #
984
+ # # Create a client object. The client can be reused for multiple calls.
985
+ # client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
986
+ #
987
+ # # Create a request. To set request fields, pass in keyword arguments.
988
+ # request = Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest.new
989
+ #
990
+ # # Call the generate_exclusivity_manifest method.
991
+ # result = client.generate_exclusivity_manifest request
992
+ #
993
+ # # The returned object is of type Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestResponse.
994
+ # p result
995
+ #
769
996
  def generate_exclusivity_manifest request, options = nil
770
997
  raise ::ArgumentError, "request must be provided" if request.nil?
771
998
 
@@ -783,16 +1010,20 @@ module Google
783
1010
  gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
784
1011
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
1012
 
786
- header_params = {
787
- "name" => request.name
788
- }
1013
+ header_params = {}
1014
+ if request.name
1015
+ header_params["name"] = request.name
1016
+ end
1017
+
789
1018
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
790
1019
  metadata[:"x-goog-request-params"] ||= request_params_header
791
1020
 
792
1021
  options.apply_defaults timeout: @config.rpcs.generate_exclusivity_manifest.timeout,
793
1022
  metadata: metadata,
794
1023
  retry_policy: @config.rpcs.generate_exclusivity_manifest.retry_policy
795
- options.apply_defaults metadata: @config.metadata,
1024
+
1025
+ options.apply_defaults timeout: @config.timeout,
1026
+ metadata: @config.metadata,
796
1027
  retry_policy: @config.retry_policy
797
1028
 
798
1029
  @gke_hub_membership_service_stub.call_rpc :generate_exclusivity_manifest, request, options: options do |response, operation|
@@ -816,22 +1047,21 @@ module Google
816
1047
  # Configuration can be applied globally to all clients, or to a single client
817
1048
  # on construction.
818
1049
  #
819
- # # Examples
820
- #
821
- # To modify the global config, setting the timeout for list_memberships
822
- # to 20 seconds, and all remaining timeouts to 10 seconds:
823
- #
824
- # ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.configure do |config|
825
- # config.timeout = 10.0
826
- # config.rpcs.list_memberships.timeout = 20.0
827
- # end
828
- #
829
- # To apply the above configuration only to a new client:
830
- #
831
- # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config|
832
- # config.timeout = 10.0
833
- # config.rpcs.list_memberships.timeout = 20.0
834
- # end
1050
+ # @example
1051
+ #
1052
+ # # Modify the global config, setting the timeout for
1053
+ # # list_memberships to 20 seconds,
1054
+ # # and all remaining timeouts to 10 seconds.
1055
+ # ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.configure do |config|
1056
+ # config.timeout = 10.0
1057
+ # config.rpcs.list_memberships.timeout = 20.0
1058
+ # end
1059
+ #
1060
+ # # Apply the above configuration only to a new client.
1061
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config|
1062
+ # config.timeout = 10.0
1063
+ # config.rpcs.list_memberships.timeout = 20.0
1064
+ # end
835
1065
  #
836
1066
  # @!attribute [rw] endpoint
837
1067
  # The hostname or hostname:port of the service endpoint.