google-cloud-compute-v1 2.0.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +6 -4
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +3 -3
  4. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +6 -4
  5. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +6 -6
  6. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +7 -5
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +7 -7
  8. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +7 -5
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +9 -9
  10. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +7 -5
  11. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +14 -14
  12. data/lib/google/cloud/compute/v1/compute_pb.rb +42 -10746
  13. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +7 -5
  14. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +3 -3
  15. data/lib/google/cloud/compute/v1/disks/rest/client.rb +98 -5
  16. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +75 -13
  17. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +6 -4
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +6 -6
  19. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +8 -6
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +18 -18
  21. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +6 -4
  22. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +6 -6
  23. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +6 -4
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +8 -8
  25. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +7 -5
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +5 -5
  27. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +6 -4
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +7 -7
  29. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +7 -5
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +7 -7
  31. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +6 -4
  32. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +5 -5
  33. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +6 -4
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +3 -3
  35. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +6 -4
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +5 -5
  37. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +7 -5
  38. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +7 -7
  39. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +6 -4
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +1 -1
  41. data/lib/google/cloud/compute/v1/images/rest/client.rb +9 -7
  42. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +11 -11
  43. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +7 -5
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +20 -20
  45. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +6 -4
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +9 -9
  47. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +97 -8
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +66 -7
  49. data/lib/google/cloud/compute/v1/instances/rest/client.rb +95 -5
  50. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +107 -45
  51. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +6 -4
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +7 -7
  53. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +6 -4
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +2 -2
  55. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +6 -4
  56. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +7 -7
  57. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +6 -4
  58. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +2 -2
  59. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +6 -4
  60. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +7 -7
  61. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +7 -5
  62. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +7 -7
  63. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +7 -5
  64. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +3 -3
  65. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +6 -4
  66. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +8 -8
  67. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +6 -4
  68. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +5 -5
  69. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +7 -5
  70. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +9 -9
  71. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +6 -4
  72. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +16 -16
  73. data/lib/google/cloud/compute/v1/networks/rest/client.rb +7 -5
  74. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +11 -11
  75. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +94 -4
  76. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +75 -13
  77. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +7 -5
  78. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +8 -8
  79. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +7 -5
  80. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +3 -3
  81. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +6 -4
  82. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +7 -7
  83. data/lib/google/cloud/compute/v1/projects/rest/client.rb +6 -4
  84. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +13 -13
  85. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +6 -4
  86. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +5 -5
  87. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +6 -4
  88. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +6 -6
  89. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +6 -4
  90. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +6 -6
  91. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +6 -4
  92. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +9 -9
  93. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +7 -5
  94. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +5 -5
  95. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +7 -5
  96. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +2 -2
  97. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +97 -4
  98. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +74 -12
  99. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +6 -4
  100. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +5 -5
  101. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +7 -5
  102. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +6 -6
  103. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +6 -4
  104. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +19 -19
  105. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +6 -4
  106. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +4 -4
  107. data/lib/google/cloud/compute/v1/region_instance_templates/credentials.rb +52 -0
  108. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +626 -0
  109. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +291 -0
  110. data/lib/google/cloud/compute/v1/region_instance_templates/rest.rb +51 -0
  111. data/lib/google/cloud/compute/v1/region_instance_templates.rb +47 -0
  112. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +6 -4
  113. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +1 -1
  114. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +7 -5
  115. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +4 -4
  116. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +6 -4
  117. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +17 -17
  118. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +6 -4
  119. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +4 -4
  120. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +6 -4
  121. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +4 -4
  122. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +6 -4
  123. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +5 -5
  124. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +6 -4
  125. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +4 -4
  126. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +6 -4
  127. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +6 -6
  128. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +7 -5
  129. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +5 -5
  130. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +7 -5
  131. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +7 -7
  132. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +6 -4
  133. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +4 -4
  134. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +7 -5
  135. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +7 -7
  136. data/lib/google/cloud/compute/v1/regions/rest/client.rb +7 -5
  137. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +2 -2
  138. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +6 -4
  139. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +10 -10
  140. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +6 -4
  141. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +8 -8
  142. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  143. data/lib/google/cloud/compute/v1/routers/rest/client.rb +7 -5
  144. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +10 -10
  145. data/lib/google/cloud/compute/v1/routes/rest/client.rb +7 -5
  146. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +4 -4
  147. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +6 -4
  148. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +12 -12
  149. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +6 -4
  150. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +9 -9
  151. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +7 -5
  152. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +8 -8
  153. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +7 -5
  154. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +5 -5
  155. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +7 -5
  156. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +7 -7
  157. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +7 -5
  158. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +12 -12
  159. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +6 -4
  160. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +5 -5
  161. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +7 -5
  162. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +7 -7
  163. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +7 -5
  164. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +11 -11
  165. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +7 -5
  166. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +5 -5
  167. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +7 -5
  168. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +11 -11
  169. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +7 -5
  170. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +9 -9
  171. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +7 -5
  172. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +7 -7
  173. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +7 -5
  174. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +6 -6
  175. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +7 -5
  176. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +9 -9
  177. data/lib/google/cloud/compute/v1/version.rb +1 -1
  178. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +7 -5
  179. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +8 -8
  180. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +7 -5
  181. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +6 -6
  182. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +6 -4
  183. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +4 -4
  184. data/lib/google/cloud/compute/v1/zones/rest/client.rb +7 -5
  185. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +2 -2
  186. data/lib/google/cloud/compute/v1.rb +1 -0
  187. data/proto_docs/google/api/client.rb +67 -4
  188. data/proto_docs/google/cloud/compute/v1/compute.rb +414 -29
  189. metadata +9 -4
