google-cloud-compute-v1 2.6.0 → 2.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 +72 -101
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +33 -7
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +23 -2
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +34 -7
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +23 -2
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +34 -7
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +23 -2
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +34 -7
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +23 -2
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +34 -7
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +23 -2
  13. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +33 -7
  14. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +23 -2
  15. data/lib/google/cloud/compute/v1/disks/rest/client.rb +34 -7
  16. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +23 -2
  17. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +34 -7
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +23 -2
  19. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +34 -7
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +23 -2
  21. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +34 -7
  22. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +23 -2
  23. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +34 -7
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +23 -2
  25. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +23 -2
  27. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +34 -7
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +23 -2
  29. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +34 -7
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +23 -2
  31. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +33 -7
  32. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +23 -2
  33. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +33 -7
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +23 -2
  35. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +34 -7
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +23 -2
  37. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +34 -7
  38. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +23 -2
  39. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +33 -7
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +23 -2
  41. data/lib/google/cloud/compute/v1/images/rest/client.rb +34 -7
  42. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +23 -2
  43. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +34 -7
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +23 -2
  45. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +34 -7
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +23 -2
  47. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +23 -2
  49. data/lib/google/cloud/compute/v1/instances/rest/client.rb +34 -7
  50. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +23 -2
  51. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +34 -7
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +23 -2
  53. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +33 -7
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +23 -2
  55. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +33 -7
  56. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +23 -2
  57. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +34 -7
  58. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +23 -2
  59. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +33 -7
  60. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +23 -2
  61. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
  62. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +23 -2
  63. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +34 -7
  64. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +23 -2
  65. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +33 -7
  66. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +23 -2
  67. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +34 -7
  68. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +23 -2
  69. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +34 -7
  70. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +23 -2
  71. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +34 -7
  72. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +23 -2
  73. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +34 -7
  74. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +23 -2
  75. data/lib/google/cloud/compute/v1/networks/rest/client.rb +34 -7
  76. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +23 -2
  77. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +34 -7
  78. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +23 -2
  79. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +34 -7
  80. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +23 -2
  81. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +33 -7
  82. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +23 -2
  83. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +34 -7
  84. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +23 -2
  85. data/lib/google/cloud/compute/v1/projects/rest/client.rb +34 -7
  86. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +23 -2
  87. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +34 -7
  88. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +23 -2
  89. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +34 -7
  90. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +23 -2
  91. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +34 -7
  92. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +23 -2
  93. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +34 -7
  94. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +23 -2
  95. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +34 -7
  96. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +23 -2
  97. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +33 -7
  98. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +23 -2
  99. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +34 -7
  100. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +23 -2
  101. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +34 -7
  102. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +23 -2
  103. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +34 -7
  104. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +23 -2
  105. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +34 -7
  106. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +23 -2
  107. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +34 -7
  108. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +23 -2
  109. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +34 -7
  110. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +23 -2
  111. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +34 -7
  112. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +23 -2
  113. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +34 -7
  114. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +23 -2
  115. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +34 -7
  116. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +23 -2
  117. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +34 -7
  118. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +23 -2
  119. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +33 -7
  120. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +23 -2
  121. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +34 -7
  122. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +23 -2
  123. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +34 -7
  124. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +23 -2
  125. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +34 -7
  126. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +23 -2
  127. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +34 -7
  128. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +23 -2
  129. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +34 -7
  130. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +23 -2
  131. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +34 -7
  132. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +23 -2
  133. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +34 -7
  134. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +23 -2
  135. data/lib/google/cloud/compute/v1/regions/rest/client.rb +33 -7
  136. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +23 -2
  137. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +34 -7
  138. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +23 -2
  139. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +34 -7
  140. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +23 -2
  141. data/lib/google/cloud/compute/v1/routers/rest/client.rb +34 -7
  142. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +23 -2
  143. data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
  144. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +23 -2
  145. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +34 -7
  146. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +23 -2
  147. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +34 -7
  148. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +23 -2
  149. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +34 -7
  150. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +23 -2
  151. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +34 -7
  152. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +23 -2
  153. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +34 -7
  154. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +23 -2
  155. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +34 -7
  156. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +23 -2
  157. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +34 -7
  158. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +23 -2
  159. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +34 -7
  160. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +23 -2
  161. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +34 -7
  162. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +23 -2
  163. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +34 -7
  164. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +23 -2
  165. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +34 -7
  166. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +23 -2
  167. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +34 -7
  168. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +23 -2
  169. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +34 -7
  170. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +23 -2
  171. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +34 -7
  172. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +23 -2
  173. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +34 -7
  174. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +23 -2
  175. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +34 -7
  176. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +23 -2
  177. data/lib/google/cloud/compute/v1/version.rb +1 -1
  178. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +34 -7
  179. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +23 -2
  180. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +34 -7
  181. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +23 -2
  182. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +33 -7
  183. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +23 -2
  184. data/lib/google/cloud/compute/v1/zones/rest/client.rb +33 -7
  185. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +23 -2
  186. data/proto_docs/google/api/client.rb +1 -0
  187. metadata +5 -5
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
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,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the delete REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The FirewallPolicies API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :firewall_policies_stub
38
41
 
