google-cloud-gke_hub-v1beta1 0.1.2 → 0.2.2

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