@@ -0,0 +1,291 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 RegionInstanceTemplates
26
+ module Rest
27
+ ##
28
+ # REST service stub for the RegionInstanceTemplates 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,
39
+ numeric_enums: false,
40
+ raise_faraday_errors: false
41
+ end
42
+
43
+ ##
44
+ # Baseline implementation for the delete REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionInstanceTemplateRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::Compute::V1::Operation]
56
+ # A result object deserialized from the server's reply
57
+ def delete request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
81
+ ##
82
+ # Baseline implementation for the get REST call
83
+ #
84
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionInstanceTemplateRequest]
85
+ # A request object representing the call parameters. Required.
86
+ # @param options [::Gapic::CallOptions]
87
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
88
+ #
89
+ # @yield [result, operation] Access the result along with the TransportOperation object
90
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceTemplate]
91
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
92
+ #
93
+ # @return [::Google::Cloud::Compute::V1::InstanceTemplate]
94
+ # A result object deserialized from the server's reply
95
+ def get request_pb, options = nil
96
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
97
+
98
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_request request_pb
99
+ query_string_params = if query_string_params.any?
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
+ else
102
+ {}
103
+ end
104
+
105
+ response = @client_stub.make_http_request(
106
+ verb,
107
+ uri: uri,
108
+ body: body || "",
109
+ params: query_string_params,
110
+ options: options
111
+ )
112
+ operation = ::Gapic::Rest::TransportOperation.new response
113
+ result = ::Google::Cloud::Compute::V1::InstanceTemplate.decode_json response.body, ignore_unknown_fields: true
114
+
115
+ yield result, operation if block_given?
116
+ result
117
+ end
118
+
119
+ ##
120
+ # Baseline implementation for the insert REST call
121
+ #
122
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionInstanceTemplateRequest]
123
+ # A request object representing the call parameters. Required.
124
+ # @param options [::Gapic::CallOptions]
125
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
126
+ #
127
+ # @yield [result, operation] Access the result along with the TransportOperation object
128
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
129
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
130
+ #
131
+ # @return [::Google::Cloud::Compute::V1::Operation]
132
+ # A result object deserialized from the server's reply
133
+ def insert request_pb, options = nil
134
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
135
+
136
+ verb, uri, query_string_params, body = ServiceStub.transcode_insert_request request_pb
137
+ query_string_params = if query_string_params.any?
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
+ else
140
+ {}
141
+ end
142
+
143
+ response = @client_stub.make_http_request(
144
+ verb,
145
+ uri: uri,
146
+ body: body || "",
147
+ params: query_string_params,
148
+ options: options
149
+ )
150
+ operation = ::Gapic::Rest::TransportOperation.new response
151
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
152
+
153
+ yield result, operation if block_given?
154
+ result
155
+ end
156
+
157
+ ##
158
+ # Baseline implementation for the list REST call
159
+ #
160
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionInstanceTemplatesRequest]
161
+ # A request object representing the call parameters. Required.
162
+ # @param options [::Gapic::CallOptions]
163
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
164
+ #
165
+ # @yield [result, operation] Access the result along with the TransportOperation object
166
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstanceTemplateList]
167
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
168
+ #
169
+ # @return [::Google::Cloud::Compute::V1::InstanceTemplateList]
170
+ # A result object deserialized from the server's reply
171
+ def list request_pb, options = nil
172
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
173
+
174
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_request request_pb
175
+ query_string_params = if query_string_params.any?
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
+ else
178
+ {}
179
+ end
180
+
181
+ response = @client_stub.make_http_request(
182
+ verb,
183
+ uri: uri,
184
+ body: body || "",
185
+ params: query_string_params,
186
+ options: options
187
+ )
188
+ operation = ::Gapic::Rest::TransportOperation.new response
189
+ result = ::Google::Cloud::Compute::V1::InstanceTemplateList.decode_json response.body, ignore_unknown_fields: true
190
+
191
+ yield result, operation if block_given?
192
+ result
193
+ end
194
+
195
+ ##
196
+ # @private
197
+ #
198
+ # GRPC transcoding helper method for the delete REST call
199
+ #
200
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionInstanceTemplateRequest]
201
+ # A request object representing the call parameters. Required.
202
+ # @return [Array(String, [String, nil], Hash{String => String})]
203
+ # Uri, Body, Query string parameters
204
+ def self.transcode_delete_request request_pb
205
+ transcoder = Gapic::Rest::GrpcTranscoder.new
206
+ .with_bindings(
207
+ uri_method: :delete,
208
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates/{instance_template}",
209
+ matches: [
210
+ ["project", %r{^[^/]+/?$}, false],
211
+ ["region", %r{^[^/]+/?$}, false],
212
+ ["instance_template", %r{^[^/]+/?$}, false]
213
+ ]
214
+ )
215
+ transcoder.transcode request_pb
216
+ end
217
+
218
+ ##
219
+ # @private
220
+ #
221
+ # GRPC transcoding helper method for the get REST call
222
+ #
223
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRegionInstanceTemplateRequest]
224
+ # A request object representing the call parameters. Required.
225
+ # @return [Array(String, [String, nil], Hash{String => String})]
226
+ # Uri, Body, Query string parameters
227
+ def self.transcode_get_request request_pb
228
+ transcoder = Gapic::Rest::GrpcTranscoder.new
229
+ .with_bindings(
230
+ uri_method: :get,
231
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates/{instance_template}",
232
+ matches: [
233
+ ["project", %r{^[^/]+/?$}, false],
234
+ ["region", %r{^[^/]+/?$}, false],
235
+ ["instance_template", %r{^[^/]+/?$}, false]
236
+ ]
237
+ )
238
+ transcoder.transcode request_pb
239
+ end
240
+
241
+ ##
242
+ # @private
243
+ #
244
+ # GRPC transcoding helper method for the insert REST call
245
+ #
246
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertRegionInstanceTemplateRequest]
247
+ # A request object representing the call parameters. Required.
248
+ # @return [Array(String, [String, nil], Hash{String => String})]
249
+ # Uri, Body, Query string parameters
250
+ def self.transcode_insert_request request_pb
251
+ transcoder = Gapic::Rest::GrpcTranscoder.new
252
+ .with_bindings(
253
+ uri_method: :post,
254
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates",
255
+ body: "instance_template_resource",
256
+ matches: [
257
+ ["project", %r{^[^/]+/?$}, false],
258
+ ["region", %r{^[^/]+/?$}, false]
259
+ ]
260
+ )
261
+ transcoder.transcode request_pb
262
+ end
263
+
264
+ ##
265
+ # @private
266
+ #
267
+ # GRPC transcoding helper method for the list REST call
268
+ #
269
+ # @param request_pb [::Google::Cloud::Compute::V1::ListRegionInstanceTemplatesRequest]
270
+ # A request object representing the call parameters. Required.
271
+ # @return [Array(String, [String, nil], Hash{String => String})]
272
+ # Uri, Body, Query string parameters
273
+ def self.transcode_list_request request_pb
274
+ transcoder = Gapic::Rest::GrpcTranscoder.new
275
+ .with_bindings(
276
+ uri_method: :get,
277
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates",
278
+ matches: [
279
+ ["project", %r{^[^/]+/?$}, false],
280
+ ["region", %r{^[^/]+/?$}, false]
281
+ ]
282
+ )
283
+ transcoder.transcode request_pb
284
+ end
285
+ end
286
+ end
287
+ end
288
+ end
289
+ end
290
+ end
291
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/compute/v1/version"
24
+
25
+ require "google/cloud/compute/v1/region_instance_templates/credentials"
26
+ require "google/cloud/compute/v1/region_instance_templates/rest/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Compute
31
+ module V1
32
+ ##
33
+ # The RegionInstanceTemplates API.
34
+ #
35
+ # To load this service and instantiate a REST client:
36
+ #
37
+ # require "google/cloud/compute/v1/region_instance_templates/rest"
38
+ # client = ::Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client.new
39
+ #
40
+ module RegionInstanceTemplates
41
+ # Client for the REST transport
42
+ module Rest
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
51
+ require "google/cloud/compute/v1/region_instance_templates/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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_instance_templates/credentials"
25
+ require "google/cloud/compute/v1/region_instance_templates/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ ##
32
+ # The RegionInstanceTemplates API.
33
+ #
34
+ # @example Load this service and instantiate a REST client
35
+ #
36
+ # require "google/cloud/compute/v1/region_instance_templates/rest"
37
+ # client = ::Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client.new
38
+ #
39
+ module RegionInstanceTemplates
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ helper_path = ::File.join __dir__, "region_instance_templates", "helpers.rb"
47
+ require "google/cloud/compute/v1/region_instance_templates/helpers" if ::File.file? helper_path
@@ -120,7 +120,7 @@ module Google
120
120
  credentials = @config.credentials
