google-cloud-compute-v1 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +90 -52
  4. data/lib/google/cloud/compute/v1/accelerator_types.rb +5 -0
  5. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +156 -89
  6. data/lib/google/cloud/compute/v1/addresses.rb +3 -0
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +222 -129
  8. data/lib/google/cloud/compute/v1/autoscalers.rb +3 -0
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +285 -161
  10. data/lib/google/cloud/compute/v1/backend_buckets.rb +3 -0
  11. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +383 -221
  12. data/lib/google/cloud/compute/v1/backend_services.rb +3 -0
  13. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +90 -52
  14. data/lib/google/cloud/compute/v1/disk_types.rb +3 -0
  15. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +429 -240
  16. data/lib/google/cloud/compute/v1/disks.rb +3 -0
  17. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +189 -102
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways.rb +3 -0
  19. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +555 -330
  20. data/lib/google/cloud/compute/v1/firewall_policies.rb +3 -0
  21. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +187 -104
  22. data/lib/google/cloud/compute/v1/firewalls.rb +3 -0
  23. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +258 -146
  24. data/lib/google/cloud/compute/v1/forwarding_rules.rb +3 -0
  25. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +121 -66
  26. data/lib/google/cloud/compute/v1/global_addresses.rb +3 -0
  27. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +221 -122
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules.rb +3 -0
  29. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +219 -126
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups.rb +3 -0
  31. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +154 -86
  32. data/lib/google/cloud/compute/v1/global_operations.rb +3 -0
  33. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +84 -49
  34. data/lib/google/cloud/compute/v1/global_organization_operations.rb +3 -0
  35. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +154 -85
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes.rb +3 -0
  37. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +218 -127
  38. data/lib/google/cloud/compute/v1/health_checks.rb +3 -0
  39. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +27 -7
  40. data/lib/google/cloud/compute/v1/image_family_views.rb +3 -0
  41. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +354 -194
  42. data/lib/google/cloud/compute/v1/images.rb +3 -0
  43. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +664 -381
  44. data/lib/google/cloud/compute/v1/instance_group_managers.rb +3 -0
  45. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +292 -169
  46. data/lib/google/cloud/compute/v1/instance_groups.rb +3 -0
  47. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +221 -120
  48. data/lib/google/cloud/compute/v1/instance_templates.rb +3 -0
  49. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +1503 -845
  50. data/lib/google/cloud/compute/v1/instances.rb +3 -0
  51. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +190 -109
  52. data/lib/google/cloud/compute/v1/interconnect_attachments.rb +3 -0
  53. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +57 -29
  54. data/lib/google/cloud/compute/v1/interconnect_locations.rb +3 -0
  55. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +187 -102
  56. data/lib/google/cloud/compute/v1/interconnects.rb +3 -0
  57. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +60 -25
  58. data/lib/google/cloud/compute/v1/license_codes.rb +3 -0
  59. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +221 -120
  60. data/lib/google/cloud/compute/v1/licenses.rb +3 -0
  61. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +221 -121
  62. data/lib/google/cloud/compute/v1/machine_images.rb +3 -0
  63. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +90 -52
  64. data/lib/google/cloud/compute/v1/machine_types.rb +3 -0
  65. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +158 -89
  66. data/lib/google/cloud/compute/v1/network_edge_security_services.rb +3 -0
  67. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +293 -168
  68. data/lib/google/cloud/compute/v1/network_endpoint_groups.rb +3 -0
  69. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +513 -293
  70. data/lib/google/cloud/compute/v1/network_firewall_policies.rb +3 -0
  71. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +350 -202
  72. data/lib/google/cloud/compute/v1/networks.rb +3 -0
  73. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +428 -242
  74. data/lib/google/cloud/compute/v1/node_groups.rb +3 -0
  75. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +259 -143
  76. data/lib/google/cloud/compute/v1/node_templates.rb +3 -0
  77. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +90 -52
  78. data/lib/google/cloud/compute/v1/node_types.rb +3 -0
  79. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +225 -126
  80. data/lib/google/cloud/compute/v1/packet_mirrorings.rb +3 -0
  81. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +406 -238
  82. data/lib/google/cloud/compute/v1/projects.rb +3 -0
  83. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +154 -85
  84. data/lib/google/cloud/compute/v1/public_advertised_prefixes.rb +3 -0
  85. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +190 -108
  86. data/lib/google/cloud/compute/v1/public_delegated_prefixes.rb +3 -0
  87. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +191 -106
  88. data/lib/google/cloud/compute/v1/region_autoscalers.rb +3 -0
  89. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +228 -122
  90. data/lib/google/cloud/compute/v1/region_backend_services.rb +3 -0
  91. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +157 -92
  92. data/lib/google/cloud/compute/v1/region_commitments.rb +3 -0
  93. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +59 -29
  94. data/lib/google/cloud/compute/v1/region_disk_types.rb +3 -0
  95. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +398 -216
  96. data/lib/google/cloud/compute/v1/region_disks.rb +3 -0
  97. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +159 -85
  98. data/lib/google/cloud/compute/v1/region_health_check_services.rb +3 -0
  99. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +193 -104
  100. data/lib/google/cloud/compute/v1/region_health_checks.rb +3 -0
  101. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +633 -358
  102. data/lib/google/cloud/compute/v1/region_instance_group_managers.rb +3 -0
  103. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +127 -71
  104. data/lib/google/cloud/compute/v1/region_instance_groups.rb +3 -0
  105. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +26 -9
  106. data/lib/google/cloud/compute/v1/region_instances.rb +3 -0
  107. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +125 -66
  108. data/lib/google/cloud/compute/v1/region_network_endpoint_groups.rb +3 -0
  109. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +561 -311
  110. data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +3 -0
  111. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +125 -66
  112. data/lib/google/cloud/compute/v1/region_notification_endpoints.rb +3 -0
  113. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +127 -63
  114. data/lib/google/cloud/compute/v1/region_operations.rb +3 -0
  115. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +159 -86
  116. data/lib/google/cloud/compute/v1/region_security_policies.rb +3 -0
  117. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +125 -66
  118. data/lib/google/cloud/compute/v1/region_ssl_certificates.rb +3 -0
  119. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +159 -85
  120. data/lib/google/cloud/compute/v1/region_target_http_proxies.rb +3 -0
  121. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +227 -123
  122. data/lib/google/cloud/compute/v1/region_target_https_proxies.rb +3 -0
  123. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +228 -122
  124. data/lib/google/cloud/compute/v1/region_url_maps.rb +3 -0
  125. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +57 -29
  126. data/lib/google/cloud/compute/v1/regions.rb +3 -0
  127. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +327 -183
  128. data/lib/google/cloud/compute/v1/reservations.rb +3 -0
  129. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +259 -143
  130. data/lib/google/cloud/compute/v1/resource_policies.rb +3 -0
  131. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +326 -184
  132. data/lib/google/cloud/compute/v1/routers.rb +3 -0
  133. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +121 -66
  134. data/lib/google/cloud/compute/v1/routes.rb +3 -0
  135. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +346 -206
  136. data/lib/google/cloud/compute/v1/security_policies.rb +3 -0
  137. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +293 -162
  138. data/lib/google/cloud/compute/v1/service_attachments.rb +3 -0
  139. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +255 -138
  140. data/lib/google/cloud/compute/v1/snapshots.rb +3 -0
  141. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +152 -89
  142. data/lib/google/cloud/compute/v1/ssl_certificates.rb +3 -0
  143. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +185 -107
  144. data/lib/google/cloud/compute/v1/ssl_policies.rb +3 -0
  145. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +392 -223
  146. data/lib/google/cloud/compute/v1/subnetworks.rb +3 -0
  147. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +154 -85
  148. data/lib/google/cloud/compute/v1/target_grpc_proxies.rb +3 -0
  149. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +218 -127
  150. data/lib/google/cloud/compute/v1/target_http_proxies.rb +3 -0
  151. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +350 -203
  152. data/lib/google/cloud/compute/v1/target_https_proxies.rb +3 -0
  153. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +156 -89
  154. data/lib/google/cloud/compute/v1/target_instances.rb +3 -0
  155. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +361 -203
  156. data/lib/google/cloud/compute/v1/target_pools.rb +3 -0
  157. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +286 -161
  158. data/lib/google/cloud/compute/v1/target_ssl_proxies.rb +3 -0
  159. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +187 -104
  160. data/lib/google/cloud/compute/v1/target_tcp_proxies.rb +3 -0
  161. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +156 -89
  162. data/lib/google/cloud/compute/v1/target_vpn_gateways.rb +3 -0
  163. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +285 -164
  164. data/lib/google/cloud/compute/v1/url_maps.rb +3 -0
  165. data/lib/google/cloud/compute/v1/version.rb +1 -1
  166. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +259 -143
  167. data/lib/google/cloud/compute/v1/vpn_gateways.rb +3 -0
  168. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +156 -89
  169. data/lib/google/cloud/compute/v1/vpn_tunnels.rb +3 -0
  170. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +127 -63
  171. data/lib/google/cloud/compute/v1/zone_operations.rb +3 -0
  172. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +57 -29
  173. data/lib/google/cloud/compute/v1/zones.rb +3 -0
  174. metadata +11 -11
