google-cloud-compute-v1 1.6.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +15 -6
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +1 -1
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +115 -10
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +62 -1
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +35 -14
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +1 -1
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +45 -18
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +1 -1
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +217 -24
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +120 -1
  13. data/lib/google/cloud/compute/v1/compute_pb.rb +228 -0
  14. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +15 -6
  15. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +1 -1
  16. data/lib/google/cloud/compute/v1/disks/rest/client.rb +65 -26
  17. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +1 -1
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +30 -12
  19. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +1 -1
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +90 -36
  21. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +1 -1
  22. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +30 -12
  23. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +1 -1
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +40 -16
  25. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +1 -1
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +105 -8
  27. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +61 -1
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +35 -14
  29. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +1 -1
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +35 -14
  31. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +1 -1
  32. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +25 -10
  33. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +1 -1
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +15 -6
  35. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +1 -1
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +25 -10
  37. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +1 -1
  38. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +35 -14
  39. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +1 -1
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +5 -2
  41. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +1 -1
  42. data/lib/google/cloud/compute/v1/images/rest/client.rb +55 -22
  43. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +1 -1
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +100 -40
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +1 -1
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +45 -18
  47. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +1 -1
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +35 -14
  49. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +1 -1
  50. data/lib/google/cloud/compute/v1/instances/rest/client.rb +225 -90
  51. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +1 -1
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +120 -12
  53. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +62 -1
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +10 -4
  55. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +1 -1
  56. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +115 -12
  57. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +61 -1
  58. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +10 -4
  59. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +1 -1
  60. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +35 -14
  61. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +1 -1
  62. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +35 -14
  63. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +1 -1
  64. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +15 -6
  65. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +1 -1
  66. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +25 -10
  67. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +1 -1
  68. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +45 -18
  69. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +1 -1
  70. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +80 -32
  71. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +1 -1
  72. data/lib/google/cloud/compute/v1/networks/rest/client.rb +55 -22
  73. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +1 -1
  74. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +65 -26
  75. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +1 -1
  76. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +40 -16
  77. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +1 -1
  78. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +15 -6
  79. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +1 -1
  80. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +35 -14
  81. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +1 -1
  82. data/lib/google/cloud/compute/v1/projects/rest/client.rb +65 -26
  83. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +1 -1
  84. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +25 -10
  85. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +1 -1
  86. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +30 -12
  87. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +1 -1
  88. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +30 -12
  89. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +1 -1
  90. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +196 -14
  91. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +122 -1
  92. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +25 -10
  93. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +1 -1
  94. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +10 -4
  95. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +1 -1
  96. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +60 -24
  97. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +1 -1
  98. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +25 -10
  99. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +1 -1
  100. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +30 -12
  101. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +1 -1
  102. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +95 -38
  103. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +1 -1
  104. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +20 -8
  105. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +1 -1
  106. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +5 -2
  107. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +1 -1
  108. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +20 -8
  109. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +1 -1
  110. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +85 -34
  111. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +1 -1
  112. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +20 -8
  113. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +1 -1
  114. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +20 -8
  115. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +1 -1
  116. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +25 -10
  117. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +1 -1
  118. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +20 -8
  119. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +1 -1
  120. data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
  121. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +777 -0
  122. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
  123. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
  124. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
  125. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +25 -10
  126. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +1 -1
  127. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +35 -14
  128. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +1 -1
  129. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
  130. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +599 -0
  131. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
  132. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
  133. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
  134. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +35 -14
  135. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +1 -1
  136. data/lib/google/cloud/compute/v1/regions/rest/client.rb +10 -4
  137. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +1 -1
  138. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +50 -20
  139. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +1 -1
  140. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +40 -16
  141. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +1 -1
  142. data/lib/google/cloud/compute/v1/routers/rest/client.rb +50 -20
  143. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +1 -1
  144. data/lib/google/cloud/compute/v1/routes/rest/client.rb +20 -8
  145. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +1 -1
  146. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +140 -22
  147. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +61 -1
  148. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +45 -18
  149. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +1 -1
  150. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +40 -16
  151. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +1 -1
  152. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +25 -10
  153. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +1 -1
  154. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +119 -12
  155. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +59 -1
  156. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +60 -24
  157. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +1 -1
  158. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +25 -10
  159. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +1 -1
  160. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +35 -14
  161. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +1 -1
  162. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +55 -22
  163. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +1 -1
  164. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +25 -10
  165. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +1 -1
  166. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +55 -22
  167. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +1 -1
  168. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +45 -18
  169. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +1 -1
  170. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +30 -12
  171. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +1 -1
  172. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +115 -10
  173. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +62 -1
  174. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +45 -18
  175. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +1 -1
  176. data/lib/google/cloud/compute/v1/version.rb +1 -1
  177. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +40 -16
  178. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +1 -1
  179. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +115 -10
  180. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +62 -1
  181. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +20 -8
  182. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +1 -1
  183. data/lib/google/cloud/compute/v1/zones/rest/client.rb +10 -4
  184. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +1 -1
  185. data/lib/google/cloud/compute/v1.rb +2 -0
  186. data/proto_docs/google/cloud/compute/v1/compute.rb +637 -26
  187. metadata +14 -4
