google-cloud-run-v2 0.31.0 → 0.32.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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/run/v2/build_pb.rb +1 -1
  3. data/lib/google/cloud/run/v2/builds/client.rb +2 -2
  4. data/lib/google/cloud/run/v2/builds/credentials.rb +2 -1
  5. data/lib/google/cloud/run/v2/builds/rest/client.rb +2 -2
  6. data/lib/google/cloud/run/v2/condition_pb.rb +2 -1
  7. data/lib/google/cloud/run/v2/execution_pb.rb +1 -1
  8. data/lib/google/cloud/run/v2/execution_template_pb.rb +1 -1
  9. data/lib/google/cloud/run/v2/executions/credentials.rb +3 -1
  10. data/lib/google/cloud/run/v2/instance_pb.rb +7 -1
  11. data/lib/google/cloud/run/v2/instance_services_pb.rb +14 -2
  12. data/lib/google/cloud/run/v2/instances/client.rb +424 -12
  13. data/lib/google/cloud/run/v2/instances/credentials.rb +3 -1
  14. data/lib/google/cloud/run/v2/instances/rest/client.rb +393 -12
  15. data/lib/google/cloud/run/v2/instances/rest/service_stub.rb +247 -0
  16. data/lib/google/cloud/run/v2/job_pb.rb +1 -1
  17. data/lib/google/cloud/run/v2/jobs/client.rb +2 -1
  18. data/lib/google/cloud/run/v2/jobs/credentials.rb +3 -1
  19. data/lib/google/cloud/run/v2/jobs/rest/client.rb +2 -1
  20. data/lib/google/cloud/run/v2/k8s.min_pb.rb +3 -1
  21. data/lib/google/cloud/run/v2/rest.rb +1 -0
  22. data/lib/google/cloud/run/v2/revision_pb.rb +2 -1
  23. data/lib/google/cloud/run/v2/revision_template_pb.rb +2 -1
  24. data/lib/google/cloud/run/v2/revisions/credentials.rb +3 -1
  25. data/lib/google/cloud/run/v2/sandbox_pb.rb +25 -0
  26. data/lib/google/cloud/run/v2/service_pb.rb +1 -1
  27. data/lib/google/cloud/run/v2/services/client.rb +12 -2
  28. data/lib/google/cloud/run/v2/services/credentials.rb +3 -1
  29. data/lib/google/cloud/run/v2/services/rest/client.rb +12 -2
  30. data/lib/google/cloud/run/v2/source_upload/client.rb +505 -0
  31. data/lib/google/cloud/run/v2/source_upload/credentials.rb +48 -0
  32. data/lib/google/cloud/run/v2/source_upload/paths.rb +69 -0
  33. data/lib/google/cloud/run/v2/source_upload/rest/client.rb +452 -0
  34. data/lib/google/cloud/run/v2/source_upload/rest/service_stub.rb +143 -0
  35. data/lib/google/cloud/run/v2/source_upload/rest.rb +53 -0
  36. data/lib/google/cloud/run/v2/source_upload.rb +56 -0
  37. data/lib/google/cloud/run/v2/source_upload_pb.rb +29 -0
  38. data/lib/google/cloud/run/v2/source_upload_services_pb.rb +52 -0
  39. data/lib/google/cloud/run/v2/task_pb.rb +2 -1
  40. data/lib/google/cloud/run/v2/task_template_pb.rb +2 -1
  41. data/lib/google/cloud/run/v2/tasks/credentials.rb +3 -1
  42. data/lib/google/cloud/run/v2/vendor_settings_pb.rb +6 -1
  43. data/lib/google/cloud/run/v2/version.rb +1 -1
  44. data/lib/google/cloud/run/v2/worker_pool_pb.rb +1 -1
  45. data/lib/google/cloud/run/v2/worker_pool_revision_template_pb.rb +2 -1
  46. data/lib/google/cloud/run/v2/worker_pools/client.rb +2 -1
  47. data/lib/google/cloud/run/v2/worker_pools/credentials.rb +3 -1
  48. data/lib/google/cloud/run/v2/worker_pools/rest/client.rb +2 -1
  49. data/lib/google/cloud/run/v2.rb +1 -0
  50. data/proto_docs/google/cloud/run/v2/build.rb +2 -2
  51. data/proto_docs/google/cloud/run/v2/condition.rb +29 -3
  52. data/proto_docs/google/cloud/run/v2/execution.rb +7 -1
  53. data/proto_docs/google/cloud/run/v2/execution_template.rb +10 -0
  54. data/proto_docs/google/cloud/run/v2/instance.rb +74 -32
  55. data/proto_docs/google/cloud/run/v2/job.rb +9 -1
  56. data/proto_docs/google/cloud/run/v2/k8s.min.rb +78 -16
  57. data/proto_docs/google/cloud/run/v2/revision.rb +17 -2
  58. data/proto_docs/google/cloud/run/v2/revision_template.rb +16 -1
  59. data/proto_docs/google/cloud/run/v2/sandbox.rb +67 -0
  60. data/proto_docs/google/cloud/run/v2/service.rb +18 -1
  61. data/proto_docs/google/cloud/run/v2/source_upload.rb +48 -0
  62. data/proto_docs/google/cloud/run/v2/task.rb +6 -0
  63. data/proto_docs/google/cloud/run/v2/task_template.rb +6 -0
  64. data/proto_docs/google/cloud/run/v2/vendor_settings.rb +80 -2
  65. data/proto_docs/google/cloud/run/v2/worker_pool.rb +2 -1
  66. data/proto_docs/google/cloud/run/v2/worker_pool_revision_template.rb +9 -0
  67. metadata +13 -1
