google-cloud-compute-v1 2.6.0 → 2.7.0

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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -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 +14 -2
  186. data/proto_docs/google/api/client.rb +1 -0
  187. metadata +5 -5
@@ -33,6 +33,9 @@ module Google
33
33
  # The PublicDelegatedPrefixes API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :public_delegated_prefixes_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
+ @public_delegated_prefixes_stub.universe_domain
129
+ end
130
+
119
131
  ##
120
132
  # Create a new PublicDelegatedPrefixes 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
- @public_delegated_prefixes_stub = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
177
+ @public_delegated_prefixes_stub = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::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
  ##
@@ -934,9 +953,9 @@ module Google
934
953
  # end
935
954
  #
936
955
  # @!attribute [rw] endpoint
937
- # The hostname or hostname:port of the service endpoint.
938
- # Defaults to `"compute.googleapis.com"`.
939
- # @return [::String]
956
+ # A custom service endpoint, as a hostname or hostname:port. The default is
957
+ # nil, indicating to use the default endpoint in the current universe domain.
958
+ # @return [::String,nil]
940
959
  # @!attribute [rw] credentials
941
960
  # Credentials to send with calls. You may provide any of the following types:
942
961
  # * (`String`) The path to a service account key file in JSON format
@@ -973,13 +992,20 @@ module Google
973
992
  # @!attribute [rw] quota_project
974
993
  # A separate project against which to charge quota.
975
994
  # @return [::String]
995
+ # @!attribute [rw] universe_domain
996
+ # The universe domain within which to make requests. This determines the
997
+ # default endpoint URL. The default value of nil uses the environment
998
+ # universe (usually the default "googleapis.com" universe).
999
+ # @return [::String,nil]
976
1000
  #
977
1001
  class Configuration
978
1002
  extend ::Gapic::Config
979
1003
 
1004
+ # @private
1005
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
980
1006
  DEFAULT_ENDPOINT = "compute.googleapis.com"
981
1007
 
982
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1008
+ config_attr :endpoint, nil, ::String, nil
983
1009
  config_attr :credentials, nil do |value|
984
1010
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
985
1011
  allowed.any? { |klass| klass === value }
@@ -991,6 +1017,7 @@ module Google
991
1017
  config_attr :metadata, nil, ::Hash, nil
992
1018
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
993
1019
  config_attr :quota_project, nil, ::String, nil
1020
+ config_attr :universe_domain, nil, ::String, nil
994
1021
 
995
1022
  # @private
996
1023
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the aggregated_list REST call
45
57
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The RegionAutoscalers API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_autoscalers_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
+ @region_autoscalers_stub.universe_domain
122
+ end
123
+
112
124
  ##
113
125
  # Create a new RegionAutoscalers 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
- @region_autoscalers_stub = ::Google::Cloud::Compute::V1::RegionAutoscalers::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
170
+ @region_autoscalers_stub = ::Google::Cloud::Compute::V1::RegionAutoscalers::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
  ##
@@ -744,9 +763,9 @@ module Google
744
763
  # end
745
764
  #
746
765
  # @!attribute [rw] endpoint
747
- # The hostname or hostname:port of the service endpoint.
748
- # Defaults to `"compute.googleapis.com"`.
749
- # @return [::String]
766
+ # A custom service endpoint, as a hostname or hostname:port. The default is
767
+ # nil, indicating to use the default endpoint in the current universe domain.
768
+ # @return [::String,nil]
750
769
  # @!attribute [rw] credentials
751
770
  # Credentials to send with calls. You may provide any of the following types:
752
771
  # * (`String`) The path to a service account key file in JSON format
@@ -783,13 +802,20 @@ module Google
783
802
  # @!attribute [rw] quota_project
784
803
  # A separate project against which to charge quota.
785
804
  # @return [::String]
805
+ # @!attribute [rw] universe_domain
806
+ # The universe domain within which to make requests. This determines the
807
+ # default endpoint URL. The default value of nil uses the environment
808
+ # universe (usually the default "googleapis.com" universe).
809
+ # @return [::String,nil]
786
810
  #
787
811
  class Configuration
788
812
  extend ::Gapic::Config
789
813
 
814
+ # @private
815
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
790
816
  DEFAULT_ENDPOINT = "compute.googleapis.com"
791
817
 
792
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
818
+ config_attr :endpoint, nil, ::String, nil
793
819
  config_attr :credentials, nil do |value|
794
820
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
795
821
  allowed.any? { |klass| klass === value }
@@ -801,6 +827,7 @@ module Google
801
827
  config_attr :metadata, nil, ::Hash, nil
802
828
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
803
829
  config_attr :quota_project, nil, ::String, nil
830
+ config_attr :universe_domain, nil, ::String, nil
804
831
 
805
832
  # @private
806
833
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the delete REST call
45
57
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The RegionBackendServices API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_backend_services_stub
38
41
 
@@ -127,6 +130,15 @@ module Google
127
130
  @config
128
131
  end
129
132
 