@@ -0,0 +1,288 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/compute/v1/compute_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module RegionTargetTcpProxies
26
+ module Rest
27
+ ##
28
+ # REST service stub for the RegionTargetTcpProxies service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
+ end
40
+
41
+ ##
42
+ # Baseline implementation for the delete REST call
43
+ #
44
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionTargetTcpProxyRequest]
45
+ # A request object representing the call parameters. Required.
46
+ # @param options [::Gapic::CallOptions]
47
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
48
+ #
49
+ # @yield [result, response] Access the result along with the Faraday response object
50
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
51
+ # @yieldparam response [::Faraday::Response]
52
+ #
53
+ # @return [::Google::Cloud::Compute::V1::Operation]
54
+ # A result object deserialized from the server's reply
55
+ def delete request_pb, options = nil
56
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
+
58
+ verb, uri, query_string_params, body = transcode_delete_request request_pb
59
+ query_string_params = if query_string_params.any?
60
+ query_string_params.to_h { |p| p.split("=", 2) }
61
+ else
62
+ {}
63
+ end
64
+
65
+ response = @client_stub.make_http_request(
66
+ verb,
67
+ uri: uri,
68
+ body: body || "",
69
+ params: query_string_params,
70
+ options: options
71
+ )
72
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
73
+
74
+ yield result, response if block_given?
75
+ result
76
+ end
77
+
78
+ ##
79
+ # Baseline implementation for the get REST call
80
+ #
81
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionTargetTcpProxyRequest]
82
+ # A request object representing the call parameters. Required.
83
+ # @param options [::Gapic::CallOptions]
84
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
85
+ #
86
+ # @yield [result, response] Access the result along with the Faraday response object
87
+ # @yieldparam result [::Google::Cloud::Compute::V1::TargetTcpProxy]
88
+ # @yieldparam response [::Faraday::Response]
89
+ #
90
+ # @return [::Google::Cloud::Compute::V1::TargetTcpProxy]
91
+ # A result object deserialized from the server's reply
92
+ def get request_pb, options = nil
93
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
94
+
95
+ verb, uri, query_string_params, body = transcode_get_request request_pb
96
+ query_string_params = if query_string_params.any?
97
+ query_string_params.to_h { |p| p.split("=", 2) }
98
+ else
99
+ {}
100
+ end
101
+
102
+ response = @client_stub.make_http_request(
103
+ verb,
104
+ uri: uri,
105
+ body: body || "",
106
+ params: query_string_params,
107
+ options: options
108
+ )
109
+ result = ::Google::Cloud::Compute::V1::TargetTcpProxy.decode_json response.body, ignore_unknown_fields: true
110
+
111
+ yield result, response if block_given?
112
+ result
113
+ end
114
+
115
+ ##
116
+ # Baseline implementation for the insert REST call
117
+ #
118
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionTargetTcpProxyRequest]
119
+ # A request object representing the call parameters. Required.
120
+ # @param options [::Gapic::CallOptions]
121
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
122
+ #
123
+ # @yield [result, response] Access the result along with the Faraday response object
124
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
125
+ # @yieldparam response [::Faraday::Response]
126
+ #
127
+ # @return [::Google::Cloud::Compute::V1::Operation]
128
+ # A result object deserialized from the server's reply
129
+ def insert request_pb, options = nil
130
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
131
+
132
+ verb, uri, query_string_params, body = transcode_insert_request request_pb
133
+ query_string_params = if query_string_params.any?
134
+ query_string_params.to_h { |p| p.split("=", 2) }
135
+ else
136
+ {}
137
+ end
138
+
139
+ response = @client_stub.make_http_request(
140
+ verb,
141
+ uri: uri,
142
+ body: body || "",
143
+ params: query_string_params,
144
+ options: options
145
+ )
146
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
147
+
148
+ yield result, response if block_given?
149
+ result
150
+ end
151
+
152
+ ##
153
+ # Baseline implementation for the list REST call
154
+ #
155
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionTargetTcpProxiesRequest]
156
+ # A request object representing the call parameters. Required.
157
+ # @param options [::Gapic::CallOptions]
158
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
159
+ #
160
+ # @yield [result, response] Access the result along with the Faraday response object
161
+ # @yieldparam result [::Google::Cloud::Compute::V1::TargetTcpProxyList]
162
+ # @yieldparam response [::Faraday::Response]
163
+ #
164
+ # @return [::Google::Cloud::Compute::V1::TargetTcpProxyList]
165
+ # A result object deserialized from the server's reply
166
+ def list request_pb, options = nil
167
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
168
+
169
+ verb, uri, query_string_params, body = transcode_list_request request_pb
170
+ query_string_params = if query_string_params.any?
171
+ query_string_params.to_h { |p| p.split("=", 2) }
172
+ else
173
+ {}
174
+ end
175
+
176
+ response = @client_stub.make_http_request(
177
+ verb,
178
+ uri: uri,
179
+ body: body || "",
180
+ params: query_string_params,
181
+ options: options
182
+ )
183
+ result = ::Google::Cloud::Compute::V1::TargetTcpProxyList.decode_json response.body, ignore_unknown_fields: true
184
+
185
+ yield result, response if block_given?
186
+ result
187
+ end
188
+
189
+
190
+ private
191
+
192
+ ##
193
+ # @private
194
+ #
195
+ # GRPC transcoding helper method for the delete REST call
196
+ #
197
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionTargetTcpProxyRequest]
198
+ # A request object representing the call parameters. Required.
199
+ # @return [Array(String, [String, nil], Hash{String => String})]
200
+ # Uri, Body, Query string parameters
201
+ def transcode_delete_request request_pb
202
+ transcoder = Gapic::Rest::GrpcTranscoder.new
203
+ .with_bindings(
204
+ uri_method: :delete,
205
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies/{target_tcp_proxy}",
206
+ matches: [
207
+ ["project", %r{^[^/]+/?$}, false],
208
+ ["region", %r{^[^/]+/?$}, false],
209
+ ["target_tcp_proxy", %r{^[^/]+/?$}, false]
210
+ ]
211
+ )
212
+ transcoder.transcode request_pb
213
+ end
214
+
215
+ ##
216
+ # @private
217
+ #
218
+ # GRPC transcoding helper method for the get REST call
219
+ #
220
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionTargetTcpProxyRequest]
221
+ # A request object representing the call parameters. Required.
222
+ # @return [Array(String, [String, nil], Hash{String => String})]
223
+ # Uri, Body, Query string parameters
224
+ def transcode_get_request request_pb
225
+ transcoder = Gapic::Rest::GrpcTranscoder.new
226
+ .with_bindings(
227
+ uri_method: :get,
228
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies/{target_tcp_proxy}",
229
+ matches: [
230
+ ["project", %r{^[^/]+/?$}, false],
231
+ ["region", %r{^[^/]+/?$}, false],
232
+ ["target_tcp_proxy", %r{^[^/]+/?$}, false]
233
+ ]
234
+ )
235
+ transcoder.transcode request_pb
236
+ end
237
+
238
+ ##
239
+ # @private
240
+ #
241
+ # GRPC transcoding helper method for the insert REST call
242
+ #
243
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionTargetTcpProxyRequest]
244
+ # A request object representing the call parameters. Required.
245
+ # @return [Array(String, [String, nil], Hash{String => String})]
246
+ # Uri, Body, Query string parameters
247
+ def transcode_insert_request request_pb
248
+ transcoder = Gapic::Rest::GrpcTranscoder.new
249
+ .with_bindings(
250
+ uri_method: :post,
251
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies",
252
+ body: "target_tcp_proxy_resource",
253
+ matches: [
254
+ ["project", %r{^[^/]+/?$}, false],
255
+ ["region", %r{^[^/]+/?$}, false]
256
+ ]
257
+ )
258
+ transcoder.transcode request_pb
259
+ end
260
+
261
+ ##
262
+ # @private
263
+ #
264
+ # GRPC transcoding helper method for the list REST call
265
+ #
266
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionTargetTcpProxiesRequest]
267
+ # A request object representing the call parameters. Required.
268
+ # @return [Array(String, [String, nil], Hash{String => String})]
269
+ # Uri, Body, Query string parameters
270
+ def transcode_list_request request_pb
271
+ transcoder = Gapic::Rest::GrpcTranscoder.new
272
+ .with_bindings(
273
+ uri_method: :get,
274
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/targetTcpProxies",
275
+ matches: [
276
+ ["project", %r{^[^/]+/?$}, false],
277
+ ["region", %r{^[^/]+/?$}, false]
278
+ ]
279
+ )
280
+ transcoder.transcode request_pb
281
+ end
282
+ end
283
+ end
284
+ end
285
+ end
286
+ end
287
+ end
288
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/compute/v1/region_target_tcp_proxies/rest/client"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module RegionTargetTcpProxies
26
+ # Client for the REST transport
27
+ module Rest
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/region_target_tcp_proxies/credentials"
25
+ require "google/cloud/compute/v1/region_target_tcp_proxies/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ ##
32
+ # The RegionTargetTcpProxies API.
33
+ #
34
+ # To load this service and instantiate a REST client:
35
+ #
36
+ # require "google/cloud/compute/v1/region_target_tcp_proxies"
37
+ # client = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client.new
38
+ #
39
+ module RegionTargetTcpProxies
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ helper_path = ::File.join __dir__, "region_target_tcp_proxies", "helpers.rb"
47
+ require "google/cloud/compute/v1/region_target_tcp_proxies/helpers" if ::File.file? helper_path
@@ -230,8 +230,11 @@ module Google
230
230
  return result
