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
@@ -33,6 +33,9 @@ module Google
33
33
  # The GlobalForwardingRules 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_forwarding_rules_stub
38
41
 
@@ -111,6 +114,15 @@ module Google
111
114
  @config
112
115
  end
113
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @global_forwarding_rules_stub.universe_domain
124
+ end
125
+
114
126
  ##
115
127
  # Create a new GlobalForwardingRules REST client object.
116
128
  #
@@ -138,8 +150,9 @@ module Google
138
150
  credentials = @config.credentials
139
151
  # Use self-signed JWT if the endpoint is unchanged from default,
140
152
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
- !@config.endpoint.split(".").first.include?("-")
153
+ enable_self_signed_jwt = @config.endpoint.nil? ||
154
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-"))
143
156
  credentials ||= Credentials.default scope: @config.scope,
144
157
  enable_self_signed_jwt: enable_self_signed_jwt
145
158
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -153,9 +166,15 @@ module Google
153
166
  config.credentials = credentials
154
167
  config.quota_project = @quota_project_id
155
168
  config.endpoint = @config.endpoint
169
+ config.universe_domain = @config.universe_domain
156
170
  end
157
171
 
158
- @global_forwarding_rules_stub = ::Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
172
+ @global_forwarding_rules_stub = ::Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::ServiceStub.new(
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
176
+ credentials: credentials
177
+ )
159
178
  end
160
179
 
161
180
  ##
@@ -820,9 +839,9 @@ module Google
820
839
  # end
821
840
  #
822
841
  # @!attribute [rw] endpoint
823
- # The hostname or hostname:port of the service endpoint.
824
- # Defaults to `"compute.googleapis.com"`.
825
- # @return [::String]
842
+ # A custom service endpoint, as a hostname or hostname:port. The default is
843
+ # nil, indicating to use the default endpoint in the current universe domain.
844
+ # @return [::String,nil]
826
845
  # @!attribute [rw] credentials
827
846
  # Credentials to send with calls. You may provide any of the following types:
828
847
  # * (`String`) The path to a service account key file in JSON format
@@ -859,13 +878,20 @@ module Google
859
878
  # @!attribute [rw] quota_project
860
879
  # A separate project against which to charge quota.
861
880
  # @return [::String]
881
+ # @!attribute [rw] universe_domain
882
+ # The universe domain within which to make requests. This determines the
883
+ # default endpoint URL. The default value of nil uses the environment
884
+ # universe (usually the default "googleapis.com" universe).
885
+ # @return [::String,nil]
862
886
  #
863
887
  class Configuration
864
888
  extend ::Gapic::Config
865
889
 
890
+ # @private
891
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
866
892
  DEFAULT_ENDPOINT = "compute.googleapis.com"
867
893
 
868
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
894
+ config_attr :endpoint, nil, ::String, nil
869
895
  config_attr :credentials, nil do |value|
870
896
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
871
897
  allowed.any? { |klass| klass === value }
@@ -877,6 +903,7 @@ module Google
877
903
  config_attr :metadata, nil, ::Hash, nil
878
904
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
879
905
  config_attr :quota_project, nil, ::String, nil
906
+ config_attr :universe_domain, nil, ::String, nil
880
907
 
881
908
  # @private
882
909
  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 GlobalNetworkEndpointGroups 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_network_endpoint_groups_stub
38
41
 
@@ -111,6 +114,15 @@ module Google
111
114
  @config
112
115
  end
113
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @global_network_endpoint_groups_stub.universe_domain
124
+ end
125
+
114
126
  ##
115
127
  # Create a new GlobalNetworkEndpointGroups REST client object.
116
128
  #
@@ -138,8 +150,9 @@ module Google
138
150
  credentials = @config.credentials
139
151
  # Use self-signed JWT if the endpoint is unchanged from default,
140
152
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
- !@config.endpoint.split(".").first.include?("-")
153
+ enable_self_signed_jwt = @config.endpoint.nil? ||
154
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-"))
143
156
  credentials ||= Credentials.default scope: @config.scope,