133
+ ##
134
+ # The effective universe domain
135
+ #
136
+ # @return [String]
137
+ #
138
+ def universe_domain
139
+ @region_backend_services_stub.universe_domain
140
+ end
141
+
130
142
  ##
131
143
  # Create a new RegionBackendServices REST client object.
132
144
  #
@@ -154,8 +166,9 @@ module Google
154
166
  credentials = @config.credentials
155
167
  # Use self-signed JWT if the endpoint is unchanged from default,
156
168
  # but only if the default endpoint does not have a region prefix.
157
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
158
- !@config.endpoint.split(".").first.include?("-")
169
+ enable_self_signed_jwt = @config.endpoint.nil? ||
170
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
171
+ !@config.endpoint.split(".").first.include?("-"))
159
172
  credentials ||= Credentials.default scope: @config.scope,
160
173
  enable_self_signed_jwt: enable_self_signed_jwt
161
174
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -169,9 +182,15 @@ module Google
169
182
  config.credentials = credentials
170
183
  config.quota_project = @quota_project_id
171
184
  config.endpoint = @config.endpoint
185
+ config.universe_domain = @config.universe_domain
172
186
  end
173
187
 
174
- @region_backend_services_stub = ::Google::Cloud::Compute::V1::RegionBackendServices::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
188
+ @region_backend_services_stub = ::Google::Cloud::Compute::V1::RegionBackendServices::Rest::ServiceStub.new(
189
+ endpoint: @config.endpoint,
190
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
191
+ universe_domain: @config.universe_domain,
192
+ credentials: credentials
193
+ )
175
194
  end
176
195
 
177
196
  ##
@@ -1283,9 +1302,9 @@ module Google
1283
1302
  # end
1284
1303
  #
1285
1304
  # @!attribute [rw] endpoint
1286
- # The hostname or hostname:port of the service endpoint.
1287
- # Defaults to `"compute.googleapis.com"`.
1288
- # @return [::String]
1305
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1306
+ # nil, indicating to use the default endpoint in the current universe domain.
1307
+ # @return [::String,nil]
1289
1308
  # @!attribute [rw] credentials
1290
1309
  # Credentials to send with calls. You may provide any of the following types:
1291
1310
  # * (`String`) The path to a service account key file in JSON format
@@ -1322,13 +1341,20 @@ module Google
1322
1341
  # @!attribute [rw] quota_project
1323
1342
  # A separate project against which to charge quota.
1324
1343
  # @return [::String]
1344
+ # @!attribute [rw] universe_domain
1345
+ # The universe domain within which to make requests. This determines the
1346
+ # default endpoint URL. The default value of nil uses the environment
1347
+ # universe (usually the default "googleapis.com" universe).
1348
+ # @return [::String,nil]
1325
1349
  #
1326
1350
  class Configuration
1327
1351
  extend ::Gapic::Config
1328
1352
 
1353
+ # @private
1354
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1329
1355
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1330
1356
 
1331
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1357
+ config_attr :endpoint, nil, ::String, nil
1332
1358
  config_attr :credentials, nil do |value|
1333
1359
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1334
1360
  allowed.any? { |klass| klass === value }
@@ -1340,6 +1366,7 @@ module Google
1340
1366
  config_attr :metadata, nil, ::Hash, nil
1341
1367
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1342
1368
  config_attr :quota_project, nil, ::String, nil
1369
+ config_attr :universe_domain, nil, ::String, nil
1343
1370
 
1344
1371
  # @private
1345
1372
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the delete REST call
45
57
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The RegionCommitments API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_commitments_stub
38
41
 
@@ -110,6 +113,15 @@ module Google
110
113
  @config
111
114
  end
112
115
 
116
+ ##
117
+ # The effective universe domain
118
+ #
119
+ # @return [String]
120
+ #
121
+ def universe_domain
122
+ @region_commitments_stub.universe_domain
123
+ end
124
+
113
125
  ##
114
126
  # Create a new RegionCommitments REST client object.
115
127
  #
@@ -137,8 +149,9 @@ module Google
137
149
  credentials = @config.credentials
138
150
  # Use self-signed JWT if the endpoint is unchanged from default,
139
151
  # but only if the default endpoint does not have a region prefix.
140
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
- !@config.endpoint.split(".").first.include?("-")
152
+ enable_self_signed_jwt = @config.endpoint.nil? ||
153
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
154
+ !@config.endpoint.split(".").first.include?("-"))
142
155
  credentials ||= Credentials.default scope: @config.scope,
143
156
  enable_self_signed_jwt: enable_self_signed_jwt
144
157
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -152,9 +165,15 @@ module Google
152
165
  config.credentials = credentials
153
166
  config.quota_project = @quota_project_id
154
167
  config.endpoint = @config.endpoint
168
+ config.universe_domain = @config.universe_domain
155
169
  end
156
170
 
157
- @region_commitments_stub = ::Google::Cloud::Compute::V1::RegionCommitments::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
171
+ @region_commitments_stub = ::Google::Cloud::Compute::V1::RegionCommitments::Rest::ServiceStub.new(
172
+ endpoint: @config.endpoint,
173
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
174
+ universe_domain: @config.universe_domain,
175
+ credentials: credentials
176
+ )
158
177
  end