121
121
  # Use self-signed JWT if the endpoint is unchanged from default,
122
122
  # but only if the default endpoint does not have a region prefix.
123
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
123
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
124
124
  !@config.endpoint.split(".").first.include?("-")
125
125
  credentials ||= Credentials.default scope: @config.scope,
126
126
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -264,9 +264,9 @@ module Google
264
264
  # * (`String`) The path to a service account key file in JSON format
265
265
  # * (`Hash`) A service account key as a Hash
266
266
  # * (`Google::Auth::Credentials`) A googleauth credentials object
267
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
267
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
268
268
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
269
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
269
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
270
270
  # * (`nil`) indicating no credentials
271
271
  # @return [::Object]
272
272
  # @!attribute [rw] scope
@@ -299,7 +299,9 @@ module Google
299
299
  class Configuration
300
300
  extend ::Gapic::Config
301
301
 
302
- config_attr :endpoint, "compute.googleapis.com", ::String
302
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
303
+
304
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
303
305
  config_attr :credentials, nil do |value|
304
306
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
305
307
  allowed.any? { |klass| klass === value }
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_bulk_insert_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -132,7 +132,7 @@ module Google
132
132
  credentials = @config.credentials
133
133
  # Use self-signed JWT if the endpoint is unchanged from default,
134
134
  # but only if the default endpoint does not have a region prefix.