231
231
  end
232
232
  rescue ::Faraday::Error => e
233
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
234
- raise ::Google::Cloud::Error.from_error(gapic_error)
233
+ begin
234
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
235
+ rescue ::Gapic::Rest::Error => gapic_error
236
+ raise ::Google::Cloud::Error.from_error gapic_error
237
+ end
235
238
  end
236
239
 
237
240
  ##
@@ -295,8 +298,11 @@ module Google
295
298
  return result
296
299
  end
297
300
  rescue ::Faraday::Error => e
298
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
299
- raise ::Google::Cloud::Error.from_error(gapic_error)
301
+ begin
302
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
303
+ rescue ::Gapic::Rest::Error => gapic_error
304
+ raise ::Google::Cloud::Error.from_error gapic_error
305
+ end
300
306
  end
301
307
 
302
308
  ##
@@ -371,8 +377,11 @@ module Google
371
377
  return result
372
378
  end
373
379
  rescue ::Faraday::Error => e
374
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
375
- raise ::Google::Cloud::Error.from_error(gapic_error)
380
+ begin
381
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
382
+ rescue ::Gapic::Rest::Error => gapic_error
383
+ raise ::Google::Cloud::Error.from_error gapic_error
384
+ end
376
385
  end
377
386
 
378
387
  ##