@@ -55,9 +55,17 @@ module Google
55
55
  def aggregated_list request_pb, options = nil
56
56
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
57
 
58
- uri, _body, query_string_params = transcode_aggregated_list_request request_pb
59
- response = @client_stub.make_get_request(
58
+ verb, uri, query_string_params, body = transcode_aggregated_list_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,
60
67
  uri: uri,
68
+ body: body || "",
61
69
  params: query_string_params,
62
70
  options: options
63
71
  )
@@ -67,27 +75,6 @@ module Google
67
75
  result
68
76
  end
69
77
 
70
- ##
71
- # GRPC transcoding helper method for the aggregated_list REST call
72
- #
73
- # @param request_pb [::Google::Cloud::Compute::V1::AggregatedListRegionCommitmentsRequest]
74
- # A request object representing the call parameters. Required.
75
- # @return [Array(String, [String, nil], Hash{String => String})]
76
- # Uri, Body, Query string parameters
77
- def transcode_aggregated_list_request request_pb
78
- uri = "/compute/v1/projects/#{request_pb.project}/aggregated/commitments"
79
- body = nil
80
- query_string_params = {}
81
- query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
82
- query_string_params["includeAllScopes"] = request_pb.include_all_scopes.to_s if request_pb.has_include_all_scopes?
83
- query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
84
- query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
85
- query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
86
- query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
87
-
88
- [uri, body, query_string_params]
89
- end
90
-
91
78
  ##
