google-cloud-compute-v1 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +87 -0
  4. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +61 -0
  5. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +151 -0
  6. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +119 -0
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +228 -0
  8. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +82 -0
  9. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +60 -0
  10. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +87 -0
  11. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +61 -0
  12. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +82 -0
  13. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
  14. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +155 -0
  15. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +121 -0
  16. data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +759 -0
  18. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
  19. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
  20. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
  21. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
  22. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +587 -0
  23. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
  24. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
  25. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
  26. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +82 -0
  27. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +60 -0
  28. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +86 -0
  29. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +58 -0
  30. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +87 -0
  31. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +61 -0
  32. data/lib/google/cloud/compute/v1/version.rb +1 -1
  33. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +87 -0
  34. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +61 -0
  35. data/lib/google/cloud/compute/v1.rb +2 -0
  36. data/proto_docs/google/cloud/compute/v1/compute.rb +637 -26
  37. metadata +12 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ea56f9dd35946267157d69bc6aad4d2011ef0d032c2692f0fc8585f20f9e77d
4
- data.tar.gz: 24d4246582ba7d9f897457fe5a3a09a2295b7888205c48146c71223662d287c8
3
+ metadata.gz: d0aaa16fd7afb4567283bb33beebd318db50ff76376e50533a50459d454a012f
4
+ data.tar.gz: 2124b114f86fd09ab529e297ef8e4cd3d289d73aae4605a765a9435b581550f4
5
5
  SHA512:
6
- metadata.gz: 12780f1e3231db163be3bf498700a34939ce9fef3c4545c353e111f1ab33f8871792ca48c9d74a8e1fe783a7c2a30cbd4da2fd1d10c6a82b9d0e277be2cf607b
7
- data.tar.gz: e867f79215fd5932d6be2df27884a4570b1ff2595554124249b1b9c6cc93d4e8a9804b24c465535b7846c8dd01a451218abeeb3ceb2b0ea91859f45c8eafb2a6
6
+ metadata.gz: cbcf833d82e49dd635485752e931a06cf5fa9e748127a5a53cab594e8605c74c8366744abce1ff81d798a34ca7789859d952c894729b5bb90c0d965b27ea6ae0
7
+ data.tar.gz: ed6f83765dbe2269082400f69c6e344b5dece40392f9c6536195f621b520c22982a5752640cc328cc607a91153a3e7ca6613a228dd144e0d9d8e0ea9bb506391
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
@@ -84,6 +84,8 @@ module Google
84
84
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
85
  }
86
86
 
87
+ default_config.rpcs.set_labels.timeout = 600.0
88
+
87
89
  default_config
88
90
  end
89
91
  yield @configure if block_given?
@@ -522,6 +524,84 @@ module Google
522
524
  raise ::Google::Cloud::Error.from_error(gapic_error)
523
525
  end
524
526
 
527
+ ##
528
+ # Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.
529
+ #
530
+ # @overload set_labels(request, options = nil)
531
+ # Pass arguments to `set_labels` via a request object, either of type
532
+ # {::Google::Cloud::Compute::V1::SetLabelsAddressRequest} or an equivalent Hash.
533
+ #
534
+ # @param request [::Google::Cloud::Compute::V1::SetLabelsAddressRequest, ::Hash]
535
+ # A request object representing the call parameters. Required. To specify no
536
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
537
+ # @param options [::Gapic::CallOptions, ::Hash]
538
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
539
+ # Note: currently retry functionality is not implemented. While it is possible
540
+ # to set it using ::Gapic::CallOptions, it will not be applied
541
+ #
542
+ # @overload set_labels(project: nil, region: nil, region_set_labels_request_resource: nil, request_id: nil, resource: nil)
543
+ # Pass arguments to `set_labels` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param project [::String]
548
+ # Project ID for this request.
549
+ # @param region [::String]
550
+ # The region for this request.
551
+ # @param region_set_labels_request_resource [::Google::Cloud::Compute::V1::RegionSetLabelsRequest, ::Hash]
552
+ # The body resource for this request
553
+ # @param request_id [::String]
554
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
555
+ # @param resource [::String]
556
+ # Name or id of the resource for this request.
557
+ # @yield [result, response] Access the result along with the Faraday response object
558
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
559
+ # @yieldparam response [::Faraday::Response]
560
+ #
561
+ # @return [::Gapic::GenericLRO::Operation]
562
+ #
563
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
564
+ def set_labels request, options = nil
565
+ raise ::ArgumentError, "request must be provided" if request.nil?
566
+
567
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsAddressRequest
568
+
569
+ # Converts hash and nil to an options object
570
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
571
+
572
+ # Customize the options with defaults
573
+ call_metadata = @config.rpcs.set_labels.metadata.to_h
574
+
575
+ # Set x-goog-api-client header
576
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
577
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
578
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
579
+ transports_version_send: [:rest]
580
+
581
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
582
+ metadata: call_metadata
583
+
584
+ options.apply_defaults timeout: @config.timeout,
585
+ metadata: @config.metadata
586
+
587
+ @addresses_stub.set_labels request, options do |result, response|
588
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
589
+ operation: result,
590
+ client: region_operations,
591
+ request_values: {
592
+ "project" => request.project,
593
+ "region" => request.region
594
+ },
595
+ options: options
596
+ )
597
+ yield result, response if block_given?
598
+ return result
599
+ end
600
+ rescue ::Faraday::Error => e
601
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
602
+ raise ::Google::Cloud::Error.from_error(gapic_error)
603
+ end
604
+
525
605
  ##