@@ -445,8 +454,11 @@ module Google
445
454
  return result
446
455
  end
447
456
  rescue ::Faraday::Error => e
448
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
449
- raise ::Google::Cloud::Error.from_error(gapic_error)
457
+ begin
458
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
459
+ rescue ::Gapic::Rest::Error => gapic_error
460
+ raise ::Google::Cloud::Error.from_error gapic_error
461
+ end
450
462
  end
451
463
 
452
464
  ##
@@ -523,8 +535,11 @@ module Google
523
535
  return result
524
536
  end
525
537
  rescue ::Faraday::Error => e
526
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
527
- raise ::Google::Cloud::Error.from_error(gapic_error)
538
+ begin
539
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
540
+ rescue ::Gapic::Rest::Error => gapic_error
541
+ raise ::Google::Cloud::Error.from_error gapic_error
542
+ end
528
543
  end
529
544
 
530
545
  ##
@@ -601,8 +616,11 @@ module Google
601
616
  return result
602
617
  end
603
618
  rescue ::Faraday::Error => e
604
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
605
- raise ::Google::Cloud::Error.from_error(gapic_error)
619
+ begin
620
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
621
+ rescue ::Gapic::Rest::Error => gapic_error
622
+ raise ::Google::Cloud::Error.from_error gapic_error
623
+ end
606
624
  end