@@ -145,6 +148,15 @@ module Google
145
148
  @config
146
149
  end
147
150
 
151
+ ##
152
+ # The effective universe domain
153
+ #
154
+ # @return [String]
155
+ #
156
+ def universe_domain
157
+ @firewall_policies_stub.universe_domain
158
+ end
159
+
148
160
  ##
149
161
  # Create a new FirewallPolicies REST client object.
150
162
  #
@@ -172,8 +184,9 @@ module Google
172
184
  credentials = @config.credentials
173
185
  # Use self-signed JWT if the endpoint is unchanged from default,
174
186
  # but only if the default endpoint does not have a region prefix.
175
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
176
- !@config.endpoint.split(".").first.include?("-")
187
+ enable_self_signed_jwt = @config.endpoint.nil? ||
188
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
189
+ !@config.endpoint.split(".").first.include?("-"))
177
190
  credentials ||= Credentials.default scope: @config.scope,
178
191
  enable_self_signed_jwt: enable_self_signed_jwt
179
192
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -187,9 +200,15 @@ module Google
187
200
  config.credentials = credentials
188
201
  config.quota_project = @quota_project_id
189
202
  config.endpoint = @config.endpoint
203
+ config.universe_domain = @config.universe_domain
190
204
  end
191
205
 
192
- @firewall_policies_stub = ::Google::Cloud::Compute::V1::FirewallPolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
206
+ @firewall_policies_stub = ::Google::Cloud::Compute::V1::FirewallPolicies::Rest::ServiceStub.new(
207
+ endpoint: @config.endpoint,
208
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
209
+ universe_domain: @config.universe_domain,
210
+ credentials: credentials
211
+ )
193
212
  end
194
213
 
195
214
  ##
@@ -1762,9 +1781,9 @@ module Google
1762
1781
  # end
1763
1782
  #
1764
1783
  # @!attribute [rw] endpoint
1765
- # The hostname or hostname:port of the service endpoint.
1766
- # Defaults to `"compute.googleapis.com"`.
1767
- # @return [::String]
1784
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1785
+ # nil, indicating to use the default endpoint in the current universe domain.
1786
+ # @return [::String,nil]
1768
1787
  # @!attribute [rw] credentials
1769
1788
  # Credentials to send with calls. You may provide any of the following types:
1770
1789
  # * (`String`) The path to a service account key file in JSON format
@@ -1801,13 +1820,20 @@ module Google
1801
1820
  # @!attribute [rw] quota_project
1802
1821
  # A separate project against which to charge quota.
1803
1822
  # @return [::String]
