google-cloud-compute-v1 1.5.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +8 -8
  4. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +87 -0
  5. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +74 -13
  6. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +17 -17
  7. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +18 -18
  8. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +151 -0
  9. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +142 -23
  10. data/lib/google/cloud/compute/v1/compute_pb.rb +357 -0
  11. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +8 -8
  12. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +37 -37
  13. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +12 -12
  14. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +17 -17
  15. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +12 -12
  16. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +22 -22
  17. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +82 -0
  18. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +68 -8
  19. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +14 -14
  20. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +14 -14
  21. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +10 -10
  22. data/lib/google/cloud/compute/v1/global_operations/rest.rb +1 -0
  23. data/lib/google/cloud/compute/v1/global_operations.rb +0 -1
  24. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +4 -4
  25. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +1 -0
  26. data/lib/google/cloud/compute/v1/global_organization_operations.rb +0 -1
  27. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +10 -10
  28. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +13 -13
  29. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +5 -5
  30. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +22 -22
  31. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +1 -1
  32. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +58 -58
  33. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +25 -25
  34. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +14 -14
  35. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1 -1
  36. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +132 -132
  37. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +87 -0
  38. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +77 -16
  39. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +5 -5
  40. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +82 -0
  41. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +72 -12
  42. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +6 -6
  43. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +14 -14
  44. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +14 -14
  45. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +8 -8
  46. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +14 -14
  47. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +25 -25
  48. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +32 -32
  49. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +22 -22
  50. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +37 -37
  51. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +22 -22
  52. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +8 -8
  53. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +19 -19
  54. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +15 -15
  55. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +10 -10
  56. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +16 -16
  57. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +16 -16
  58. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +155 -0
  59. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +142 -21
  60. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +13 -13
  61. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +7 -7
  62. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +36 -36
  63. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +15 -15
  64. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +18 -18
  65. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +1 -1
  66. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +57 -57
  67. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +13 -13
  68. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +4 -4
  69. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +12 -12
  70. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +50 -50
  71. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +12 -12
  72. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +13 -13
  73. data/lib/google/cloud/compute/v1/region_operations/rest.rb +1 -0
  74. data/lib/google/cloud/compute/v1/region_operations.rb +0 -1
  75. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +15 -15
  76. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +12 -12
  77. data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
  78. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +759 -0
  79. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
  80. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
  81. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
  82. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +15 -15
  83. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +21 -21
  84. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
  85. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +587 -0
  86. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
  87. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
  88. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
  89. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +21 -21
  90. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +5 -5
  91. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +28 -28
  92. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +22 -22
  93. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +28 -28
  94. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +8 -8
  95. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +82 -0
  96. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +80 -20
  97. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +25 -25
  98. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +16 -16
  99. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +9 -9
  100. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +86 -0
  101. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +69 -11
  102. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +32 -32
  103. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +10 -10
  104. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +13 -13
  105. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +21 -21
  106. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +13 -13
  107. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +31 -31
  108. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +18 -18
  109. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +12 -12
  110. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +87 -0
  111. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +74 -13
  112. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +17 -17
  113. data/lib/google/cloud/compute/v1/version.rb +1 -1
  114. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +22 -22
  115. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +87 -0
  116. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +74 -13
  117. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +13 -13
  118. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +1 -0
  119. data/lib/google/cloud/compute/v1/zone_operations.rb +0 -1
  120. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +5 -5
  121. data/lib/google/cloud/compute/v1.rb +2 -0
  122. data/proto_docs/google/cloud/compute/v1/compute.rb +968 -39
  123. metadata +12 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c58d6b847e995a168df8eb6bed384cbf828ab64e23d952806f40b67912159996
4
- data.tar.gz: 22c0d911080be8b78af8a7c7027acf545b9a41187ec078b7d241905dd31ff3c1
3
+ metadata.gz: d0aaa16fd7afb4567283bb33beebd318db50ff76376e50533a50459d454a012f
4
+ data.tar.gz: 2124b114f86fd09ab529e297ef8e4cd3d289d73aae4605a765a9435b581550f4
5
5
  SHA512:
6
- metadata.gz: 8fb8fb60e9a2f10c8aad860658efe9a2accc187611d7b1c0d4819f3a2df0825cfff0280aa3af8dbbf9cc131ebff52ea7d0bc5b04571ead1f76f7849601c90bd0
7
- data.tar.gz: 5705b22256eb1a3fcf8f4084b0a2b18d54d147b04820a5a511e309d8f410417c9702869c4736b56176c5d5b3a7ff6112472b5582f4c4d33ece6bae7d4b86f355
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
@@ -26,8 +26,8 @@ module Google
26
26
  module Rest
27
27
  ##
28
28
  # REST service stub for the AcceleratorTypes service.
29
- # service stub contains baseline method implementations
30
- # including transcoding, making the REST call and deserialing the response
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
33
  def initialize endpoint:, credentials:
@@ -167,7 +167,7 @@ module Google
167
167
  uri_method: :get,
168
168
  uri_template: "/compute/v1/projects/{project}/aggregated/acceleratorTypes",
169
169
  matches: [
170
- ["project", %r{[^/]+}, false]
170
+ ["project", %r{^[^/]+/?$}, false]
171
171
  ]
172
172
  )
173
173
  transcoder.transcode request_pb
@@ -188,9 +188,9 @@ module Google
188
188
  uri_method: :get,
189
189
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes/{accelerator_type}",
190
190
  matches: [
191
- ["project", %r{[^/]+}, false],
192
- ["zone", %r{[^/]+}, false],
193
- ["accelerator_type", %r{[^/]+}, false]
191
+ ["project", %r{^[^/]+/?$}, false],
192
+ ["zone", %r{^[^/]+/?$}, false],
193
+ ["accelerator_type", %r{^[^/]+/?$}, false]
194
194
  ]
195
195
  )
196
196
  transcoder.transcode request_pb
@@ -211,8 +211,8 @@ module Google
211
211
  uri_method: :get,
212
212
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes",
213
213
  matches: [
214
- ["project", %r{[^/]+}, false],
215
- ["zone", %r{[^/]+}, false]
214
+ ["project", %r{^[^/]+/?$}, false],
215
+ ["zone", %r{^[^/]+/?$}, false]
216
216
  ]
217
217
  )
218
218
  transcoder.transcode request_pb
@@ -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
@@ -26,8 +26,8 @@ module Google
26
26
  module Rest
27
27
  ##
28
28
  # REST service stub for the Addresses service.
29
- # service stub contains baseline method implementations
30
- # including transcoding, making the REST call and deserialing the response
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
33
  def initialize endpoint:, credentials:
@@ -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
 
@@ -241,7 +278,7 @@ module Google
241
278
  uri_method: :get,
242
279
  uri_template: "/compute/v1/projects/{project}/aggregated/addresses",
243
280
  matches: [
244
- ["project", %r{[^/]+}, false]
281
+ ["project", %r{^[^/]+/?$}, false]
245
282
  ]
246
283
  )
247
284
  transcoder.transcode request_pb
@@ -262,9 +299,9 @@ module Google
262
299
  uri_method: :delete,
263
300
  uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses/{address}",
264
301
  matches: [
265
- ["project", %r{[^/]+}, false],
266
- ["region", %r{[^/]+}, false],
267
- ["address", %r{[^/]+}, false]
302
+ ["project", %r{^[^/]+/?$}, false],
303
+ ["region", %r{^[^/]+/?$}, false],
304
+ ["address", %r{^[^/]+/?$}, false]
268
305
  ]
269
306
  )
270
307
  transcoder.transcode request_pb
@@ -285,9 +322,9 @@ module Google
285
322
  uri_method: :get,
286
323
  uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses/{address}",
287
324
  matches: [
288
- ["project", %r{[^/]+}, false],
289
- ["region", %r{[^/]+}, false],
290
- ["address", %r{[^/]+}, false]
325
+ ["project", %r{^[^/]+/?$}, false],
326
+ ["region", %r{^[^/]+/?$}, false],
327
+ ["address", %r{^[^/]+/?$}, false]
291
328
  ]
292
329
  )
293
330
  transcoder.transcode request_pb
@@ -309,8 +346,8 @@ module Google
309
346
  uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses",
310
347
  body: "address_resource",
311
348
  matches: [
312
- ["project", %r{[^/]+}, false],
313
- ["region", %r{[^/]+}, false]
349
+ ["project", %r{^[^/]+/?$}, false],
350
+ ["region", %r{^[^/]+/?$}, false]
314
351
  ]
315
352
  )
316
353
  transcoder.transcode request_pb