607
625
 
608
626
  ##
@@ -668,8 +686,11 @@ module Google
668
686
  return result
669
687
  end
670
688
  rescue ::Faraday::Error => e
671
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
672
- raise ::Google::Cloud::Error.from_error(gapic_error)
689
+ begin
690
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
691
+ rescue ::Gapic::Rest::Error => gapic_error
692
+ raise ::Google::Cloud::Error.from_error gapic_error
693
+ end
673
694
  end
674
695
 
675
696
  ##
@@ -35,7 +35,7 @@ module Google
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
39
  end
40
40
 
41
41
  ##
@@ -194,8 +194,11 @@ module Google
194
194
  return result
195
195
  end
196
196
  rescue ::Faraday::Error => e
197
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
198
- raise ::Google::Cloud::Error.from_error(gapic_error)
197
+ begin
198
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
199
+ rescue ::Gapic::Rest::Error => gapic_error
200
+ raise ::Google::Cloud::Error.from_error gapic_error
201
+ end
199
202
  end
200
203
 
201
204
  ##
@@ -266,8 +269,11 @@ module Google
266
269
  return result
267
270
  end
268
271
  rescue ::Faraday::Error => e
269
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
270
- raise ::Google::Cloud::Error.from_error(gapic_error)
272
+ begin
273
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
274
+ rescue ::Gapic::Rest::Error => gapic_error
275
+ raise ::Google::Cloud::Error.from_error gapic_error
276
+ end
271
277
  end
272
278
 
273
279
  ##
@@ -35,7 +35,7 @@ module Google
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
39
  end
40
40
 
41
41
  ##
@@ -240,8 +240,11 @@ module Google
240
240
  return result
241
241
  end
242
242
  rescue ::Faraday::Error => e
243
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
244
- raise ::Google::Cloud::Error.from_error(gapic_error)
243
+ begin
244
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
245
+ rescue ::Gapic::Rest::Error => gapic_error
246
+ raise ::Google::Cloud::Error.from_error gapic_error
247
+ end
245
248
  end
246
249
 
247
250
  ##
@@ -316,8 +319,11 @@ module Google
316
319
  return result
317
320
  end
318
321
  rescue ::Faraday::Error => e
319
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
320
- raise ::Google::Cloud::Error.from_error(gapic_error)
322
+ begin
323
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
324
+ rescue ::Gapic::Rest::Error => gapic_error
325
+ raise ::Google::Cloud::Error.from_error gapic_error
326
+ end
321
327
  end
