google-cloud-binary_authorization-v1beta1 0.3.3 → 0.4.1

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.
@@ -47,13 +47,12 @@ module Google
47
47
  # See {::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client::Configuration}
48
48
  # for a description of the configuration fields.
49
49
  #
50
- # ## Example
50
+ # @example
51
51
  #
52
- # To modify the configuration for all BinauthzManagementService clients:
53
- #
54
- # ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.configure do |config|
55
- # config.timeout = 10.0
56
- # end
52
+ # # Modify the configuration for all BinauthzManagementService clients
53
+ # ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
57
56
  #
58
57
  # @yield [config] Configure the Client client.
59
58
  # @yieldparam config [Client::Configuration]
@@ -132,19 +131,15 @@ module Google
132
131
  ##
133
132
  # Create a new BinauthzManagementService client object.
134
133
  #
135
- # ## Examples
136
- #
137
- # To create a new BinauthzManagementService client with the default
138
- # configuration:
139
- #
140
- # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
134
+ # @example
141
135
  #
142
- # To create a new BinauthzManagementService client with a custom
143
- # configuration:
136
+ # # Create a client using the default configuration
137
+ # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
144
138
  #
145
- # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config|
146
- # config.timeout = 10.0
147
- # end
139
+ # # Create a client using a custom configuration
140
+ # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config|
141
+ # config.timeout = 10.0
142
+ # end
148
143
  #
149
144
  # @yield [config] Configure the BinauthzManagementService client.
150
145
  # @yieldparam config [Client::Configuration]
@@ -164,10 +159,9 @@ module Google
164
159
 
165
160
  # Create credentials
166
161
  credentials = @config.credentials
167
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
162
+ # Use self-signed JWT if the endpoint is unchanged from default,
168
163
  # but only if the default endpoint does not have a region prefix.
169
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
170
- @config.endpoint == Client.configure.endpoint &&
164
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
171
165
  !@config.endpoint.split(".").first.include?("-")
172
166
  credentials ||= Credentials.default scope: @config.scope,
173
167
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -189,16 +183,13 @@ module Google
189
183
  # Service calls
190
184
 
191
185
  ##
192
- # A {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} specifies the
193
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} that must
194
- # attest to a container image, before the project is allowed to deploy that
186
+ # A {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} specifies the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} that must attest to
187
+ # a container image, before the project is allowed to deploy that
195
188
  # image. There is at most one policy per project. All image admission
196
189
  # requests are permitted if a project has no policy.
197
190
  #
198
- # Gets the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} for this
199
- # project. Returns a default
200
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} if the project
201
- # does not have one.
191
+ # Gets the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} for this project. Returns a default
192
+ # {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} if the project does not have one.
202
193
  #
203
194
  # @overload get_policy(request, options = nil)
204
195
  # Pass arguments to `get_policy` via a request object, either of type
@@ -216,9 +207,8 @@ module Google
216
207
  # the default parameter values, pass an empty Hash as a request object (see above).
217
208
  #
218
209
  # @param name [::String]
219
- # Required. The resource name of the
220
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} to retrieve, in
221
- # the format `projects/*/policy`.
210
+ # Required. The resource name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} to retrieve,
211
+ # in the format `projects/*/policy`.
222
212
  #
223
213
  # @yield [response, operation] Access the result along with the RPC operation
224
214
  # @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
@@ -228,6 +218,21 @@ module Google
228
218
  #
229
219
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
230
220
  #
221
+ # @example Basic example
222
+ # require "google/cloud/binary_authorization/v1beta1"
223
+ #
224
+ # # Create a client object. The client can be reused for multiple calls.
225
+ # client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
226
+ #
227
+ # # Create a request. To set request fields, pass in keyword arguments.
228
+ # request = Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest.new
229
+ #
230
+ # # Call the get_policy method.
231
+ # result = client.get_policy request
232
+ #
233
+ # # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy.
234
+ # p result
235
+ #
231
236
  def get_policy request, options = nil