@@ -232,11 +232,14 @@ module Google
232
232
  # the default parameter values, pass an empty Hash as a request object (see above).
233
233
  #
234
234
  # @param parent [::String]
235
+ # Required. The location and project in which this Instance should be
236
+ # created.
235
237
  # @param instance [::Google::Cloud::Run::V2::Instance, ::Hash]
236
238
  # @param instance_id [::String]
237
- # Required. The unique identifier for the Instance. It must begin with
239
+ # Optional. The unique identifier for the Instance. It must begin with
238
240
  # letter, and cannot end with hyphen; must contain fewer than 50 characters.
239
241
  # The name of the instance becomes \\{parent}/instances/\\{instance_id}.
242
+ # If not provided, the server will generate a unique `instance_id`.
240
243
  # @param validate_only [::Boolean]
241
244
  # Optional. Indicates that the request should be validated and default values
242
245
  # populated, without persisting the request or creating any resources.
@@ -318,7 +321,113 @@ module Google
318
321
  end
319
322
 
320
323
  ##
321
- # Deletes a Instance
324
+ # Updates an Instance.
325
+ #
326
+ # @overload update_instance(request, options = nil)
327
+ # Pass arguments to `update_instance` via a request object, either of type
328
+ # {::Google::Cloud::Run::V2::UpdateInstanceRequest} or an equivalent Hash.
329
+ #
330
+ # @param request [::Google::Cloud::Run::V2::UpdateInstanceRequest, ::Hash]
331
+ # A request object representing the call parameters. Required. To specify no
332
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
333
+ # @param options [::Gapic::CallOptions, ::Hash]
334
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
335
+ #
336
+ # @overload update_instance(update_mask: nil, instance: nil, validate_only: nil, allow_missing: nil)
337
+ # Pass arguments to `update_instance` via keyword arguments. Note that at
338
+ # least one keyword argument is required. To specify no parameters, or to keep all
339
+ # the default parameter values, pass an empty Hash as a request object (see above).
340
+ #
341
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
342
+ # Optional. The list of fields to be updated.
343
+ # @param instance [::Google::Cloud::Run::V2::Instance, ::Hash]
344
+ # Required. The Instance to be updated.
345
+ # @param validate_only [::Boolean]
346
+ # Optional. Indicates that the request should be validated and default values
347
+ # populated, without persisting the request or updating any resources.
348
+ # @param allow_missing [::Boolean]
349
+ # Optional. If set to `true`, and if the Instance does not exist, it will
350
+ # create a new one. The caller must have `run.instances.create` permissions
351
+ # if this is set to `true` and the Instance does not exist.
352
+ #
353
+ # @yield [response, operation] Access the result along with the RPC operation
354
+ # @yieldparam response [::Gapic::Operation]
355
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
356
+ #
357
+ # @return [::Gapic::Operation]
358
+ #
359
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
360
+ #
361
+ # @example Basic example
362
+ # require "google/cloud/run/v2"
363
+ #
364
+ # # Create a client object. The client can be reused for multiple calls.
365
+ # client = Google::Cloud::Run::V2::Instances::Client.new
366
+ #
367
+ # # Create a request. To set request fields, pass in keyword arguments.
368
+ # request = Google::Cloud::Run::V2::UpdateInstanceRequest.new
369
+ #
370
+ # # Call the update_instance method.
371
+ # result = client.update_instance request
372
+ #
373
+ # # The returned object is of type Gapic::Operation. You can use it to
374
+ # # check the status of an operation, cancel it, or wait for results.
375
+ # # Here is how to wait for a response.
376
+ # result.wait_until_done! timeout: 60
377
+ # if result.response?
378
+ # p result.response
379
+ # else
380
+ # puts "No response received."
381
+ # end
382
+ #
383
+ def update_instance request, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request.nil?
385
+
386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::UpdateInstanceRequest
387
+
388
+ # Converts hash and nil to an options object
389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
+
391
+ # Customize the options with defaults
392
+ metadata = @config.rpcs.update_instance.metadata.to_h
393
+
394
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
397
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
398
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
399
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
400
+
401
+ header_params = {}
402
+ if request.instance&.name
403
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/(?<__wildcard__>.*))?$}.match request.instance.name
404
+ if regex_match
405
+ header_params["location"] = regex_match["location".to_s]
406
+ end
407
+ end
408
+
409
+ request_params_header = URI.encode_www_form header_params
410
+ metadata[:"x-goog-request-params"] ||= request_params_header
411
+
412
+ options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
413
+ metadata: metadata,
414
+ retry_policy: @config.rpcs.update_instance.retry_policy
415
+
416
+ options.apply_defaults timeout: @config.timeout,
417
+ metadata: @config.metadata,
418
+ retry_policy: @config.retry_policy
419
+
420
+ @instances_stub.call_rpc :update_instance, request, options: options do |response, operation|
421
+ response = ::Gapic::Operation.new response, @operations_client, options: options
422
+ yield response, operation if block_given?
423
+ throw :response, response
424
+ end
425
+ rescue ::GRPC::BadStatus => e
426
+ raise ::Google::Cloud::Error.from_error(e)
427
+ end
428
+
429
+ ##
430
+ # Deletes an Instance
322
431
  #