144
157
  enable_self_signed_jwt: enable_self_signed_jwt
145
158
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -153,9 +166,15 @@ module Google
153
166
  config.credentials = credentials
154
167
  config.quota_project = @quota_project_id
155
168
  config.endpoint = @config.endpoint
169
+ config.universe_domain = @config.universe_domain
156
170
  end
157
171
 
158
- @global_network_endpoint_groups_stub = ::Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
172
+ @global_network_endpoint_groups_stub = ::Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::ServiceStub.new(
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
176
+ credentials: credentials
177
+ )
159
178
  end
160
179
 
161
180
  ##
@@ -821,9 +840,9 @@ module Google
821
840
  # end
822
841
  #
823
842
  # @!attribute [rw] endpoint
824
- # The hostname or hostname:port of the service endpoint.
825
- # Defaults to `"compute.googleapis.com"`.
826
- # @return [::String]
843
+ # A custom service endpoint, as a hostname or hostname:port. The default is
844
+ # nil, indicating to use the default endpoint in the current universe domain.
845
+ # @return [::String,nil]
827
846
  # @!attribute [rw] credentials
828
847
  # Credentials to send with calls. You may provide any of the following types:
829
848
  # * (`String`) The path to a service account key file in JSON format
@@ -860,13 +879,20 @@ module Google
860
879
  # @!attribute [rw] quota_project
861
880
  # A separate project against which to charge quota.
862
881
  # @return [::String]
882
+ # @!attribute [rw] universe_domain
883
+ # The universe domain within which to make requests. This determines the
884
+ # default endpoint URL. The default value of nil uses the environment
885
+ # universe (usually the default "googleapis.com" universe).
886
+ # @return [::String,nil]
863
887
  #
864
888
  class Configuration
865
889
  extend ::Gapic::Config
866
890
 
891
+ # @private
892
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
867
893
  DEFAULT_ENDPOINT = "compute.googleapis.com"
868
894
 
869
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
895
+ config_attr :endpoint, nil, ::String, nil
870
896
  config_attr :credentials, nil do |value|
871
897
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
872
898
  allowed.any? { |klass| klass === value }
@@ -878,6 +904,7 @@ module Google
878
904
  config_attr :metadata, nil, ::Hash, nil
879
905
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
880
906
  config_attr :quota_project, nil, ::String, nil
907
+ config_attr :universe_domain, nil, ::String, nil
881
908
 
882
909
  # @private
883
910
  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 attach_network_endpoints REST call
45
66
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # The GlobalOperations API.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :global_operations_stub
37
40
 
@@ -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_operations_stub.universe_domain
122
+ end
123
+
112
124
  ##
113
125
  # Create a new GlobalOperations 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)
@@ -147,7 +160,12 @@ module Google
147
160
  @quota_project_id = @config.quota_project
148
161
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
162
 
150
- @global_operations_stub = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
163
+ @global_operations_stub = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::ServiceStub.new(
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ credentials: credentials
168
+ )
151
169
  end
152
170
 
153
171
  # Service calls
@@ -603,9 +621,9 @@ module Google
603
621
  # end
604
622
  #
605
623
  # @!attribute [rw] endpoint
606
- # The hostname or hostname:port of the service endpoint.
607
- # Defaults to `"compute.googleapis.com"`.
608
- # @return [::String]
624
+ # A custom service endpoint, as a hostname or hostname:port. The default is
625
+ # nil, indicating to use the default endpoint in the current universe domain.
626
+ # @return [::String,nil]
609
627
  # @!attribute [rw] credentials
610
628
  # Credentials to send with calls. You may provide any of the following types:
611
629
  # * (`String`) The path to a service account key file in JSON format
@@ -642,13 +660,20 @@ module Google
642
660
  # @!attribute [rw] quota_project
643
661
  # A separate project against which to charge quota.