526
606
  # Configuration class for the Addresses REST API.
527
607
  #
@@ -646,6 +726,11 @@ module Google
646
726
  # @return [::Gapic::Config::Method]
647
727
  #
648
728
  attr_reader :list
729
+ ##
730
+ # RPC-specific configuration for `set_labels`
731
+ # @return [::Gapic::Config::Method]
732
+ #
733
+ attr_reader :set_labels
649
734
 
650
735
  # @private
651
736
  def initialize parent_rpcs = nil
@@ -659,6 +744,8 @@ module Google
659
744
  @insert = ::Gapic::Config::Method.new insert_config
660
745
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
661
746
  @list = ::Gapic::Config::Method.new list_config
747
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
748
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
662
749
 
663
750
  yield self if block_given?
664
751
  end
@@ -223,6 +223,43 @@ module Google
223
223
  result
224
224
  end
225
225
 
226
+ ##
227
+ # Baseline implementation for the set_labels REST call
228
+ #
229
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsAddressRequest]
230
+ # A request object representing the call parameters. Required.
231
+ # @param options [::Gapic::CallOptions]
232
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
233
+ #
234
+ # @yield [result, response] Access the result along with the Faraday response object
235
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
236
+ # @yieldparam response [::Faraday::Response]
237
+ #
238
+ # @return [::Google::Cloud::Compute::V1::Operation]
239
+ # A result object deserialized from the server's reply
240
+ def set_labels request_pb, options = nil
241
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
242
+
243
+ verb, uri, query_string_params, body = transcode_set_labels_request request_pb
244
+ query_string_params = if query_string_params.any?
245
+ query_string_params.to_h { |p| p.split("=", 2) }
246
+ else
247
+ {}
248
+ end
249
+
250
+ response = @client_stub.make_http_request(
251
+ verb,
252
+ uri: uri,
253
+ body: body || "",
254
+ params: query_string_params,
255
+ options: options
256
+ )
257
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
258
+
259
+ yield result, response if block_given?
260
+ result
261
+ end
262
+
226
263
 
227
264
  private
228
265
 
@@ -337,6 +374,30 @@ module Google
337
374
  )
338
375
  transcoder.transcode request_pb
339
376
  end
377
+
378
+ ##
379
+ # @private
380
+ #
381
+ # GRPC transcoding helper method for the set_labels REST call
382
+ #
383
+ # @param request_pb [::Google::Cloud::Compute::V1::SetLabelsAddressRequest]
384
+ # A request object representing the call parameters. Required.
385
+ # @return [Array(String, [String, nil], Hash{String => String})]
386
+ # Uri, Body, Query string parameters
387
+ def transcode_set_labels_request request_pb
388
+ transcoder = Gapic::Rest::GrpcTranscoder.new
389
+ .with_bindings(
390
+ uri_method: :post,
391
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses/{resource}/setLabels",
392
+ body: "region_set_labels_request_resource",
393
+ matches: [
394
+ ["project", %r{^[^/]+/?$}, false],
395
+ ["region", %r{^[^/]+/?$}, false],
396
+ ["resource", %r{^[^/]+/?$}, false]
397
+ ]
398
+ )
399
+ transcoder.transcode request_pb
400
+ end
340
401
  end