323
432
  # @overload delete_instance(request, options = nil)
324
433
  # Pass arguments to `delete_instance` via a request object, either of type
@@ -336,6 +445,7 @@ module Google
336
445
  # the default parameter values, pass an empty Hash as a request object (see above).
337
446
  #
338
447
  # @param name [::String]
448
+ # Required. The name of the Instance to delete.
339
449
  # @param validate_only [::Boolean]
340
450
  # Optional. Indicates that the request should be validated without actually
341
451
  # deleting any resources.
@@ -420,7 +530,7 @@ module Google
420
530
  end
421
531
 
422
532
  ##
423
- # Gets a Instance
533
+ # Gets an Instance
424
534
  #
425
535
  # @overload get_instance(request, options = nil)
426
536
  # Pass arguments to `get_instance` via a request object, either of type
@@ -438,6 +548,7 @@ module Google
438
548
  # the default parameter values, pass an empty Hash as a request object (see above).
439
549
  #
440
550
  # @param name [::String]
551
+ # Required. The name of the Instance to retrieve.
441
552
  #
442
553
  # @yield [response, operation] Access the result along with the RPC operation
443
554
  # @yieldparam response [::Google::Cloud::Run::V2::Instance]
@@ -526,8 +637,6 @@ module Google
526
637
  #
527
638
  # @param parent [::String]
528
639
  # Required. The location and project to list resources on.
529
- # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be
530
- # project id or number.
531
640
  # @param page_size [::Integer]
532
641
  # Optional. Maximum number of Instances to return in this call.
533
642
  # @param page_token [::String]
@@ -630,9 +739,6 @@ module Google
630
739
  #