1823
+ # @!attribute [rw] universe_domain
1824
+ # The universe domain within which to make requests. This determines the
1825
+ # default endpoint URL. The default value of nil uses the environment
1826
+ # universe (usually the default "googleapis.com" universe).
1827
+ # @return [::String,nil]
1804
1828
  #
1805
1829
  class Configuration
1806
1830
  extend ::Gapic::Config
1807
1831
 
1832
+ # @private
1833
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1808
1834
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1809
1835
 
1810
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1836
+ config_attr :endpoint, nil, ::String, nil
1811
1837
  config_attr :credentials, nil do |value|
1812
1838
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1813
1839
  allowed.any? { |klass| klass === value }
@@ -1819,6 +1845,7 @@ module Google
1819
1845
  config_attr :metadata, nil, ::Hash, nil
1820
1846
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1821
1847
  config_attr :quota_project, nil, ::String, nil
1848
+ config_attr :universe_domain, nil, ::String, nil
1822
1849
 
1823
1850
  # @private
1824
1851
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
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,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the add_association REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The Firewalls API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :firewalls_stub
38
41
 
@@ -109,6 +112,15 @@ module Google
109
112
  @config
110
113
  end
111
114
 
115
+ ##
116
+ # The effective universe domain
117
+ #
118
+ # @return [String]
119
+ #
120
+ def universe_domain
121
+ @firewalls_stub.universe_domain
122
+ end
123
+
112
124
  ##
113
125
  # Create a new Firewalls REST client object.
114
126
  #
@@ -136,8 +148,9 @@ module Google
136
148
  credentials = @config.credentials
137
149
  # Use self-signed JWT if the endpoint is unchanged from default,
138
150
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
- !@config.endpoint.split(".").first.include?("-")
151
+ enable_self_signed_jwt = @config.endpoint.nil? ||
152
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
+ !@config.endpoint.split(".").first.include?("-"))
141
154
  credentials ||= Credentials.default scope: @config.scope,
142
155
  enable_self_signed_jwt: enable_self_signed_jwt
143
156
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -151,9 +164,15 @@ module Google
151
164
  config.credentials = credentials
152
165
  config.quota_project = @quota_project_id
153
166
  config.endpoint = @config.endpoint
167
+ config.universe_domain = @config.universe_domain
154
168
  end
155
169
 
156
- @firewalls_stub = ::Google::Cloud::Compute::V1::Firewalls::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
170
+ @firewalls_stub = ::Google::Cloud::Compute::V1::Firewalls::Rest::ServiceStub.new(
171
+ endpoint: @config.endpoint,
172
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
173
+ universe_domain: @config.universe_domain,
174
+ credentials: credentials
175
+ )
157
176
  end
158
177
 
159
178
  ##
@@ -728,9 +747,9 @@ module Google
728
747
  # end
729
748
  #
730
749
  # @!attribute [rw] endpoint
731
- # The hostname or hostname:port of the service endpoint.
732
- # Defaults to `"compute.googleapis.com"`.
733
- # @return [::String]
750
+ # A custom service endpoint, as a hostname or hostname:port. The default is
751
+ # nil, indicating to use the default endpoint in the current universe domain.
752
+ # @return [::String,nil]
734
753
  # @!attribute [rw] credentials
735
754
  # Credentials to send with calls. You may provide any of the following types:
736
755
  # * (`String`) The path to a service account key file in JSON format
@@ -767,13 +786,20 @@ module Google
767
786
  # @!attribute [rw] quota_project
768
787
  # A separate project against which to charge quota.
769
788
  # @return [::String]
789
+ # @!attribute [rw] universe_domain
790
+ # The universe domain within which to make requests. This determines the
791
+ # default endpoint URL. The default value of nil uses the environment
792
+ # universe (usually the default "googleapis.com" universe).
793
+ # @return [::String,nil]
770
794
  #
771
795
  class Configuration
772
796
  extend ::Gapic::Config
773
797
 
798
+ # @private
799
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
774
800
  DEFAULT_ENDPOINT = "compute.googleapis.com"