232
237
  raise ::ArgumentError, "request must be provided" if request.nil?
233
238
 
@@ -245,16 +250,20 @@ module Google
245
250
  gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
246
251
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
247
252
 
248
- header_params = {
249
- "name" => request.name
250
- }
253
+ header_params = {}
254
+ if request.name
255
+ header_params["name"] = request.name
256
+ end
257
+
251
258
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
252
259
  metadata[:"x-goog-request-params"] ||= request_params_header
253
260
 
254
261
  options.apply_defaults timeout: @config.rpcs.get_policy.timeout,
255
262
  metadata: metadata,
256
263
  retry_policy: @config.rpcs.get_policy.retry_policy
257
- options.apply_defaults metadata: @config.metadata,
264
+
265
+ options.apply_defaults timeout: @config.timeout,
266
+ metadata: @config.metadata,
258
267
  retry_policy: @config.retry_policy
259
268
 
260
269
  @binauthz_management_service_stub.call_rpc :get_policy, request, options: options do |response, operation|
@@ -266,13 +275,11 @@ module Google
266
275
  end
267
276
 
268
277
  ##
269
- # Creates or updates a project's
270
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}, and returns a
271
- # copy of the new {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}.
272
- # A policy is always updated as a whole, to avoid race conditions with
273
- # concurrent policy enforcement (or management!) requests. Returns NOT_FOUND
274
- # if the project does not exist, INVALID_ARGUMENT if the request is
275
- # malformed.
278
+ # Creates or updates a project's {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}, and returns a copy of the
279
+ # new {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}. A policy is always updated as a whole, to avoid race
280
+ # conditions with concurrent policy enforcement (or management!)
281
+ # requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT
282
+ # if the request is malformed.
276
283
  #
277
284
  # @overload update_policy(request, options = nil)
278
285
  # Pass arguments to `update_policy` via a request object, either of type
@@ -290,11 +297,9 @@ module Google
290
297
  # the default parameter values, pass an empty Hash as a request object (see above).
291
298
  #
292
299
  # @param policy [::Google::Cloud::BinaryAuthorization::V1beta1::Policy, ::Hash]
293
- # Required. A new or updated
294
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} value. The
295
- # service will overwrite the [policy
296
- # name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
297
- # resource name in the request URL, in the format `projects/*/policy`.
300
+ # Required. A new or updated {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} value. The service will
301
+ # overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy#name policy name} field with the resource name in
302
+ # the request URL, in the format `projects/*/policy`.
298
303
  #
299
304
  # @yield [response, operation] Access the result along with the RPC operation
300
305
  # @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
@@ -304,6 +309,21 @@ module Google
304
309
  #
305
310
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
306
311
  #
312
+ # @example Basic example
313
+ # require "google/cloud/binary_authorization/v1beta1"
314
+ #
315
+ # # Create a client object. The client can be reused for multiple calls.
316
+ # client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
317
+ #
318
+ # # Create a request. To set request fields, pass in keyword arguments.
319
+ # request = Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest.new
320
+ #
321
+ # # Call the update_policy method.
322
+ # result = client.update_policy request
323
+ #
324
+ # # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy.
325
+ # p result
326
+ #
307
327
  def update_policy request, options = nil
308
328
  raise ::ArgumentError, "request must be provided" if request.nil?
309
329
 
@@ -321,16 +341,20 @@ module Google
321
341
  gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
322
342
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
323
343
 
324
- header_params = {
325
- "policy.name" => request.policy.name
326
- }
344
+ header_params = {}
345
+ if request.policy&.name
346
+ header_params["policy.name"] = request.policy.name
347
+ end
348
+
327
349
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
328
350
  metadata[:"x-goog-request-params"] ||= request_params_header
329
351
 
330
352
  options.apply_defaults timeout: @config.rpcs.update_policy.timeout,
331
353
  metadata: metadata,
332
354
  retry_policy: @config.rpcs.update_policy.retry_policy