644
662
  # @return [::String]
663
+ # @!attribute [rw] universe_domain
664
+ # The universe domain within which to make requests. This determines the
665
+ # default endpoint URL. The default value of nil uses the environment
666
+ # universe (usually the default "googleapis.com" universe).
667
+ # @return [::String,nil]
645
668
  #
646
669
  class Configuration
647
670
  extend ::Gapic::Config
648
671
 
672
+ # @private
673
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
649
674
  DEFAULT_ENDPOINT = "compute.googleapis.com"
650
675
 
651
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
676
+ config_attr :endpoint, nil, ::String, nil
652
677
  config_attr :credentials, nil do |value|
653
678
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
654
679
  allowed.any? { |klass| klass === value }
@@ -660,6 +685,7 @@ module Google
660
685
  config_attr :metadata, nil, ::Hash, nil
661
686
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
662
687
  config_attr :quota_project, nil, ::String, nil
688
+ config_attr :universe_domain, nil, ::String, nil
663
689
 
664
690
  # @private
665
691
  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
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # The GlobalOrganizationOperations API.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :global_organization_operations_stub
37
40
 
@@ -102,6 +105,15 @@ module Google
102
105
  @config
103
106
  end
104
107
 
108
+ ##
109
+ # The effective universe domain
110
+ #
111
+ # @return [String]
112
+ #
113
+ def universe_domain
114
+ @global_organization_operations_stub.universe_domain
115
+ end
116
+
105
117
  ##
106
118
  # Create a new GlobalOrganizationOperations REST client object.
107
119
  #
@@ -129,8 +141,9 @@ module Google
129
141
  credentials = @config.credentials
130
142
  # Use self-signed JWT if the endpoint is unchanged from default,
131
143
  # but only if the default endpoint does not have a region prefix.
132
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
133
- !@config.endpoint.split(".").first.include?("-")
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
134
147
  credentials ||= Credentials.default scope: @config.scope,
135
148
  enable_self_signed_jwt: enable_self_signed_jwt
136
149
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -140,7 +153,12 @@ module Google
140
153
  @quota_project_id = @config.quota_project
141
154
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
142
155
 
143
- @global_organization_operations_stub = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
156
+ @global_organization_operations_stub = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::ServiceStub.new(
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ credentials: credentials
161
+ )
144
162
  end
145
163
 
146
164
  # Service calls
@@ -424,9 +442,9 @@ module Google
424
442
  # end
425
443
  #
426
444
  # @!attribute [rw] endpoint
427
- # The hostname or hostname:port of the service endpoint.
428
- # Defaults to `"compute.googleapis.com"`.
429
- # @return [::String]
445
+ # A custom service endpoint, as a hostname or hostname:port. The default is
446
+ # nil, indicating to use the default endpoint in the current universe domain.
447
+ # @return [::String,nil]
430
448
  # @!attribute [rw] credentials
431
449
  # Credentials to send with calls. You may provide any of the following types:
432
450
  # * (`String`) The path to a service account key file in JSON format
@@ -463,13 +481,20 @@ module Google
463
481
  # @!attribute [rw] quota_project
464
482
  # A separate project against which to charge quota.
465
483
  # @return [::String]
484
+ # @!attribute [rw] universe_domain
485
+ # The universe domain within which to make requests. This determines the
486
+ # default endpoint URL. The default value of nil uses the environment
487
+ # universe (usually the default "googleapis.com" universe).
488
+ # @return [::String,nil]
466
489
  #
467
490
  class Configuration
468
491
  extend ::Gapic::Config
469
492
 
493
+ # @private
494
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
470
495
  DEFAULT_ENDPOINT = "compute.googleapis.com"
471
496
 
472
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
497
+ config_attr :endpoint, nil, ::String, nil
473
498
  config_attr :credentials, nil do |value|
474
499
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
475
500
  allowed.any? { |klass| klass === value }