159
178
 
160
179
  ##
@@ -652,9 +671,9 @@ module Google
652
671
  # end
653
672
  #
654
673
  # @!attribute [rw] endpoint
655
- # The hostname or hostname:port of the service endpoint.
656
- # Defaults to `"compute.googleapis.com"`.
657
- # @return [::String]
674
+ # A custom service endpoint, as a hostname or hostname:port. The default is
675
+ # nil, indicating to use the default endpoint in the current universe domain.
676
+ # @return [::String,nil]
658
677
  # @!attribute [rw] credentials
659
678
  # Credentials to send with calls. You may provide any of the following types:
660
679
  # * (`String`) The path to a service account key file in JSON format
@@ -691,13 +710,20 @@ module Google
691
710
  # @!attribute [rw] quota_project
692
711
  # A separate project against which to charge quota.
693
712
  # @return [::String]
713
+ # @!attribute [rw] universe_domain
714
+ # The universe domain within which to make requests. This determines the
715
+ # default endpoint URL. The default value of nil uses the environment
716
+ # universe (usually the default "googleapis.com" universe).
717
+ # @return [::String,nil]
694
718
  #
695
719
  class Configuration
696
720
  extend ::Gapic::Config
697
721
 
722
+ # @private
723
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
698
724
  DEFAULT_ENDPOINT = "compute.googleapis.com"
699
725
 
700
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
726
+ config_attr :endpoint, nil, ::String, nil
701
727
  config_attr :credentials, nil do |value|
702
728
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
703
729
  allowed.any? { |klass| klass === value }
@@ -709,6 +735,7 @@ module Google
709
735
  config_attr :metadata, nil, ::Hash, nil
710
736
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
711
737
  config_attr :quota_project, nil, ::String, nil
738
+ config_attr :universe_domain, nil, ::String, nil
712
739
 
713
740
  # @private
714
741
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the aggregated_list REST call
45
57
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # The RegionDiskTypes API.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :region_disk_types_stub
37
40
 
@@ -100,6 +103,15 @@ module Google
100
103
  @config
101
104
  end
102
105
 
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @region_disk_types_stub.universe_domain
113
+ end
114
+
103
115
  ##
104
116
  # Create a new RegionDiskTypes REST client object.
105
117
  #
@@ -127,8 +139,9 @@ module Google
127
139
  credentials = @config.credentials
128
140
  # Use self-signed JWT if the endpoint is unchanged from default,
129
141
  # but only if the default endpoint does not have a region prefix.
130
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
131
- !@config.endpoint.split(".").first.include?("-")
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
132
145
  credentials ||= Credentials.default scope: @config.scope,
133
146
  enable_self_signed_jwt: enable_self_signed_jwt
134
147
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -138,7 +151,12 @@ module Google
138
151
  @quota_project_id = @config.quota_project
139
152
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
140
153
 
141
- @region_disk_types_stub = ::Google::Cloud::Compute::V1::RegionDiskTypes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
154
+ @region_disk_types_stub = ::Google::Cloud::Compute::V1::RegionDiskTypes::Rest::ServiceStub.new(
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ credentials: credentials
159
+ )
142
160
  end
143
161
 
144
162
  # Service calls
@@ -346,9 +364,9 @@ module Google
346
364
  # end
347
365
  #
348
366
  # @!attribute [rw] endpoint
349
- # The hostname or hostname:port of the service endpoint.
350
- # Defaults to `"compute.googleapis.com"`.
351
- # @return [::String]
367
+ # A custom service endpoint, as a hostname or hostname:port. The default is
368
+ # nil, indicating to use the default endpoint in the current universe domain.
369
+ # @return [::String,nil]
352
370
  # @!attribute [rw] credentials
353
371
  # Credentials to send with calls. You may provide any of the following types:
354
372
  # * (`String`) The path to a service account key file in JSON format
@@ -385,13 +403,20 @@ module Google
385
403
  # @!attribute [rw] quota_project
386
404
  # A separate project against which to charge quota.
387
405
  # @return [::String]
406
+ # @!attribute [rw] universe_domain
407
+ # The universe domain within which to make requests. This determines the
408
+ # default endpoint URL. The default value of nil uses the environment
409
+ # universe (usually the default "googleapis.com" universe).
410
+ # @return [::String,nil]
388
411
  #
389
412
  class Configuration
390
413
  extend ::Gapic::Config
391
414
 
415
+ # @private
416
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
392
417
  DEFAULT_ENDPOINT = "compute.googleapis.com"
393
418
 
394
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
419
+ config_attr :endpoint, nil, ::String, nil
395
420
  config_attr :credentials, nil do |value|
396
421
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
397
422
  allowed.any? { |klass| klass === value }
@@ -403,6 +428,7 @@ module Google
403
428
  config_attr :metadata, nil, ::Hash, nil
404
429
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
405
430
  config_attr :quota_project, nil, ::String, nil
431
+ config_attr :universe_domain, nil, ::String, nil
406
432
 
407
433
  # @private
408
434
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the get REST call
45
57
  #