333
- options.apply_defaults metadata: @config.metadata,
355
+
356
+ options.apply_defaults timeout: @config.timeout,
357
+ metadata: @config.metadata,
334
358
  retry_policy: @config.retry_policy
335
359
 
336
360
  @binauthz_management_service_stub.call_rpc :update_policy, request, options: options do |response, operation|
@@ -342,13 +366,10 @@ module Google
342
366
  end
343
367
 
344
368
  ##
345
- # Creates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor},
346
- # and returns a copy of the new
347
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns
348
- # NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is
349
- # malformed, ALREADY_EXISTS if the
350
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} already
351
- # exists.
369
+ # Creates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}, and returns a copy of the new
370
+ # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns NOT_FOUND if the project does not exist,
371
+ # INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the
372
+ # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} already exists.
352
373
  #
353
374
  # @overload create_attestor(request, options = nil)
354
375
  # Pass arguments to `create_attestor` via a request object, either of type
@@ -366,17 +387,13 @@ module Google
366
387
  # the default parameter values, pass an empty Hash as a request object (see above).
367
388
  #
368
389
  # @param parent [::String]
369
- # Required. The parent of this
370
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
390
+ # Required. The parent of this {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
371
391
  # @param attestor_id [::String]
372
- # Required. The
373
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} ID.
392
+ # Required. The {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} ID.
374
393
  # @param attestor [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash]
375
- # Required. The initial
376
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The
377
- # service will overwrite the [attestor
378
- # name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
379
- # the resource name, in the format `projects/*/attestors/*`.
394
+ # Required. The initial {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The service will
395
+ # overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor#name attestor name} field with the resource name,
396
+ # in the format `projects/*/attestors/*`.
380
397
  #
381
398
  # @yield [response, operation] Access the result along with the RPC operation
382
399
  # @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
@@ -386,6 +403,21 @@ module Google
386
403
  #
387
404
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
388
405
  #
406
+ # @example Basic example
407
+ # require "google/cloud/binary_authorization/v1beta1"
408
+ #
409
+ # # Create a client object. The client can be reused for multiple calls.
410
+ # client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
411
+ #
412
+ # # Create a request. To set request fields, pass in keyword arguments.
413
+ # request = Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest.new
414
+ #
415
+ # # Call the create_attestor method.
416
+ # result = client.create_attestor request
417
+ #
418
+ # # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor.
419
+ # p result
420
+ #
389
421
  def create_attestor request, options = nil
390
422
  raise ::ArgumentError, "request must be provided" if request.nil?
391
423
 
@@ -403,16 +435,20 @@ module Google
403
435
  gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
404
436
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
405
437
 
406
- header_params = {
407
- "parent" => request.parent
408
- }
438
+ header_params = {}
439
+ if request.parent
440
+ header_params["parent"] = request.parent
441
+ end
442
+
409
443
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
410
444
  metadata[:"x-goog-request-params"] ||= request_params_header
411
445
 
412
446
  options.apply_defaults timeout: @config.rpcs.create_attestor.timeout,
413
447
  metadata: metadata,
414
448
  retry_policy: @config.rpcs.create_attestor.retry_policy
415
- options.apply_defaults metadata: @config.metadata,
449
+
450
+ options.apply_defaults timeout: @config.timeout,
451
+ metadata: @config.metadata,
416
452
  retry_policy: @config.retry_policy
417
453
 
418
454
  @binauthz_management_service_stub.call_rpc :create_attestor, request, options: options do |response, operation|
@@ -425,9 +461,7 @@ module Google
425
461
 
426
462
  ##
427
463
  # Gets an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
428
- # Returns NOT_FOUND if the
429
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not
430
- # exist.
464
+ # Returns NOT_FOUND if the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
431
465
  #
432
466
  # @overload get_attestor(request, options = nil)
433
467
  # Pass arguments to `get_attestor` via a request object, either of type
@@ -445,9 +479,8 @@ module Google
445
479
  # the default parameter values, pass an empty Hash as a request object (see above).