@@ -331,8 +368,32 @@ module Google
331
368
  uri_method: :get,
332
369
  uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses",
333
370
  matches: [
334
- ["project", %r{[^/]+}, false],
335
- ["region", %r{[^/]+}, false]
371
+ ["project", %r{^[^/]+/?$}, false],
372
+ ["region", %r{^[^/]+/?$}, false]
373
+ ]
374
+ )
375
+ transcoder.transcode request_pb
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]
336
397
  ]
337
398
  )
338
399
  transcoder.transcode request_pb
@@ -26,8 +26,8 @@ module Google
26
26
  module Rest
27
27
  ##
28
28
  # REST service stub for the Autoscalers service.
29
- # service stub contains baseline method implementations
30
- # including transcoding, making the REST call and deserialing the response
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
33
  def initialize endpoint:, credentials:
@@ -315,7 +315,7 @@ module Google
315
315
  uri_method: :get,
316
316
  uri_template: "/compute/v1/projects/{project}/aggregated/autoscalers",
317
317
  matches: [
318
- ["project", %r{[^/]+}, false]
318
+ ["project", %r{^[^/]+/?$}, false]
319
319
  ]
320
320
  )
321
321
  transcoder.transcode request_pb
@@ -336,9 +336,9 @@ module Google
336
336
  uri_method: :delete,
337
337
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
338
338
  matches: [
339
- ["project", %r{[^/]+}, false],
340
- ["zone", %r{[^/]+}, false],
341
- ["autoscaler", %r{[^/]+}, false]
339
+ ["project", %r{^[^/]+/?$}, false],
340
+ ["zone", %r{^[^/]+/?$}, false],
341
+ ["autoscaler", %r{^[^/]+/?$}, false]
342
342
  ]
343
343
  )
344
344
  transcoder.transcode request_pb
@@ -359,9 +359,9 @@ module Google
359
359
  uri_method: :get,
360
360
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
361
361
  matches: [
362
- ["project", %r{[^/]+}, false],
363
- ["zone", %r{[^/]+}, false],
364
- ["autoscaler", %r{[^/]+}, false]
362
+ ["project", %r{^[^/]+/?$}, false],
363
+ ["zone", %r{^[^/]+/?$}, false],
364
+ ["autoscaler", %r{^[^/]+/?$}, false]
365
365
  ]
366
366
  )
367
367
  transcoder.transcode request_pb
@@ -383,8 +383,8 @@ module Google
383
383
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/autoscalers",
384
384
  body: "autoscaler_resource",
385
385
  matches: [
386
- ["project", %r{[^/]+}, false],
387
- ["zone", %r{[^/]+}, false]
386
+ ["project", %r{^[^/]+/?$}, false],
387
+ ["zone", %r{^[^/]+/?$}, false]
388
388
  ]
389
389
  )
390
390
  transcoder.transcode request_pb
@@ -405,8 +405,8 @@ module Google
405
405
  uri_method: :get,
406
406
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/autoscalers",
407
407
  matches: [
408
- ["project", %r{[^/]+}, false],
409
- ["zone", %r{[^/]+}, false]
408
+ ["project", %r{^[^/]+/?$}, false],
409
+ ["zone", %r{^[^/]+/?$}, false]
410
410
  ]
411
411
  )
412
412
  transcoder.transcode request_pb
@@ -428,8 +428,8 @@ module Google
428
428
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/autoscalers",
429
429
  body: "autoscaler_resource",
430
430
  matches: [
431
- ["project", %r{[^/]+}, false],
432
- ["zone", %r{[^/]+}, false]
431
+ ["project", %r{^[^/]+/?$}, false],
432
+ ["zone", %r{^[^/]+/?$}, false]
433
433
  ]
434
434
  )
435
435
  transcoder.transcode request_pb
@@ -451,8 +451,8 @@ module Google
451
451
  uri_template: "/compute/v1/projects/{project}/zones/{zone}/autoscalers",
452
452
  body: "autoscaler_resource",
453
453
  matches: [
454
- ["project", %r{[^/]+}, false],
455
- ["zone", %r{[^/]+}, false]
454
+ ["project", %r{^[^/]+/?$}, false],
455
+ ["zone", %r{^[^/]+/?$}, false]
456
456
  ]
457
457
  )
458
458
  transcoder.transcode request_pb