775
801
 
776
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
802
+ config_attr :endpoint, nil, ::String, nil
777
803
  config_attr :credentials, nil do |value|
778
804
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
779
805
  allowed.any? { |klass| klass === value }
@@ -785,6 +811,7 @@ module Google
785
811
  config_attr :metadata, nil, ::Hash, nil
786
812
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
787
813
  config_attr :quota_project, nil, ::String, nil
814
+ config_attr :universe_domain, nil, ::String, nil
788
815
 
789
816
  # @private
790
817
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
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,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the delete REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The ForwardingRules API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :forwarding_rules_stub
38
41
 
@@ -116,6 +119,15 @@ module Google
116
119
  @config
117
120
  end
118
121
 
122
+ ##
123
+ # The effective universe domain
124
+ #
125
+ # @return [String]
126
+ #
127
+ def universe_domain
128
+ @forwarding_rules_stub.universe_domain
129
+ end
130
+
119
131
  ##
120
132
  # Create a new ForwardingRules REST client object.
121
133
  #
@@ -143,8 +155,9 @@ module Google
143
155
  credentials = @config.credentials
144
156
  # Use self-signed JWT if the endpoint is unchanged from default,
145
157
  # but only if the default endpoint does not have a region prefix.
146
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
- !@config.endpoint.split(".").first.include?("-")
158
+ enable_self_signed_jwt = @config.endpoint.nil? ||
159
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
160
+ !@config.endpoint.split(".").first.include?("-"))
148
161
  credentials ||= Credentials.default scope: @config.scope,
149
162
  enable_self_signed_jwt: enable_self_signed_jwt
150
163
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -158,9 +171,15 @@ module Google
158
171
  config.credentials = credentials
159
172
  config.quota_project = @quota_project_id
160
173
  config.endpoint = @config.endpoint
174
+ config.universe_domain = @config.universe_domain
161
175
  end
162
176
 
163
- @forwarding_rules_stub = ::Google::Cloud::Compute::V1::ForwardingRules::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
177
+ @forwarding_rules_stub = ::Google::Cloud::Compute::V1::ForwardingRules::Rest::ServiceStub.new(
178
+ endpoint: @config.endpoint,
179
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
180
+ universe_domain: @config.universe_domain,
181
+ credentials: credentials
182
+ )
164
183
  end
165
184
 
166
185
  ##
@@ -938,9 +957,9 @@ module Google
938
957
  # end
939
958
  #
940
959
  # @!attribute [rw] endpoint
941
- # The hostname or hostname:port of the service endpoint.
942
- # Defaults to `"compute.googleapis.com"`.
943
- # @return [::String]
960
+ # A custom service endpoint, as a hostname or hostname:port. The default is
961
+ # nil, indicating to use the default endpoint in the current universe domain.
962
+ # @return [::String,nil]
944
963
  # @!attribute [rw] credentials
945
964
  # Credentials to send with calls. You may provide any of the following types:
946
965
  # * (`String`) The path to a service account key file in JSON format
@@ -977,13 +996,20 @@ module Google
977
996
  # @!attribute [rw] quota_project
978
997
  # A separate project against which to charge quota.
979
998
  # @return [::String]
999
+ # @!attribute [rw] universe_domain
1000
+ # The universe domain within which to make requests. This determines the
1001
+ # default endpoint URL. The default value of nil uses the environment
1002
+ # universe (usually the default "googleapis.com" universe).
1003
+ # @return [::String,nil]
980
1004
  #
981
1005
  class Configuration
982
1006
  extend ::Gapic::Config
983
1007
 
1008
+ # @private
1009
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
984
1010
  DEFAULT_ENDPOINT = "compute.googleapis.com"
985
1011
 
986
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1012
+ config_attr :endpoint, nil, ::String, nil
987
1013
  config_attr :credentials, nil do |value|
988
1014
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
989
1015
  allowed.any? { |klass| klass === value }