446
480
  #
447
481
  # @param name [::String]
448
- # Required. The name of the
449
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} to retrieve,
450
- # in the format `projects/*/attestors/*`.
482
+ # Required. The name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} to retrieve, in the format
483
+ # `projects/*/attestors/*`.
451
484
  #
452
485
  # @yield [response, operation] Access the result along with the RPC operation
453
486
  # @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
@@ -457,6 +490,21 @@ module Google
457
490
  #
458
491
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
459
492
  #
493
+ # @example Basic example
494
+ # require "google/cloud/binary_authorization/v1beta1"
495
+ #
496
+ # # Create a client object. The client can be reused for multiple calls.
497
+ # client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
498
+ #
499
+ # # Create a request. To set request fields, pass in keyword arguments.
500
+ # request = Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest.new
501
+ #
502
+ # # Call the get_attestor method.
503
+ # result = client.get_attestor request
504
+ #
505
+ # # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor.
506
+ # p result
507
+ #
460
508
  def get_attestor request, options = nil
461
509
  raise ::ArgumentError, "request must be provided" if request.nil?
462
510
 
@@ -474,16 +522,20 @@ module Google
474
522
  gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
475
523
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
476
524
 
477
- header_params = {
478
- "name" => request.name
479
- }
525
+ header_params = {}
526
+ if request.name
527
+ header_params["name"] = request.name
528
+ end
529
+
480
530
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
481
531
  metadata[:"x-goog-request-params"] ||= request_params_header
482
532
 
483
533
  options.apply_defaults timeout: @config.rpcs.get_attestor.timeout,
484
534
  metadata: metadata,
485
535
  retry_policy: @config.rpcs.get_attestor.retry_policy
486
- options.apply_defaults metadata: @config.metadata,
536
+
537
+ options.apply_defaults timeout: @config.timeout,
538
+ metadata: @config.metadata,
487
539
  retry_policy: @config.retry_policy
488
540
 
489
541
  @binauthz_management_service_stub.call_rpc :get_attestor, request, options: options do |response, operation|
@@ -496,9 +548,7 @@ module Google
496
548
 
497
549
  ##
498
550
  # Updates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
499
- # Returns NOT_FOUND if the
500
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not
501
- # exist.
551
+ # Returns NOT_FOUND if the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
502
552
  #
503
553
  # @overload update_attestor(request, options = nil)
504
554
  # Pass arguments to `update_attestor` via a request object, either of type
@@ -516,12 +566,9 @@ module Google
516
566
  # the default parameter values, pass an empty Hash as a request object (see above).
517
567
  #
518
568
  # @param attestor [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash]
519
- # Required. The updated
520
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The
521
- # service will overwrite the [attestor
522
- # name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
523
- # the resource name in the request URL, in the format
524
- # `projects/*/attestors/*`.
569
+ # Required. The updated {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The service will
570
+ # overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor#name attestor name} field with the resource name
571
+ # in the request URL, in the format `projects/*/attestors/*`.
525
572
  #
526
573
  # @yield [response, operation] Access the result along with the RPC operation
527
574
  # @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
@@ -531,6 +578,21 @@ module Google
531
578
  #
532
579
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
533
580
  #
581
+ # @example Basic example
582
+ # require "google/cloud/binary_authorization/v1beta1"
583
+ #
584
+ # # Create a client object. The client can be reused for multiple calls.
585
+ # client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
586
+ #
587
+ # # Create a request. To set request fields, pass in keyword arguments.
588
+ # request = Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest.new
589
+ #
590
+ # # Call the update_attestor method.
591
+ # result = client.update_attestor request
592
+ #
593
+ # # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor.
594
+ # p result
595
+ #
534
596
  def update_attestor request, options = nil
535
597
  raise ::ArgumentError, "request must be provided" if request.nil?
536
598
 
@@ -548,16 +610,20 @@ module Google
548
610
  gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
549
611
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
550
612
 