341
402
  end
342
403
  end
@@ -83,6 +83,11 @@ module Google
83
83
 
84
84
  default_config.rpcs.get_health.timeout = 600.0
85
85
 
86
+ default_config.rpcs.get_iam_policy.timeout = 600.0
87
+ default_config.rpcs.get_iam_policy.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
89
+ }
90
+
86
91
  default_config.rpcs.insert.timeout = 600.0
87
92
 
88
93
  default_config.rpcs.list.timeout = 600.0
@@ -94,6 +99,8 @@ module Google
94
99
 
95
100
  default_config.rpcs.set_edge_security_policy.timeout = 600.0
96
101
 
102
+ default_config.rpcs.set_iam_policy.timeout = 600.0
103
+
97
104
  default_config.rpcs.set_security_policy.timeout = 600.0
98
105
 
99
106
  default_config.rpcs.update.timeout = 600.0
@@ -595,6 +602,71 @@ module Google
595
602
  raise ::Google::Cloud::Error.from_error(gapic_error)
596
603
  end
597
604
 
605
+ ##
606
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
607
+ #
608
+ # @overload get_iam_policy(request, options = nil)
609
+ # Pass arguments to `get_iam_policy` via a request object, either of type
610
+ # {::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest} or an equivalent Hash.
611
+ #
612
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest, ::Hash]
613
+ # A request object representing the call parameters. Required. To specify no
614
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
615
+ # @param options [::Gapic::CallOptions, ::Hash]
616
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
617
+ # Note: currently retry functionality is not implemented. While it is possible
618
+ # to set it using ::Gapic::CallOptions, it will not be applied
619
+ #
620
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, resource: nil)
621
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
622
+ # least one keyword argument is required. To specify no parameters, or to keep all
623
+ # the default parameter values, pass an empty Hash as a request object (see above).
624
+ #
625
+ # @param options_requested_policy_version [::Integer]
626
+ # Requested IAM Policy version.
627
+ # @param project [::String]
628
+ # Project ID for this request.
629
+ # @param resource [::String]
630
+ # Name or id of the resource for this request.
631
+ # @yield [result, response] Access the result along with the Faraday response object
632
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
633
+ # @yieldparam response [::Faraday::Response]
634
+ #
635
+ # @return [::Google::Cloud::Compute::V1::Policy]
636
+ #
637
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
638
+ def get_iam_policy request, options = nil
639
+ raise ::ArgumentError, "request must be provided" if request.nil?
640
+
641
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest
642
+
643
+ # Converts hash and nil to an options object
644
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
645
+
646
+ # Customize the options with defaults
647
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
648
+
649
+ # Set x-goog-api-client header
650
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
651
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
652
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
653
+ transports_version_send: [:rest]
654
+
655
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
656
+ metadata: call_metadata
657
+
658
+ options.apply_defaults timeout: @config.timeout,
659
+ metadata: @config.metadata
660
+
661
+ @backend_services_stub.get_iam_policy request, options do |result, response|
662
+ yield result, response if block_given?
663
+ return result
664
+ end
665
+ rescue ::Faraday::Error => e
666
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
667
+ raise ::Google::Cloud::Error.from_error(gapic_error)
668
+ end
669
+
598
670
  ##
599
671
  # Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview .
600
672
  #
@@ -890,6 +962,71 @@ module Google
890
962
  raise ::Google::Cloud::Error.from_error(gapic_error)
891
963
  end
892
964
 