92
79
  # Baseline implementation for the get REST call
93
80
  #
@@ -105,9 +92,18 @@ module Google
105
92
  def get request_pb, options = nil
106
93
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
107
94
 
108
- uri, _body, _query_string_params = transcode_get_request request_pb
109
- response = @client_stub.make_get_request(
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,
110
104
  uri: uri,
105
+ body: body || "",
106
+ params: query_string_params,
111
107
  options: options
112
108
  )
113
109
  result = ::Google::Cloud::Compute::V1::Commitment.decode_json response.body, ignore_unknown_fields: true
@@ -116,21 +112,6 @@ module Google
116
112
  result
117
113
  end
118
114
 
119
- ##
120
- # GRPC transcoding helper method for the get REST call
121
- #
122
- # @param request_pb [::Google::Cloud::Compute::V1::GetRegionCommitmentRequest]
123
- # A request object representing the call parameters. Required.
124
- # @return [Array(String, [String, nil], Hash{String => String})]
125
- # Uri, Body, Query string parameters
126
- def transcode_get_request request_pb
127
- uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/commitments/#{request_pb.commitment}"
128
- body = nil
129
- query_string_params = {}
130
-
131
- [uri, body, query_string_params]
132
- end
133
-
134
115
  ##
135
116
  # Baseline implementation for the insert REST call
136
117
  #
@@ -148,10 +129,17 @@ module Google
148
129
  def insert request_pb, options = nil