631
740
  # @param name [::String]
632
741
  # Required. The name of the Instance to stop.
633
- # Format:
634
- # `projects/{project}/locations/{location}/instances/{instance}`,
635
- # where `{project}` can be project id or number.
636
742
  # @param validate_only [::Boolean]
637
743
  # Optional. Indicates that the request should be validated without actually
638
744
  # stopping any resources.
@@ -732,10 +838,7 @@ module Google
732
838
  # the default parameter values, pass an empty Hash as a request object (see above).
733
839
  #
734
840
  # @param name [::String]
735
- # Required. The name of the Instance to stop.
736
- # Format:
737
- # `projects/{project}/locations/{location}/instances/{instance}`,
738
- # where `{project}` can be project id or number.
841
+ # Required. The name of the Instance to start.
739
842
  # @param validate_only [::Boolean]
740
843
  # Optional. Indicates that the request should be validated without actually
741
844
  # stopping any resources.
@@ -816,6 +919,287 @@ module Google
816
919
  raise ::Google::Cloud::Error.from_error(e)
817
920
  end
818
921
 
922
+ ##
923
+ # Gets the IAM Access Control policy currently in effect for the given
924
+ # Instance. This result does not include any inherited policies.
925
+ #
926
+ # @overload get_iam_policy(request, options = nil)
927
+ # Pass arguments to `get_iam_policy` via a request object, either of type
928
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
929
+ #
930
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
931
+ # A request object representing the call parameters. Required. To specify no
932
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
933
+ # @param options [::Gapic::CallOptions, ::Hash]
934
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
935
+ #
936
+ # @overload get_iam_policy(resource: nil, options: nil)
937
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
938
+ # least one keyword argument is required. To specify no parameters, or to keep all
939
+ # the default parameter values, pass an empty Hash as a request object (see above).
940
+ #
941
+ # @param resource [::String]
942
+ # REQUIRED: The resource for which the policy is being requested.
943
+ # See the operation documentation for the appropriate value for this field.
944
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
945
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
946
+ # `GetIamPolicy`.
947
+ #
948
+ # @yield [response, operation] Access the result along with the RPC operation
949
+ # @yieldparam response [::Google::Iam::V1::Policy]
950
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
951
+ #
952
+ # @return [::Google::Iam::V1::Policy]
953
+ #
954
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
955
+ #
956
+ # @example Basic example
957
+ # require "google/cloud/run/v2"
958
+ #
959
+ # # Create a client object. The client can be reused for multiple calls.
960
+ # client = Google::Cloud::Run::V2::Instances::Client.new
961
+ #
962
+ # # Create a request. To set request fields, pass in keyword arguments.
963
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
964
+ #
965
+ # # Call the get_iam_policy method.
966
+ # result = client.get_iam_policy request
967
+ #
968
+ # # The returned object is of type Google::Iam::V1::Policy.
969
+ # p result
970
+ #
971
+ def get_iam_policy request, options = nil
972
+ raise ::ArgumentError, "request must be provided" if request.nil?
973
+
974
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
975
+
976
+ # Converts hash and nil to an options object
977
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
978
+
979
+ # Customize the options with defaults
980
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
981
+
982
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
983
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
984
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
985
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
986
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
987
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
988
+
989
+ header_params = {}
990
+ if request.resource
991
+ header_params["resource"] = request.resource
992
+ end
993
+
994
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
995
+ metadata[:"x-goog-request-params"] ||= request_params_header
996
+
997
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
998
+ metadata: metadata,
999
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1000
+
1001
+ options.apply_defaults timeout: @config.timeout,
1002
+ metadata: @config.metadata,
1003
+ retry_policy: @config.retry_policy
1004
+
1005
+ @instances_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1006
+ yield response, operation if block_given?
1007
+ end
1008
+ rescue ::GRPC::BadStatus => e
1009
+ raise ::Google::Cloud::Error.from_error(e)
1010
+ end
1011
+
1012
+ ##
1013
+ # Sets the IAM Access control policy for the specified Instance. Overwrites
1014
+ # any existing policy.
1015
+ #
1016
+ # @overload set_iam_policy(request, options = nil)
1017
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1018
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1019
+ #
1020
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1021
+ # A request object representing the call parameters. Required. To specify no
1022
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1023
+ # @param options [::Gapic::CallOptions, ::Hash]
1024
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1025
+ #
1026
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1027
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1028
+ # least one keyword argument is required. To specify no parameters, or to keep all
1029
+ # the default parameter values, pass an empty Hash as a request object (see above).
1030
+ #
1031
+ # @param resource [::String]
1032
+ # REQUIRED: The resource for which the policy is being specified.
1033
+ # See the operation documentation for the appropriate value for this field.
1034
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1035
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1036
+ # the policy is limited to a few 10s of KB. An empty policy is a
1037
+ # valid policy but certain Cloud Platform services (such as Projects)
1038
+ # might reject them.
1039
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1040
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1041
+ # the fields in the mask will be modified. If no mask is provided, the
1042
+ # following default mask is used:
1043
+ #
1044
+ # `paths: "bindings, etag"`
1045
+ #
1046
+ # @yield [response, operation] Access the result along with the RPC operation
1047
+ # @yieldparam response [::Google::Iam::V1::Policy]
1048
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1049
+ #
1050
+ # @return [::Google::Iam::V1::Policy]
1051
+ #
1052
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1053
+ #
1054
+ # @example Basic example
1055
+ # require "google/cloud/run/v2"
1056
+ #
1057
+ # # Create a client object. The client can be reused for multiple calls.
1058
+ # client = Google::Cloud::Run::V2::Instances::Client.new
1059
+ #
1060
+ # # Create a request. To set request fields, pass in keyword arguments.
1061
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1062
+ #
1063
+ # # Call the set_iam_policy method.
1064
+ # result = client.set_iam_policy request
1065
+ #
1066
+ # # The returned object is of type Google::Iam::V1::Policy.
1067
+ # p result
1068
+ #
1069
+ def set_iam_policy request, options = nil
1070
+ raise ::ArgumentError, "request must be provided" if request.nil?
1071
+
1072
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1073
+
1074
+ # Converts hash and nil to an options object
1075
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1076
+
1077
+ # Customize the options with defaults
1078
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
1079
+
1080
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1081
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1082
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1083
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
1084
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1085
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1086
+
1087
+ header_params = {}
1088
+ if request.resource
1089
+ header_params["resource"] = request.resource
1090
+ end
1091
+
1092
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1093
+ metadata[:"x-goog-request-params"] ||= request_params_header
1094
+
1095
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1096
+ metadata: metadata,
1097
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1098
+
1099
+ options.apply_defaults timeout: @config.timeout,
1100
+ metadata: @config.metadata,
1101
+ retry_policy: @config.retry_policy
1102
+
1103
+ @instances_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1104
+ yield response, operation if block_given?
1105
+ end
1106
+ rescue ::GRPC::BadStatus => e
1107
+ raise ::Google::Cloud::Error.from_error(e)
1108
+ end
1109
+
1110
+ ##
1111
+ # Returns permissions that a caller has on the specified Instance.
1112
+ #
1113
+ # There are no permissions required for making this API call.
1114
+ #
1115
+ # @overload test_iam_permissions(request, options = nil)
1116
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1117
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
1118
+ #
1119
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
1120
+ # A request object representing the call parameters. Required. To specify no
1121
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1122
+ # @param options [::Gapic::CallOptions, ::Hash]
1123
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1124
+ #
1125
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
1126
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1127
+ # least one keyword argument is required. To specify no parameters, or to keep all
1128
+ # the default parameter values, pass an empty Hash as a request object (see above).
1129
+ #
1130
+ # @param resource [::String]
1131
+ # REQUIRED: The resource for which the policy detail is being requested.
1132
+ # See the operation documentation for the appropriate value for this field.
1133
+ # @param permissions [::Array<::String>]
1134
+ # The set of permissions to check for the `resource`. Permissions with
1135
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1136
+ # information see
1137
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1138
+ #
1139
+ # @yield [response, operation] Access the result along with the RPC operation
1140
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
1141
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1142
+ #
1143
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1144
+ #
1145
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1146
+ #
1147
+ # @example Basic example
1148
+ # require "google/cloud/run/v2"
1149
+ #
1150
+ # # Create a client object. The client can be reused for multiple calls.
1151
+ # client = Google::Cloud::Run::V2::Instances::Client.new
1152
+ #
1153
+ # # Create a request. To set request fields, pass in keyword arguments.
1154
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1155
+ #
1156
+ # # Call the test_iam_permissions method.
1157
+ # result = client.test_iam_permissions request
1158
+ #
1159
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1160
+ # p result
1161
+ #
1162
+ def test_iam_permissions request, options = nil
1163
+ raise ::ArgumentError, "request must be provided" if request.nil?
1164
+
1165
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1166
+
1167
+ # Converts hash and nil to an options object
1168
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1169
+
1170
+ # Customize the options with defaults
1171
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1172
+
1173
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1174
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1175
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1176
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
1177
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1178
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1179
+
1180
+ header_params = {}
1181
+ if request.resource
1182
+ header_params["resource"] = request.resource
1183
+ end
1184
+
1185
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1186
+ metadata[:"x-goog-request-params"] ||= request_params_header
1187
+
1188
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1189
+ metadata: metadata,
1190
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1191
+
1192
+ options.apply_defaults timeout: @config.timeout,
1193
+ metadata: @config.metadata,
1194
+ retry_policy: @config.retry_policy
1195
+
1196
+ @instances_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1197
+ yield response, operation if block_given?
1198
+ end
1199
+ rescue ::GRPC::BadStatus => e
1200
+ raise ::Google::Cloud::Error.from_error(e)
1201
+ end
1202
+
819
1203
  ##