965
+ ##
966
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
967
+ #
968
+ # @overload set_iam_policy(request, options = nil)
969
+ # Pass arguments to `set_iam_policy` via a request object, either of type
970
+ # {::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest} or an equivalent Hash.
971
+ #
972
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest, ::Hash]
973
+ # A request object representing the call parameters. Required. To specify no
974
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
975
+ # @param options [::Gapic::CallOptions, ::Hash]
976
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
977
+ # Note: currently retry functionality is not implemented. While it is possible
978
+ # to set it using ::Gapic::CallOptions, it will not be applied
979
+ #
980
+ # @overload set_iam_policy(global_set_policy_request_resource: nil, project: nil, resource: nil)
981
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
982
+ # least one keyword argument is required. To specify no parameters, or to keep all
983
+ # the default parameter values, pass an empty Hash as a request object (see above).
984
+ #
985
+ # @param global_set_policy_request_resource [::Google::Cloud::Compute::V1::GlobalSetPolicyRequest, ::Hash]
986
+ # The body resource for this request
987
+ # @param project [::String]
988
+ # Project ID for this request.
989
+ # @param resource [::String]
990
+ # Name or id of the resource for this request.
991
+ # @yield [result, response] Access the result along with the Faraday response object
992
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
993
+ # @yieldparam response [::Faraday::Response]
994
+ #
995
+ # @return [::Google::Cloud::Compute::V1::Policy]
996
+ #
997
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
998
+ def set_iam_policy request, options = nil
999
+ raise ::ArgumentError, "request must be provided" if request.nil?
1000
+
1001
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest
1002
+
1003
+ # Converts hash and nil to an options object
1004
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1005
+
1006
+ # Customize the options with defaults
1007
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1008
+
1009
+ # Set x-goog-api-client header
1010
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1011
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1012
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1013
+ transports_version_send: [:rest]
1014
+
1015
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1016
+ metadata: call_metadata
1017
+
1018
+ options.apply_defaults timeout: @config.timeout,
1019
+ metadata: @config.metadata
1020
+
1021
+ @backend_services_stub.set_iam_policy request, options do |result, response|
1022
+ yield result, response if block_given?
1023
+ return result
1024
+ end
1025
+ rescue ::Faraday::Error => e
1026
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1027
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1028
+ end
1029
+
893
1030
  ##
894
1031
  # Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview
895
1032
  #
@@ -1170,6 +1307,11 @@ module Google
1170
1307
  #
1171
1308
  attr_reader :get_health
1172
1309
  ##
1310
+ # RPC-specific configuration for `get_iam_policy`
1311
+ # @return [::Gapic::Config::Method]
1312
+ #
1313
+ attr_reader :get_iam_policy
1314
+ ##
1173
1315
  # RPC-specific configuration for `insert`
1174
1316
  # @return [::Gapic::Config::Method]
1175
1317
  #
@@ -1190,6 +1332,11 @@ module Google
1190
1332
  #
1191
1333
  attr_reader :set_edge_security_policy
1192
1334
  ##
1335
+ # RPC-specific configuration for `set_iam_policy`
1336
+ # @return [::Gapic::Config::Method]
1337
+ #
1338
+ attr_reader :set_iam_policy
1339
+ ##
1193
1340
  # RPC-specific configuration for `set_security_policy`
1194
1341
  # @return [::Gapic::Config::Method]
1195
1342
  #
@@ -1214,6 +1361,8 @@ module Google
1214
1361
  @get = ::Gapic::Config::Method.new get_config
1215
1362
  get_health_config = parent_rpcs.get_health if parent_rpcs.respond_to? :get_health
1216
1363
  @get_health = ::Gapic::Config::Method.new get_health_config
1364
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1365
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1217
1366
  insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1218
1367
  @insert = ::Gapic::Config::Method.new insert_config
1219
1368
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
@@ -1222,6 +1371,8 @@ module Google
1222
1371
  @patch = ::Gapic::Config::Method.new patch_config
1223
1372
  set_edge_security_policy_config = parent_rpcs.set_edge_security_policy if parent_rpcs.respond_to? :set_edge_security_policy
1224
1373
  @set_edge_security_policy = ::Gapic::Config::Method.new set_edge_security_policy_config
1374
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1375
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1225
1376
  set_security_policy_config = parent_rpcs.set_security_policy if parent_rpcs.respond_to? :set_security_policy
1226
1377
  @set_security_policy = ::Gapic::Config::Method.new set_security_policy_config
1227
1378
  update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
@@ -260,6 +260,43 @@ module Google
260
260
  result
261
261
  end
262
262
 