149
130
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
150
131
 
151
- uri, body, query_string_params = transcode_insert_request request_pb
152
- response = @client_stub.make_post_request(
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,
153
141
  uri: uri,
154
- body: body,
142
+ body: body || "",
155
143
  params: query_string_params,
156
144
  options: options
157
145
  )
@@ -161,22 +149,6 @@ module Google
161
149
  result
162
150
  end
163
151
 
164
- ##
165
- # GRPC transcoding helper method for the insert REST call
166
- #
167
- # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionCommitmentRequest]
168
- # A request object representing the call parameters. Required.
169
- # @return [Array(String, [String, nil], Hash{String => String})]
170
- # Uri, Body, Query string parameters
171
- def transcode_insert_request request_pb
172
- uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/commitments"
173
- body = request_pb.commitment_resource.to_json
174
- query_string_params = {}
175
- query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
176
-
177
- [uri, body, query_string_params]
178
- end
179
-
180
152
  ##
181
153
  # Baseline implementation for the list REST call
182
154
  #
@@ -194,9 +166,17 @@ module Google
194
166
  def list request_pb, options = nil
195
167
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
196
168
 
197
- uri, _body, query_string_params = transcode_list_request request_pb
198
- response = @client_stub.make_get_request(
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,
199
178
  uri: uri,
179
+ body: body || "",
200
180
  params: query_string_params,
201
181
  options: options
202
182
  )
@@ -206,26 +186,6 @@ module Google
206
186
  result
207
187
  end
208
188
 
209
- ##
210
- # GRPC transcoding helper method for the list REST call
211
- #
212
- # @param request_pb [::Google::Cloud::Compute::V1::ListRegionCommitmentsRequest]
213
- # A request object representing the call parameters. Required.
214
- # @return [Array(String, [String, nil], Hash{String => String})]
215
- # Uri, Body, Query string parameters
216
- def transcode_list_request request_pb
217
- uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/commitments"
218
- body = nil
219
- query_string_params = {}
220
- query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
221
- query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
222
- query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
223
- query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
224
- query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
225
-
226
- [uri, body, query_string_params]
227
- end
228
-
229
189
  ##
230
190
  # Baseline implementation for the update REST call
231
191
  #
@@ -243,10 +203,17 @@ module Google
243
203
  def update request_pb, options = nil
244
204
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
245
205
 
246
- uri, body, query_string_params = transcode_update_request request_pb
247
- response = @client_stub.make_patch_request(
206
+ verb, uri, query_string_params, body = transcode_update_request request_pb
207
+ query_string_params = if query_string_params.any?
208
+ query_string_params.to_h { |p| p.split("=", 2) }
209
+ else
210
+ {}
211
+ end
212
+
213
+ response = @client_stub.make_http_request(
214
+ verb,
248
215
  uri: uri,
249
- body: body,
216
+ body: body || "",
250
217
  params: query_string_params,
251
218
  options: options
252
219
  )
@@ -256,7 +223,101 @@ module Google
256
223
  result
257
224
  end
258
225
 
226
+
227
+ private
228
+
229
+ ##
230
+ # @private
231
+ #
232
+ # GRPC transcoding helper method for the aggregated_list REST call
233
+ #
234
+ # @param request_pb [::Google::Cloud::Compute::V1::AggregatedListRegionCommitmentsRequest]
235
+ # A request object representing the call parameters. Required.
236
+ # @return [Array(String, [String, nil], Hash{String => String})]
237
+ # Uri, Body, Query string parameters
238
+ def transcode_aggregated_list_request request_pb
239
+ transcoder = Gapic::Rest::GrpcTranscoder.new
240
+ .with_bindings(
241
+ uri_method: :get,
242
+ uri_template: "/compute/v1/projects/{project}/aggregated/commitments",
243
+ matches: [
244
+ ["project", %r{[^/]+}, false]
245
+ ]
246
+ )
247
+ transcoder.transcode request_pb
248
+ end
249
+
250
+ ##
251
+ # @private
252
+ #
253
+ # GRPC transcoding helper method for the get REST call
254
+ #
255
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionCommitmentRequest]
256
+ # A request object representing the call parameters. Required.
257
+ # @return [Array(String, [String, nil], Hash{String => String})]
258
+ # Uri, Body, Query string parameters
259
+ def transcode_get_request request_pb
260
+ transcoder = Gapic::Rest::GrpcTranscoder.new
261
+ .with_bindings(
262
+ uri_method: :get,
263
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}",
264
+ matches: [
265
+ ["project", %r{[^/]+}, false],
266
+ ["region", %r{[^/]+}, false],
267
+ ["commitment", %r{[^/]+}, false]
268
+ ]
269
+ )
270
+ transcoder.transcode request_pb
271
+ end
272
+
259
273
  ##