135
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
135
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
136
136
  !@config.endpoint.split(".").first.include?("-")
137
137
  credentials ||= Credentials.default scope: @config.scope,
138
138
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -239,7 +239,7 @@ module Google
239
239
  end
240
240
 
241
241
  ##
242
- # Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.
242
+ # Returns the specified network endpoint group.
243
243
  #
244
244
  # @overload get(request, options = nil)
245
245
  # Pass arguments to `get` via a request object, either of type
@@ -494,9 +494,9 @@ module Google
494
494
  # * (`String`) The path to a service account key file in JSON format
495
495
  # * (`Hash`) A service account key as a Hash
496
496
  # * (`Google::Auth::Credentials`) A googleauth credentials object
497
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
497
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
498
498
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
499
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
499
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
500
500
  # * (`nil`) indicating no credentials
501
501
  # @return [::Object]
502
502
  # @!attribute [rw] scope
@@ -529,7 +529,9 @@ module Google
529
529
  class Configuration
530
530
  extend ::Gapic::Config
531
531
 
532
- config_attr :endpoint, "compute.googleapis.com", ::String
532
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
533
+
534
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
533
535
  config_attr :credentials, nil do |value|
534
536
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
535
537
  allowed.any? { |klass| klass === value }
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -97,7 +97,7 @@ module Google
97
97
 
98
98
  verb, uri, query_string_params, body = ServiceStub.transcode_get_request request_pb
99
99
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
101
  else
102
102
  {}
103
103
  end
@@ -135,7 +135,7 @@ module Google
135
135
 
136
136
  verb, uri, query_string_params, body = ServiceStub.transcode_insert_request request_pb
137
137
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
139
  else
140
140
  {}
141
141
  end
@@ -173,7 +173,7 @@ module Google
173
173
 
174
174
  verb, uri, query_string_params, body = ServiceStub.transcode_list_request request_pb
175
175
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
177
  else
178
178
  {}
179
179
  end
@@ -170,7 +170,7 @@ module Google
170
170
  credentials = @config.credentials
171
171
  # Use self-signed JWT if the endpoint is unchanged from default,
172
172
  # but only if the default endpoint does not have a region prefix.
173
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
173
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
174
174
  !@config.endpoint.split(".").first.include?("-")
175
175
  credentials ||= Credentials.default scope: @config.scope,
176
176
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -1499,9 +1499,9 @@ module Google
1499
1499
  # * (`String`) The path to a service account key file in JSON format
1500
1500
  # * (`Hash`) A service account key as a Hash
1501
1501
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1502
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1502
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1503
1503
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1504
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1504
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1505
1505
  # * (`nil`) indicating no credentials
1506
1506
  # @return [::Object]
1507
1507
  # @!attribute [rw] scope
@@ -1534,7 +1534,9 @@ module Google
1534
1534
  class Configuration
1535
1535
  extend ::Gapic::Config
1536
1536
 
1537
- config_attr :endpoint, "compute.googleapis.com", ::String
1537
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
1538
+
1539
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1538
1540
  config_attr :credentials, nil do |value|
1539
1541
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1540
1542
  allowed.any? { |klass| klass === value }