@@ -26,8 +26,8 @@ module Google
26
26
  module Rest
27
27
  ##
28
28
  # REST service stub for the BackendBuckets service.
29
- # service stub contains baseline method implementations
30
- # including transcoding, making the REST call and deserialing the response
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
33
  def initialize endpoint:, credentials:
@@ -390,8 +390,8 @@ module Google
390
390
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/addSignedUrlKey",
391
391
  body: "signed_url_key_resource",
392
392
  matches: [
393
- ["project", %r{[^/]+}, false],
394
- ["backend_bucket", %r{[^/]+}, false]
393
+ ["project", %r{^[^/]+/?$}, false],
394
+ ["backend_bucket", %r{^[^/]+/?$}, false]
395
395
  ]
396
396
  )
397
397
  transcoder.transcode request_pb
@@ -412,8 +412,8 @@ module Google
412
412
  uri_method: :delete,
413
413
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}",
414
414
  matches: [
415
- ["project", %r{[^/]+}, false],
416
- ["backend_bucket", %r{[^/]+}, false]
415
+ ["project", %r{^[^/]+/?$}, false],
416
+ ["backend_bucket", %r{^[^/]+/?$}, false]
417
417
  ]
418
418
  )
419
419
  transcoder.transcode request_pb
@@ -434,8 +434,8 @@ module Google
434
434
  uri_method: :post,
435
435
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/deleteSignedUrlKey",
436
436
  matches: [
437
- ["project", %r{[^/]+}, false],
438
- ["backend_bucket", %r{[^/]+}, false]
437
+ ["project", %r{^[^/]+/?$}, false],
438
+ ["backend_bucket", %r{^[^/]+/?$}, false]
439
439
  ]
440
440
  )
441
441
  transcoder.transcode request_pb
@@ -456,8 +456,8 @@ module Google
456
456
  uri_method: :get,
457
457
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}",
458
458
  matches: [
459
- ["project", %r{[^/]+}, false],
460
- ["backend_bucket", %r{[^/]+}, false]
459
+ ["project", %r{^[^/]+/?$}, false],
460
+ ["backend_bucket", %r{^[^/]+/?$}, false]
461
461
  ]
462
462
  )
463
463
  transcoder.transcode request_pb
@@ -479,7 +479,7 @@ module Google
479
479
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets",
480
480
  body: "backend_bucket_resource",
481
481
  matches: [
482
- ["project", %r{[^/]+}, false]
482
+ ["project", %r{^[^/]+/?$}, false]
483
483
  ]
484
484
  )
485
485
  transcoder.transcode request_pb
@@ -500,7 +500,7 @@ module Google
500
500
  uri_method: :get,
501
501
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets",
502
502
  matches: [
503
- ["project", %r{[^/]+}, false]
503
+ ["project", %r{^[^/]+/?$}, false]
504
504
  ]
505
505
  )
506
506
  transcoder.transcode request_pb
@@ -522,8 +522,8 @@ module Google
522
522
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}",
523
523
  body: "backend_bucket_resource",
524
524
  matches: [
525
- ["project", %r{[^/]+}, false],
526
- ["backend_bucket", %r{[^/]+}, false]
525
+ ["project", %r{^[^/]+/?$}, false],
526
+ ["backend_bucket", %r{^[^/]+/?$}, false]
527
527
  ]
528
528
  )
529
529
  transcoder.transcode request_pb
@@ -545,8 +545,8 @@ module Google
545
545
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/setEdgeSecurityPolicy",
546
546
  body: "security_policy_reference_resource",
547
547
  matches: [
548
- ["project", %r{[^/]+}, false],
549
- ["backend_bucket", %r{[^/]+}, false]
548
+ ["project", %r{^[^/]+/?$}, false],
549
+ ["backend_bucket", %r{^[^/]+/?$}, false]
550
550
  ]
551
551
  )
552
552
  transcoder.transcode request_pb
@@ -568,8 +568,8 @@ module Google
568
568
  uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}",
569
569
  body: "backend_bucket_resource",
570
570
  matches: [
571
- ["project", %r{[^/]+}, false],
572
- ["backend_bucket", %r{[^/]+}, false]
571
+ ["project", %r{^[^/]+/?$}, false],
572
+ ["backend_bucket", %r{^[^/]+/?$}, false]
573
573
  ]
574
574
  )
575
575
  transcoder.transcode request_pb