551
- header_params = {
552
- "attestor.name" => request.attestor.name
553
- }
613
+ header_params = {}
614
+ if request.attestor&.name
615
+ header_params["attestor.name"] = request.attestor.name
616
+ end
617
+
554
618
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
555
619
  metadata[:"x-goog-request-params"] ||= request_params_header
556
620
 
557
621
  options.apply_defaults timeout: @config.rpcs.update_attestor.timeout,
558
622
  metadata: metadata,
559
623
  retry_policy: @config.rpcs.update_attestor.retry_policy
560
- options.apply_defaults metadata: @config.metadata,
624
+
625
+ options.apply_defaults timeout: @config.timeout,
626
+ metadata: @config.metadata,
561
627
  retry_policy: @config.retry_policy
562
628
 
563
629
  @binauthz_management_service_stub.call_rpc :update_attestor, request, options: options do |response, operation|
@@ -589,16 +655,14 @@ module Google
589
655
  #
590
656
  # @param parent [::String]
591
657
  # Required. The resource name of the project associated with the
592
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors}, in the
593
- # format `projects/*`.
658
+ # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors}, in the format `projects/*`.
594
659
  # @param page_size [::Integer]
595
660
  # Requested page size. The server may return fewer results than requested. If
596
661
  # unspecified, the server will pick an appropriate default.
597
662
  # @param page_token [::String]
598
663
  # A token identifying a page of results the server should return. Typically,
599
- # this is the value of
600
- # {::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsResponse#next_page_token ListAttestorsResponse.next_page_token}
601
- # returned from the previous call to the `ListAttestors` method.
664
+ # this is the value of {::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsResponse#next_page_token ListAttestorsResponse.next_page_token} returned
665
+ # from the previous call to the `ListAttestors` method.
602
666
  #
603
667
  # @yield [response, operation] Access the result along with the RPC operation
604
668
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>]
@@ -608,6 +672,27 @@ module Google
608
672
  #
609
673
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
610
674
  #
675
+ # @example Basic example
676
+ # require "google/cloud/binary_authorization/v1beta1"
677
+ #
678
+ # # Create a client object. The client can be reused for multiple calls.
679
+ # client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
680
+ #
681
+ # # Create a request. To set request fields, pass in keyword arguments.
682
+ # request = Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest.new
683
+ #
684
+ # # Call the list_attestors method.
685
+ # result = client.list_attestors request
686
+ #
687
+ # # The returned object is of type Gapic::PagedEnumerable. You can
688
+ # # iterate over all elements by calling #each, and the enumerable
689
+ # # will lazily make API calls to fetch subsequent pages. Other
690
+ # # methods are also available for managing paging directly.
691
+ # result.each do |response|
692
+ # # Each element is of type ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor.
693
+ # p response
694
+ # end
695
+ #
611
696
  def list_attestors request, options = nil
612
697
  raise ::ArgumentError, "request must be provided" if request.nil?
613
698
 
@@ -625,16 +710,20 @@ module Google
625
710
  gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
626
711
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
627
712
 
628
- header_params = {
629
- "parent" => request.parent
630
- }
713
+ header_params = {}
714
+ if request.parent
715
+ header_params["parent"] = request.parent
716
+ end
717
+
631
718
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
632
719
  metadata[:"x-goog-request-params"] ||= request_params_header
633
720
 
634
721
  options.apply_defaults timeout: @config.rpcs.list_attestors.timeout,
635
722
  metadata: metadata,
636
723
  retry_policy: @config.rpcs.list_attestors.retry_policy
637
- options.apply_defaults metadata: @config.metadata,
724
+
725
+ options.apply_defaults timeout: @config.timeout,
726
+ metadata: @config.metadata,
638
727
  retry_policy: @config.retry_policy
639
728
 
640
729
  @binauthz_management_service_stub.call_rpc :list_attestors, request, options: options do |response, operation|
@@ -647,10 +736,8 @@ module Google
647
736
  end
648
737
 