@@ -995,6 +1021,7 @@ module Google
995
1021
  config_attr :metadata, nil, ::Hash, nil
996
1022
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
997
1023
  config_attr :quota_project, nil, ::String, nil
1024
+ config_attr :universe_domain, nil, ::String, nil
998
1025
 
999
1026
  # @private
1000
1027
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
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,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the aggregated_list REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The GlobalAddresses API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :global_addresses_stub
38
41
 
@@ -109,6 +112,15 @@ module Google
109
112
  @config
110
113
  end
111
114
 
115
+ ##
116
+ # The effective universe domain
117
+ #
118
+ # @return [String]
119
+ #
120
+ def universe_domain
121
+ @global_addresses_stub.universe_domain
122
+ end
123
+
112
124
  ##
113
125
  # Create a new GlobalAddresses REST client object.
114
126
  #
@@ -136,8 +148,9 @@ module Google
136
148
  credentials = @config.credentials
137
149
  # Use self-signed JWT if the endpoint is unchanged from default,
138
150
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
- !@config.endpoint.split(".").first.include?("-")
151
+ enable_self_signed_jwt = @config.endpoint.nil? ||
152
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
+ !@config.endpoint.split(".").first.include?("-"))
141
154
  credentials ||= Credentials.default scope: @config.scope,
142
155
  enable_self_signed_jwt: enable_self_signed_jwt
143
156
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -151,9 +164,15 @@ module Google
151
164
  config.credentials = credentials
152
165
  config.quota_project = @quota_project_id
153
166
  config.endpoint = @config.endpoint
167
+ config.universe_domain = @config.universe_domain
154
168
  end
155
169
 
156
- @global_addresses_stub = ::Google::Cloud::Compute::V1::GlobalAddresses::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
170
+ @global_addresses_stub = ::Google::Cloud::Compute::V1::GlobalAddresses::Rest::ServiceStub.new(
171
+ endpoint: @config.endpoint,
172
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
173
+ universe_domain: @config.universe_domain,
174
+ credentials: credentials
175
+ )
157
176
  end
158
177
 
159
178
  ##
@@ -726,9 +745,9 @@ module Google
726
745
  # end
727
746
  #
728
747
  # @!attribute [rw] endpoint
729
- # The hostname or hostname:port of the service endpoint.
730
- # Defaults to `"compute.googleapis.com"`.
731
- # @return [::String]
748
+ # A custom service endpoint, as a hostname or hostname:port. The default is
749
+ # nil, indicating to use the default endpoint in the current universe domain.
750
+ # @return [::String,nil]
732
751
  # @!attribute [rw] credentials
733
752
  # Credentials to send with calls. You may provide any of the following types:
734
753
  # * (`String`) The path to a service account key file in JSON format
@@ -765,13 +784,20 @@ module Google
765
784
  # @!attribute [rw] quota_project
766
785
  # A separate project against which to charge quota.
767
786
  # @return [::String]
787
+ # @!attribute [rw] universe_domain
788
+ # The universe domain within which to make requests. This determines the
789
+ # default endpoint URL. The default value of nil uses the environment
790
+ # universe (usually the default "googleapis.com" universe).
791
+ # @return [::String,nil]
768
792
  #
769
793
  class Configuration
770
794
  extend ::Gapic::Config
771
795
 
796
+ # @private
797
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
772
798
  DEFAULT_ENDPOINT = "compute.googleapis.com"
773
799
 
774
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
800
+ config_attr :endpoint, nil, ::String, nil
775
801
  config_attr :credentials, nil do |value|
776
802
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
777
803
  allowed.any? { |klass| klass === value }
@@ -783,6 +809,7 @@ module Google
783
809
  config_attr :metadata, nil, ::Hash, nil
784
810
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
785
811
  config_attr :quota_project, nil, ::String, nil
812
+ config_attr :universe_domain, nil, ::String, nil
786
813
 
787
814
  # @private
788
815
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
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,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the delete REST call
45
66
  #