322
328
 
323
329
  ##
@@ -381,8 +387,11 @@ module Google
381
387
  return result
382
388
  end
383
389
  rescue ::Faraday::Error => e
384
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
385
- raise ::Google::Cloud::Error.from_error(gapic_error)
390
+ begin
391
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
392
+ rescue ::Gapic::Rest::Error => gapic_error
393
+ raise ::Google::Cloud::Error.from_error gapic_error
394
+ end
386
395
  end
387
396
 
388
397
  ##
@@ -448,8 +457,11 @@ module Google
448
457
  return result
449
458
  end
450
459
  rescue ::Faraday::Error => e
451
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
452
- raise ::Google::Cloud::Error.from_error(gapic_error)
460
+ begin
461
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
462
+ rescue ::Gapic::Rest::Error => gapic_error
463
+ raise ::Google::Cloud::Error.from_error gapic_error
464
+ end
453
465
  end
454
466
 
455
467
  ##
@@ -524,8 +536,11 @@ module Google
524
536
  return result
525
537
  end
526
538
  rescue ::Faraday::Error => e
527
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
528
- raise ::Google::Cloud::Error.from_error(gapic_error)
539
+ begin
540
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
541
+ rescue ::Gapic::Rest::Error => gapic_error
542
+ raise ::Google::Cloud::Error.from_error gapic_error
543
+ end
529
544
  end
530
545
 
531
546
  ##
@@ -598,8 +613,11 @@ module Google
598
613
  return result
599
614
  end
600
615
  rescue ::Faraday::Error => e
601
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
602
- raise ::Google::Cloud::Error.from_error(gapic_error)
616
+ begin
617
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
618
+ rescue ::Gapic::Rest::Error => gapic_error
619
+ raise ::Google::Cloud::Error.from_error gapic_error
620
+ end
603
621
  end
604
622
 
605
623
  ##
@@ -676,8 +694,11 @@ module Google
676
694
  return result
677
695
  end
678
696
  rescue ::Faraday::Error => e
679
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
680
- raise ::Google::Cloud::Error.from_error(gapic_error)
697
+ begin
698
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
699
+ rescue ::Gapic::Rest::Error => gapic_error
700
+ raise ::Google::Cloud::Error.from_error gapic_error
701
+ end
681
702
  end
682
703
 
683
704
  ##
@@ -743,8 +764,11 @@ module Google
743
764
  return result
744
765
  end
745
766
  rescue ::Faraday::Error => e
746
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
747
- raise ::Google::Cloud::Error.from_error(gapic_error)
767
+ begin
768
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
769
+ rescue ::Gapic::Rest::Error => gapic_error
770
+ raise ::Google::Cloud::Error.from_error gapic_error
771
+ end
748
772
  end
749
773
 
750
774
  ##
@@ -810,8 +834,11 @@ module Google
810
834
  return result
811
835
  end
812
836
  rescue ::Faraday::Error => e
813
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
814
- raise ::Google::Cloud::Error.from_error(gapic_error)
837
+ begin
838
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
839
+ rescue ::Gapic::Rest::Error => gapic_error
840
+ raise ::Google::Cloud::Error.from_error gapic_error
841
+ end
815
842
  end
816
843
 
817
844
  ##
@@ -891,8 +918,11 @@ module Google
891
918
  return result
892
919
  end
893
920
  rescue ::Faraday::Error => e
894
- gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
895
- raise ::Google::Cloud::Error.from_error(gapic_error)
921
+ begin
922
+ raise ::Gapic::Rest::Error.wrap_faraday_error e
923
+ rescue ::Gapic::Rest::Error => gapic_error
924
+ raise ::Google::Cloud::Error.from_error gapic_error
925
+ end
896
926
  end
897
927
 
898
928
  ##
@@ -35,7 +35,7 @@ module Google
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
39
39
  end
40
40
 
41
41
  ##