820
1204
  # Configuration class for the Instances API.
821
1205
  #
@@ -1007,6 +1391,11 @@ module Google
1007
1391
  #
1008
1392
  attr_reader :create_instance
1009
1393
  ##
1394
+ # RPC-specific configuration for `update_instance`
1395
+ # @return [::Gapic::Config::Method]
1396
+ #
1397
+ attr_reader :update_instance
1398
+ ##
1010
1399
  # RPC-specific configuration for `delete_instance`
1011
1400
  # @return [::Gapic::Config::Method]
1012
1401
  #
@@ -1031,11 +1420,28 @@ module Google
1031
1420
  # @return [::Gapic::Config::Method]
1032
1421
  #
1033
1422
  attr_reader :start_instance
1423
+ ##
1424
+ # RPC-specific configuration for `get_iam_policy`
1425
+ # @return [::Gapic::Config::Method]
1426
+ #
1427
+ attr_reader :get_iam_policy
1428
+ ##
1429
+ # RPC-specific configuration for `set_iam_policy`
1430
+ # @return [::Gapic::Config::Method]
1431
+ #
1432
+ attr_reader :set_iam_policy
1433
+ ##
1434
+ # RPC-specific configuration for `test_iam_permissions`
1435
+ # @return [::Gapic::Config::Method]
1436
+ #
1437
+ attr_reader :test_iam_permissions
1034
1438
 
1035
1439
  # @private
1036
1440
  def initialize parent_rpcs = nil
1037
1441
  create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1038
1442
  @create_instance = ::Gapic::Config::Method.new create_instance_config
1443
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
1444
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
1039
1445
  delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1040
1446
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1041
1447
  get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
@@ -1046,6 +1452,12 @@ module Google
1046
1452
  @stop_instance = ::Gapic::Config::Method.new stop_instance_config
1047
1453
  start_instance_config = parent_rpcs.start_instance if parent_rpcs.respond_to? :start_instance
1048
1454
  @start_instance = ::Gapic::Config::Method.new start_instance_config
1455
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1456
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1457
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1458
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1459
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1460
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1049
1461
 
1050
1462
  yield self if block_given?
1051
1463
  end
@@ -26,7 +26,9 @@ module Google
26
26
  # Credentials for the Instances API.
27
27
  class Credentials < ::Google::Auth::Credentials
28
28
  self.scope = [
29
- "https://www.googleapis.com/auth/cloud-platform"
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/run",
31
+ "https://www.googleapis.com/auth/run.readonly"
30
32
  ]
31
33
  self.env_vars = [
32
34
  "GOOGLE_CLOUD_CREDENTIALS",