274
+ # @private
275
+ #
276
+ # GRPC transcoding helper method for the insert REST call
277
+ #
278
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionCommitmentRequest]
279
+ # A request object representing the call parameters. Required.
280
+ # @return [Array(String, [String, nil], Hash{String => String})]
281
+ # Uri, Body, Query string parameters
282
+ def transcode_insert_request request_pb
283
+ transcoder = Gapic::Rest::GrpcTranscoder.new
284
+ .with_bindings(
285
+ uri_method: :post,
286
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/commitments",
287
+ body: "commitment_resource",
288
+ matches: [
289
+ ["project", %r{[^/]+}, false],
290
+ ["region", %r{[^/]+}, false]
291
+ ]
292
+ )
293
+ transcoder.transcode request_pb
294
+ end
295
+
296
+ ##
297
+ # @private
298
+ #
299
+ # GRPC transcoding helper method for the list REST call
300
+ #
301
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionCommitmentsRequest]
302
+ # A request object representing the call parameters. Required.
303
+ # @return [Array(String, [String, nil], Hash{String => String})]
304
+ # Uri, Body, Query string parameters
305
+ def transcode_list_request request_pb
306
+ transcoder = Gapic::Rest::GrpcTranscoder.new
307
+ .with_bindings(
308
+ uri_method: :get,
309
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/commitments",
310
+ matches: [
311
+ ["project", %r{[^/]+}, false],
312
+ ["region", %r{[^/]+}, false]
313
+ ]
314
+ )
315
+ transcoder.transcode request_pb
316
+ end
317
+
318
+ ##
319
+ # @private
320
+ #
260
321
  # GRPC transcoding helper method for the update REST call
261
322
  #
262
323
  # @param request_pb [::Google::Cloud::Compute::V1::UpdateRegionCommitmentRequest]
@@ -264,14 +325,18 @@ module Google
264
325
  # @return [Array(String, [String, nil], Hash{String => String})]
265
326
  # Uri, Body, Query string parameters
266
327
  def transcode_update_request request_pb
267
- uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/commitments/#{request_pb.commitment}"
268
- body = request_pb.commitment_resource.to_json
269
- query_string_params = {}
270
- query_string_params["paths"] = request_pb.paths.to_s if request_pb.has_paths?
271
- query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
272
- query_string_params["updateMask"] = request_pb.update_mask.to_s if request_pb.has_update_mask?
273
-
274
- [uri, body, query_string_params]
328
+ transcoder = Gapic::Rest::GrpcTranscoder.new
329
+ .with_bindings(
330
+ uri_method: :patch,
331
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}",
332
+ body: "commitment_resource",
333
+ matches: [
334
+ ["project", %r{[^/]+}, false],
335
+ ["region", %r{[^/]+}, false],
336
+ ["commitment", %r{[^/]+}, false]
337
+ ]
338
+ )
339
+ transcoder.transcode request_pb
275
340
  end
276
341
  end
277
342
  end
@@ -28,6 +28,9 @@ module Google
28
28
  module Cloud
29
29
  module Compute
30
30
  module V1
31
+ ##
32
+ # The RegionCommitments API.
33
+ #
31
34
  # To load this service and instantiate a REST client:
32
35
  #
33
36
  # require "google/cloud/compute/v1/region_commitments"
@@ -55,9 +55,18 @@ module Google
55
55
  def get request_pb, options = nil
56
56
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
57
 