263
+ ##
264
+ # Baseline implementation for the get_iam_policy REST call
265
+ #
266
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest]
267
+ # A request object representing the call parameters. Required.
268
+ # @param options [::Gapic::CallOptions]
269
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
270
+ #
271
+ # @yield [result, response] Access the result along with the Faraday response object
272
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
273
+ # @yieldparam response [::Faraday::Response]
274
+ #
275
+ # @return [::Google::Cloud::Compute::V1::Policy]
276
+ # A result object deserialized from the server's reply
277
+ def get_iam_policy request_pb, options = nil
278
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
279
+
280
+ verb, uri, query_string_params, body = transcode_get_iam_policy_request request_pb
281
+ query_string_params = if query_string_params.any?
282
+ query_string_params.to_h { |p| p.split("=", 2) }
283
+ else
284
+ {}
285
+ end
286
+
287
+ response = @client_stub.make_http_request(
288
+ verb,
289
+ uri: uri,
290
+ body: body || "",
291
+ params: query_string_params,
292
+ options: options
293
+ )
294
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
295
+
296
+ yield result, response if block_given?
297
+ result
298
+ end
299
+
263
300
  ##
264
301
  # Baseline implementation for the insert REST call
265
302
  #
@@ -408,6 +445,43 @@ module Google
408
445
  result
409
446
  end
410
447
 
448
+ ##
449
+ # Baseline implementation for the set_iam_policy REST call
450
+ #
451
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest]
452
+ # A request object representing the call parameters. Required.
453
+ # @param options [::Gapic::CallOptions]
454
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
455
+ #
456
+ # @yield [result, response] Access the result along with the Faraday response object
457
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
458
+ # @yieldparam response [::Faraday::Response]
459
+ #
460
+ # @return [::Google::Cloud::Compute::V1::Policy]
461
+ # A result object deserialized from the server's reply
462
+ def set_iam_policy request_pb, options = nil
463
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
464
+
465
+ verb, uri, query_string_params, body = transcode_set_iam_policy_request request_pb
466
+ query_string_params = if query_string_params.any?
467
+ query_string_params.to_h { |p| p.split("=", 2) }
468
+ else
469
+ {}
470
+ end
471
+
472
+ response = @client_stub.make_http_request(
473
+ verb,
474
+ uri: uri,
475
+ body: body || "",
476
+ params: query_string_params,
477
+ options: options
478
+ )
479
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
480
+
481
+ yield result, response if block_given?
482
+ result
483
+ end
484
+
411
485
  ##
412
486
  # Baseline implementation for the set_security_policy REST call
413
487
  #
@@ -618,6 +692,28 @@ module Google
618
692
  transcoder.transcode request_pb
619
693
  end
620
694
 
695
+ ##
696
+ # @private
697
+ #
698
+ # GRPC transcoding helper method for the get_iam_policy REST call
699
+ #
700
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest]
701
+ # A request object representing the call parameters. Required.
702
+ # @return [Array(String, [String, nil], Hash{String => String})]
703
+ # Uri, Body, Query string parameters
704
+ def transcode_get_iam_policy_request request_pb
705
+ transcoder = Gapic::Rest::GrpcTranscoder.new
706
+ .with_bindings(
707
+ uri_method: :get,
708
+ uri_template: "/compute/v1/projects/{project}/global/backendServices/{resource}/getIamPolicy",
709
+ matches: [
710
+ ["project", %r{^[^/]+/?$}, false],
711
+ ["resource", %r{^[^/]+/?$}, false]
712
+ ]
713
+ )
714
+ transcoder.transcode request_pb
715
+ end
716
+
621
717
  ##
622
718
  # @private
623
719
  #
@@ -707,6 +803,29 @@ module Google
707
803
  transcoder.transcode request_pb
708
804
  end
709
805
 
806
+ ##
807
+ # @private
808
+ #
809
+ # GRPC transcoding helper method for the set_iam_policy REST call
810
+ #
811
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest]
812
+ # A request object representing the call parameters. Required.
813
+ # @return [Array(String, [String, nil], Hash{String => String})]
814
+ # Uri, Body, Query string parameters
815
+ def transcode_set_iam_policy_request request_pb
816
+ transcoder = Gapic::Rest::GrpcTranscoder.new
817
+ .with_bindings(
818
+ uri_method: :post,
819
+ uri_template: "/compute/v1/projects/{project}/global/backendServices/{resource}/setIamPolicy",
820
+ body: "global_set_policy_request_resource",
821
+ matches: [
822
+ ["project", %r{^[^/]+/?$}, false],
823
+ ["resource", %r{^[^/]+/?$}, false]
824
+ ]
825
+ )
826
+ transcoder.transcode request_pb
827
+ end
828
+
710
829
  ##
711
830
  # @private
712
831
  #