649
738
  ##
650
- # Deletes an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
651
- # Returns NOT_FOUND if the
652
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not
653
- # exist.
739
+ # Deletes an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns NOT_FOUND if the
740
+ # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
654
741
  #
655
742
  # @overload delete_attestor(request, options = nil)
656
743
  # Pass arguments to `delete_attestor` via a request object, either of type
@@ -668,9 +755,8 @@ module Google
668
755
  # the default parameter values, pass an empty Hash as a request object (see above).
669
756
  #
670
757
  # @param name [::String]
671
- # Required. The name of the
672
- # {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} to delete,
673
- # in the format `projects/*/attestors/*`.
758
+ # Required. The name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} to delete, in the format
759
+ # `projects/*/attestors/*`.
674
760
  #
675
761
  # @yield [response, operation] Access the result along with the RPC operation
676
762
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -680,6 +766,21 @@ module Google
680
766
  #
681
767
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
682
768
  #
769
+ # @example Basic example
770
+ # require "google/cloud/binary_authorization/v1beta1"
771
+ #
772
+ # # Create a client object. The client can be reused for multiple calls.
773
+ # client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
774
+ #
775
+ # # Create a request. To set request fields, pass in keyword arguments.
776
+ # request = Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest.new
777
+ #
778
+ # # Call the delete_attestor method.
779
+ # result = client.delete_attestor request
780
+ #
781
+ # # The returned object is of type Google::Protobuf::Empty.
782
+ # p result
783
+ #
683
784
  def delete_attestor request, options = nil
684
785
  raise ::ArgumentError, "request must be provided" if request.nil?
685
786
 
@@ -697,16 +798,20 @@ module Google
697
798
  gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
698
799
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
699
800
 
700
- header_params = {
701
- "name" => request.name
702
- }
801
+ header_params = {}
802
+ if request.name
803
+ header_params["name"] = request.name
804
+ end
805
+
703
806
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
704
807
  metadata[:"x-goog-request-params"] ||= request_params_header
705
808
 
706
809
  options.apply_defaults timeout: @config.rpcs.delete_attestor.timeout,
707
810
  metadata: metadata,
708
811
  retry_policy: @config.rpcs.delete_attestor.retry_policy
709
- options.apply_defaults metadata: @config.metadata,
812
+
813
+ options.apply_defaults timeout: @config.timeout,
814
+ metadata: @config.metadata,
710
815
  retry_policy: @config.retry_policy
711
816
 
712
817
  @binauthz_management_service_stub.call_rpc :delete_attestor, request, options: options do |response, operation|
@@ -730,22 +835,21 @@ module Google
730
835
  # Configuration can be applied globally to all clients, or to a single client
731
836
  # on construction.
732
837
  #
733
- # # Examples
734
- #
735
- # To modify the global config, setting the timeout for get_policy
736
- # to 20 seconds, and all remaining timeouts to 10 seconds:
737
- #
738
- # ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.configure do |config|
739
- # config.timeout = 10.0
740
- # config.rpcs.get_policy.timeout = 20.0
741
- # end
742
- #
743
- # To apply the above configuration only to a new client:
744
- #
745
- # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config|
746
- # config.timeout = 10.0
747
- # config.rpcs.get_policy.timeout = 20.0
748
- # end
838
+ # @example
839
+ #
840
+ # # Modify the global config, setting the timeout for
841
+ # # get_policy to 20 seconds,
842
+ # # and all remaining timeouts to 10 seconds.
843
+ # ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.configure do |config|
844
+ # config.timeout = 10.0
845
+ # config.rpcs.get_policy.timeout = 20.0
846
+ # end
847
+ #
848
+ # # Apply the above configuration only to a new client.
849
+ # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config|
850
+ # config.timeout = 10.0
851
+ # config.rpcs.get_policy.timeout = 20.0
852
+ # end
749
853
  #
750
854
  # @!attribute [rw] endpoint
751
855
  # The hostname or hostname:port of the service endpoint.