58
- uri, _body, _query_string_params = transcode_get_request request_pb
59
- response = @client_stub.make_get_request(
58
+ verb, uri, query_string_params, body = transcode_get_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,
60
67
  uri: uri,
68
+ body: body || "",
69
+ params: query_string_params,
61
70
  options: options
62
71
  )
63
72
  result = ::Google::Cloud::Compute::V1::DiskType.decode_json response.body, ignore_unknown_fields: true
@@ -66,21 +75,6 @@ module Google
66
75
  result
67
76
  end
68
77
 
69
- ##
70
- # GRPC transcoding helper method for the get REST call
71
- #
72
- # @param request_pb [::Google::Cloud::Compute::V1::GetRegionDiskTypeRequest]
73
- # A request object representing the call parameters. Required.
74
- # @return [Array(String, [String, nil], Hash{String => String})]
75
- # Uri, Body, Query string parameters
76
- def transcode_get_request request_pb
77
- uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/diskTypes/#{request_pb.disk_type}"
78
- body = nil
79
- query_string_params = {}
80
-
81
- [uri, body, query_string_params]
82
- end
83
-
84
78
  ##
85
79
  # Baseline implementation for the list REST call
86
80
  #
@@ -98,9 +92,17 @@ module Google
98
92
  def list request_pb, options = nil
99
93
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
100
94
 
101
- uri, _body, query_string_params = transcode_list_request request_pb
102
- response = @client_stub.make_get_request(
95
+ verb, uri, query_string_params, body = transcode_list_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,
103
104
  uri: uri,
105
+ body: body || "",
104
106
  params: query_string_params,
105
107
  options: options
106
108
  )
@@ -110,7 +112,35 @@ module Google
110
112
  result
111
113
  end
112
114
 
115
+
116
+ private
117
+
118
+ ##
119
+ # @private
120
+ #
121
+ # GRPC transcoding helper method for the get REST call
122
+ #
123
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionDiskTypeRequest]
124
+ # A request object representing the call parameters. Required.
125
+ # @return [Array(String, [String, nil], Hash{String => String})]
126
+ # Uri, Body, Query string parameters
127
+ def transcode_get_request request_pb
128
+ transcoder = Gapic::Rest::GrpcTranscoder.new
129
+ .with_bindings(
130
+ uri_method: :get,
131
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/diskTypes/{disk_type}",
132
+ matches: [
133
+ ["project", %r{[^/]+}, false],
134
+ ["region", %r{[^/]+}, false],
135
+ ["disk_type", %r{[^/]+}, false]
136
+ ]
137
+ )
138
+ transcoder.transcode request_pb
139
+ end
140
+
113
141
  ##
142
+ # @private
143
+ #
114
144
  # GRPC transcoding helper method for the list REST call
115
145
  #
116
146
  # @param request_pb [::Google::Cloud::Compute::V1::ListRegionDiskTypesRequest]
@@ -118,16 +148,16 @@ module Google
118
148
  # @return [Array(String, [String, nil], Hash{String => String})]
119
149
  # Uri, Body, Query string parameters
120
150
  def transcode_list_request request_pb
121
- uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/diskTypes"
122
- body = nil
123
- query_string_params = {}
124
- query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
125
- query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
126
- query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
127
- query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
128
- query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
129
-
130
- [uri, body, query_string_params]
151
+ transcoder = Gapic::Rest::GrpcTranscoder.new
152
+ .with_bindings(
153
+ uri_method: :get,
154
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/diskTypes",
155
+ matches: [
156
+ ["project", %r{[^/]+}, false],
157
+ ["region", %r{[^/]+}, false]
158
+ ]
159
+ )
160
+ transcoder.transcode request_pb
131
161
  end
132
162
  end
133
163
  end
@@ -28,6 +28,9 @@ module Google
28
28
  module Cloud
29
29
  module Compute
30
30
  module V1
31
+ ##
32
+ # The RegionDiskTypes API.
33
+ #
31
34
  # To load this service and instantiate a REST client:
32
35
  #
33
36
  # require "google/cloud/compute/v1/region_disk_types"