@@ -481,6 +506,7 @@ module Google
481
506
  config_attr :metadata, nil, ::Hash, nil
482
507
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
483
508
  config_attr :quota_project, nil, ::String, nil
509
+ config_attr :universe_domain, nil, ::String, nil
484
510
 
485
511
  # @private
486
512
  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 GlobalPublicDelegatedPrefixes 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_public_delegated_prefixes_stub
38
41
 
@@ -107,6 +110,15 @@ module Google
107
110
  @config
108
111
  end
109
112
 
113
+ ##
114
+ # The effective universe domain
115
+ #
116
+ # @return [String]
117
+ #
118
+ def universe_domain
119
+ @global_public_delegated_prefixes_stub.universe_domain
120
+ end
121
+
110
122
  ##
111
123
  # Create a new GlobalPublicDelegatedPrefixes REST client object.
112
124
  #
@@ -134,8 +146,9 @@ module Google
134
146
  credentials = @config.credentials
135
147
  # Use self-signed JWT if the endpoint is unchanged from default,
136
148
  # but only if the default endpoint does not have a region prefix.
137
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
138
- !@config.endpoint.split(".").first.include?("-")
149
+ enable_self_signed_jwt = @config.endpoint.nil? ||
150
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
151
+ !@config.endpoint.split(".").first.include?("-"))
139
152
  credentials ||= Credentials.default scope: @config.scope,
140
153
  enable_self_signed_jwt: enable_self_signed_jwt
141
154
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -149,9 +162,15 @@ module Google
149
162
  config.credentials = credentials
150
163
  config.quota_project = @quota_project_id
151
164
  config.endpoint = @config.endpoint
165
+ config.universe_domain = @config.universe_domain
152
166
  end
153
167
 
154
- @global_public_delegated_prefixes_stub = ::Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
168
+ @global_public_delegated_prefixes_stub = ::Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::ServiceStub.new(
169
+ endpoint: @config.endpoint,
170
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
171
+ universe_domain: @config.universe_domain,
172
+ credentials: credentials
173
+ )
155
174
  end
156
175
 
157
176
  ##
@@ -634,9 +653,9 @@ module Google
634
653
  # end
635
654
  #
636
655
  # @!attribute [rw] endpoint
637
- # The hostname or hostname:port of the service endpoint.
638
- # Defaults to `"compute.googleapis.com"`.
639
- # @return [::String]
656
+ # A custom service endpoint, as a hostname or hostname:port. The default is
657
+ # nil, indicating to use the default endpoint in the current universe domain.
658
+ # @return [::String,nil]
640
659
  # @!attribute [rw] credentials
641
660
  # Credentials to send with calls. You may provide any of the following types:
642
661
  # * (`String`) The path to a service account key file in JSON format
@@ -673,13 +692,20 @@ module Google
673
692
  # @!attribute [rw] quota_project
674
693
  # A separate project against which to charge quota.
675
694
  # @return [::String]
695
+ # @!attribute [rw] universe_domain
696
+ # The universe domain within which to make requests. This determines the
697
+ # default endpoint URL. The default value of nil uses the environment
698
+ # universe (usually the default "googleapis.com" universe).
699
+ # @return [::String,nil]
676
700
  #
677
701
  class Configuration
678
702
  extend ::Gapic::Config
679
703
 
704
+ # @private
705
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
680
706
  DEFAULT_ENDPOINT = "compute.googleapis.com"
681
707
 
682
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
708
+ config_attr :endpoint, nil, ::String, nil
683
709
  config_attr :credentials, nil do |value|
684
710
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
685
711
  allowed.any? { |klass| klass === value }
@@ -691,6 +717,7 @@ module Google
691
717
  config_attr :metadata, nil, ::Hash, nil
692
718
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
693
719
  config_attr :quota_project, nil, ::String, nil
720
+ config_attr :universe_domain, nil, ::String, nil
694
721
 
695
722
  # @private
696
723
  def initialize parent_config = nil