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 ResourcePolicies API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :resource_policies_stub
38
41
 
@@ -121,6 +124,15 @@ module Google
121
124
  @config
122
125
  end
123
126
 
127
+ ##
128
+ # The effective universe domain
129
+ #
130
+ # @return [String]
131
+ #
132
+ def universe_domain
133
+ @resource_policies_stub.universe_domain
134
+ end
135
+
124
136
  ##
125
137
  # Create a new ResourcePolicies REST client object.
126
138
  #
@@ -148,8 +160,9 @@ module Google
148
160
  credentials = @config.credentials
149
161
  # Use self-signed JWT if the endpoint is unchanged from default,
150
162
  # but only if the default endpoint does not have a region prefix.
151
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
- !@config.endpoint.split(".").first.include?("-")
163
+ enable_self_signed_jwt = @config.endpoint.nil? ||
164
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
165
+ !@config.endpoint.split(".").first.include?("-"))
153
166
  credentials ||= Credentials.default scope: @config.scope,
154
167
  enable_self_signed_jwt: enable_self_signed_jwt
155
168
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -163,9 +176,15 @@ module Google
163
176
  config.credentials = credentials
164
177
  config.quota_project = @quota_project_id
165
178
  config.endpoint = @config.endpoint
179
+ config.universe_domain = @config.universe_domain
166
180
  end
167
181
 
168
- @resource_policies_stub = ::Google::Cloud::Compute::V1::ResourcePolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
182
+ @resource_policies_stub = ::Google::Cloud::Compute::V1::ResourcePolicies::Rest::ServiceStub.new(
183
+ endpoint: @config.endpoint,
184
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
185
+ universe_domain: @config.universe_domain,
186
+ credentials: credentials
187
+ )
169
188
  end
170
189
 
171
190
  ##
@@ -1007,9 +1026,9 @@ module Google
1007
1026
  # end
1008
1027
  #
1009
1028
  # @!attribute [rw] endpoint
1010
- # The hostname or hostname:port of the service endpoint.
1011
- # Defaults to `"compute.googleapis.com"`.
1012
- # @return [::String]
1029
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1030
+ # nil, indicating to use the default endpoint in the current universe domain.
1031
+ # @return [::String,nil]
1013
1032
  # @!attribute [rw] credentials
1014
1033
  # Credentials to send with calls. You may provide any of the following types:
1015
1034
  # * (`String`) The path to a service account key file in JSON format
@@ -1046,13 +1065,20 @@ module Google
1046
1065
  # @!attribute [rw] quota_project
1047
1066
  # A separate project against which to charge quota.
1048
1067
  # @return [::String]
1068
+ # @!attribute [rw] universe_domain
1069
+ # The universe domain within which to make requests. This determines the
1070
+ # default endpoint URL. The default value of nil uses the environment
1071
+ # universe (usually the default "googleapis.com" universe).
1072
+ # @return [::String,nil]
1049
1073
  #
1050
1074
  class Configuration
1051
1075
  extend ::Gapic::Config
1052
1076
 
1077
+ # @private
1078
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1053
1079
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1054
1080
 
1055
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1081
+ config_attr :endpoint, nil, ::String, nil
1056
1082
  config_attr :credentials, nil do |value|
1057
1083
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1058
1084
  allowed.any? { |klass| klass === value }
@@ -1064,6 +1090,7 @@ module Google
1064
1090
  config_attr :metadata, nil, ::Hash, nil
1065
1091
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1066
1092
  config_attr :quota_project, nil, ::String, nil
1093
+ config_attr :universe_domain, nil, ::String, nil
1067
1094
 
1068
1095
  # @private
1069
1096
  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 Routers API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :routers_stub
38
41
 
@@ -131,6 +134,15 @@ module Google
131
134
  @config
132
135
  end
133
136
 
137
+ ##
138
+ # The effective universe domain
139
+ #
140
+ # @return [String]
141
+ #
142
+ def universe_domain
143
+ @routers_stub.universe_domain
144
+ end
145
+
134
146
  ##
135
147
  # Create a new Routers REST client object.
136
148
  #
@@ -158,8 +170,9 @@ module Google
158
170
  credentials = @config.credentials
159
171
  # Use self-signed JWT if the endpoint is unchanged from default,
160
172
  # but only if the default endpoint does not have a region prefix.
161
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
162
- !@config.endpoint.split(".").first.include?("-")
173
+ enable_self_signed_jwt = @config.endpoint.nil? ||
174
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
175
+ !@config.endpoint.split(".").first.include?("-"))
163
176
  credentials ||= Credentials.default scope: @config.scope,
164
177
  enable_self_signed_jwt: enable_self_signed_jwt
165
178
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -173,9 +186,15 @@ module Google
173
186
  config.credentials = credentials
174
187
  config.quota_project = @quota_project_id
175
188
  config.endpoint = @config.endpoint
189
+ config.universe_domain = @config.universe_domain
176
190
  end
177
191
 
178
- @routers_stub = ::Google::Cloud::Compute::V1::Routers::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
192
+ @routers_stub = ::Google::Cloud::Compute::V1::Routers::Rest::ServiceStub.new(
193
+ endpoint: @config.endpoint,
194
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
195
+ universe_domain: @config.universe_domain,
196
+ credentials: credentials
197
+ )
179
198
  end
180
199
 
181
200
  ##
@@ -1203,9 +1222,9 @@ module Google
1203
1222
  # end
1204
1223
  #
1205
1224
  # @!attribute [rw] endpoint
1206
- # The hostname or hostname:port of the service endpoint.
1207
- # Defaults to `"compute.googleapis.com"`.
1208
- # @return [::String]
1225
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1226
+ # nil, indicating to use the default endpoint in the current universe domain.
1227
+ # @return [::String,nil]
1209
1228
  # @!attribute [rw] credentials
1210
1229
  # Credentials to send with calls. You may provide any of the following types:
1211
1230
  # * (`String`) The path to a service account key file in JSON format
@@ -1242,13 +1261,20 @@ module Google
1242
1261
  # @!attribute [rw] quota_project
1243
1262
  # A separate project against which to charge quota.
1244
1263
  # @return [::String]
1264
+ # @!attribute [rw] universe_domain
1265
+ # The universe domain within which to make requests. This determines the
1266
+ # default endpoint URL. The default value of nil uses the environment
1267
+ # universe (usually the default "googleapis.com" universe).
1268
+ # @return [::String,nil]
1245
1269
  #
1246
1270
  class Configuration
1247
1271
  extend ::Gapic::Config
1248
1272
 
1273
+ # @private
1274
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1249
1275
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1250
1276
 
1251
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1277
+ config_attr :endpoint, nil, ::String, nil
1252
1278
  config_attr :credentials, nil do |value|
1253
1279
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1254
1280
  allowed.any? { |klass| klass === value }
@@ -1260,6 +1286,7 @@ module Google
1260
1286
  config_attr :metadata, nil, ::Hash, nil
1261
1287
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1262
1288
  config_attr :quota_project, nil, ::String, nil
1289
+ config_attr :universe_domain, nil, ::String, nil
1263
1290
 
1264
1291
  # @private
1265
1292
  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 Routes API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :routes_stub
38
41
 
@@ -105,6 +108,15 @@ module Google
105
108
  @config
106
109
  end
107
110
 
111
+ ##
112
+ # The effective universe domain
113
+ #
114
+ # @return [String]
115
+ #
116
+ def universe_domain
117
+ @routes_stub.universe_domain
118
+ end
119
+
108
120
  ##
109
121
  # Create a new Routes REST client object.
110
122
  #
@@ -132,8 +144,9 @@ module Google
132
144
  credentials = @config.credentials
133
145
  # Use self-signed JWT if the endpoint is unchanged from default,
134
146
  # but only if the default endpoint does not have a region prefix.
135
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
136
- !@config.endpoint.split(".").first.include?("-")
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
137
150
  credentials ||= Credentials.default scope: @config.scope,
138
151
  enable_self_signed_jwt: enable_self_signed_jwt
139
152
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -147,9 +160,15 @@ module Google
147
160
  config.credentials = credentials
148
161
  config.quota_project = @quota_project_id
149
162
  config.endpoint = @config.endpoint
163
+ config.universe_domain = @config.universe_domain
150
164
  end
151
165
 
152
- @routes_stub = ::Google::Cloud::Compute::V1::Routes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
166
+ @routes_stub = ::Google::Cloud::Compute::V1::Routes::Rest::ServiceStub.new(
167
+ endpoint: @config.endpoint,
168
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
169
+ universe_domain: @config.universe_domain,
170
+ credentials: credentials
171
+ )
153
172
  end
154
173
 
155
174
  ##
@@ -540,9 +559,9 @@ module Google
540
559
  # end
541
560
  #
542
561
  # @!attribute [rw] endpoint
543
- # The hostname or hostname:port of the service endpoint.
544
- # Defaults to `"compute.googleapis.com"`.
545
- # @return [::String]
562
+ # A custom service endpoint, as a hostname or hostname:port. The default is
563
+ # nil, indicating to use the default endpoint in the current universe domain.
564
+ # @return [::String,nil]
546
565
  # @!attribute [rw] credentials
547
566
  # Credentials to send with calls. You may provide any of the following types:
548
567
  # * (`String`) The path to a service account key file in JSON format
@@ -579,13 +598,20 @@ module Google
579
598
  # @!attribute [rw] quota_project
580
599
  # A separate project against which to charge quota.
581
600
  # @return [::String]
601
+ # @!attribute [rw] universe_domain
602
+ # The universe domain within which to make requests. This determines the
603
+ # default endpoint URL. The default value of nil uses the environment
604
+ # universe (usually the default "googleapis.com" universe).
605
+ # @return [::String,nil]
582
606
  #
583
607
  class Configuration
584
608
  extend ::Gapic::Config
585
609
 
610
+ # @private
611
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
586
612
  DEFAULT_ENDPOINT = "compute.googleapis.com"
587
613
 
588
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
614
+ config_attr :endpoint, nil, ::String, nil
589
615
  config_attr :credentials, nil do |value|
590
616
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
591
617
  allowed.any? { |klass| klass === value }
@@ -597,6 +623,7 @@ module Google
597
623
  config_attr :metadata, nil, ::Hash, nil
598
624
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
599
625
  config_attr :quota_project, nil, ::String, nil
626
+ config_attr :universe_domain, nil, ::String, nil
600
627
 
601
628
  # @private
602
629
  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 SecurityPolicies API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :security_policies_stub
38
41
 
@@ -130,6 +133,15 @@ module Google
130
133
  @config
131
134
  end
132
135
 
136
+ ##
137
+ # The effective universe domain
138
+ #
139
+ # @return [String]
140
+ #
141
+ def universe_domain
142
+ @security_policies_stub.universe_domain
143
+ end
144
+
133
145
  ##
134
146
  # Create a new SecurityPolicies REST client object.
135
147
  #
@@ -157,8 +169,9 @@ module Google
157
169
  credentials = @config.credentials
158
170
  # Use self-signed JWT if the endpoint is unchanged from default,
159
171
  # but only if the default endpoint does not have a region prefix.
160
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
161
- !@config.endpoint.split(".").first.include?("-")
172
+ enable_self_signed_jwt = @config.endpoint.nil? ||
173
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
174
+ !@config.endpoint.split(".").first.include?("-"))
162
175
  credentials ||= Credentials.default scope: @config.scope,
163
176
  enable_self_signed_jwt: enable_self_signed_jwt
164
177
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -172,9 +185,15 @@ module Google
172
185
  config.credentials = credentials
173
186
  config.quota_project = @quota_project_id
174
187
  config.endpoint = @config.endpoint
188
+ config.universe_domain = @config.universe_domain
175
189
  end
176
190
 
177
- @security_policies_stub = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
191
+ @security_policies_stub = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::ServiceStub.new(
192
+ endpoint: @config.endpoint,
193
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
194
+ universe_domain: @config.universe_domain,
195
+ credentials: credentials
196
+ )
178
197
  end
179
198
 
180
199
  ##
@@ -1291,9 +1310,9 @@ module Google
1291
1310
  # end
1292
1311
  #
1293
1312
  # @!attribute [rw] endpoint
1294
- # The hostname or hostname:port of the service endpoint.
1295
- # Defaults to `"compute.googleapis.com"`.
1296
- # @return [::String]
1313
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1314
+ # nil, indicating to use the default endpoint in the current universe domain.
1315
+ # @return [::String,nil]
1297
1316
  # @!attribute [rw] credentials
1298
1317
  # Credentials to send with calls. You may provide any of the following types:
1299
1318
  # * (`String`) The path to a service account key file in JSON format
@@ -1330,13 +1349,20 @@ module Google
1330
1349
  # @!attribute [rw] quota_project
1331
1350
  # A separate project against which to charge quota.
1332
1351
  # @return [::String]
1352
+ # @!attribute [rw] universe_domain
1353
+ # The universe domain within which to make requests. This determines the
1354
+ # default endpoint URL. The default value of nil uses the environment
1355
+ # universe (usually the default "googleapis.com" universe).
1356
+ # @return [::String,nil]
1333
1357
  #
1334
1358
  class Configuration
1335
1359
  extend ::Gapic::Config
1336
1360
 
1361
+ # @private
1362
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1337
1363
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1338
1364
 
1339
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1365
+ config_attr :endpoint, nil, ::String, nil
1340
1366
  config_attr :credentials, nil do |value|
1341
1367
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1342
1368
  allowed.any? { |klass| klass === value }
@@ -1348,6 +1374,7 @@ module Google
1348
1374
  config_attr :metadata, nil, ::Hash, nil
1349
1375
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1350
1376
  config_attr :quota_project, nil, ::String, nil
1377
+ config_attr :universe_domain, nil, ::String, nil
1351
1378
 
1352
1379
  # @private
1353
1380
  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 add_rule REST call
45
57
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The ServiceAttachments API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :service_attachments_stub
38
41
 
@@ -121,6 +124,15 @@ module Google
121
124
  @config
122
125
  end
123
126
 
127
+ ##
128
+ # The effective universe domain
129
+ #
130
+ # @return [String]
131
+ #
132
+ def universe_domain
133
+ @service_attachments_stub.universe_domain
134
+ end
135
+
124
136
  ##
125
137
  # Create a new ServiceAttachments REST client object.
126
138
  #
@@ -148,8 +160,9 @@ module Google
148
160
  credentials = @config.credentials
149
161
  # Use self-signed JWT if the endpoint is unchanged from default,
150
162
  # but only if the default endpoint does not have a region prefix.
151
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
- !@config.endpoint.split(".").first.include?("-")
163
+ enable_self_signed_jwt = @config.endpoint.nil? ||
164
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
165
+ !@config.endpoint.split(".").first.include?("-"))
153
166
  credentials ||= Credentials.default scope: @config.scope,
154
167
  enable_self_signed_jwt: enable_self_signed_jwt
155
168
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -163,9 +176,15 @@ module Google
163
176
  config.credentials = credentials
164
177
  config.quota_project = @quota_project_id
165
178
  config.endpoint = @config.endpoint
179
+ config.universe_domain = @config.universe_domain
166
180
  end
167
181
 
168
- @service_attachments_stub = ::Google::Cloud::Compute::V1::ServiceAttachments::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
182
+ @service_attachments_stub = ::Google::Cloud::Compute::V1::ServiceAttachments::Rest::ServiceStub.new(
183
+ endpoint: @config.endpoint,
184
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
185
+ universe_domain: @config.universe_domain,
186
+ credentials: credentials
187
+ )
169
188
  end
170
189
 
171
190
  ##
@@ -1005,9 +1024,9 @@ module Google
1005
1024
  # end
1006
1025
  #
1007
1026
  # @!attribute [rw] endpoint
1008
- # The hostname or hostname:port of the service endpoint.
1009
- # Defaults to `"compute.googleapis.com"`.
1010
- # @return [::String]
1027
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1028
+ # nil, indicating to use the default endpoint in the current universe domain.
1029
+ # @return [::String,nil]
1011
1030
  # @!attribute [rw] credentials
1012
1031
  # Credentials to send with calls. You may provide any of the following types:
1013
1032
  # * (`String`) The path to a service account key file in JSON format
@@ -1044,13 +1063,20 @@ module Google
1044
1063
  # @!attribute [rw] quota_project
1045
1064
  # A separate project against which to charge quota.
1046
1065
  # @return [::String]
1066
+ # @!attribute [rw] universe_domain
1067
+ # The universe domain within which to make requests. This determines the
1068
+ # default endpoint URL. The default value of nil uses the environment
1069
+ # universe (usually the default "googleapis.com" universe).
1070
+ # @return [::String,nil]
1047
1071
  #
1048
1072
  class Configuration
1049
1073
  extend ::Gapic::Config
1050
1074
 
1075
+ # @private
1076
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1051
1077
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1052
1078
 
1053
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1079
+ config_attr :endpoint, nil, ::String, nil
1054
1080
  config_attr :credentials, nil do |value|
1055
1081
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1056
1082
  allowed.any? { |klass| klass === value }
@@ -1062,6 +1088,7 @@ module Google
1062
1088
  config_attr :metadata, nil, ::Hash, nil
1063
1089
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1064
1090
  config_attr :quota_project, nil, ::String, nil
1091
+ config_attr :universe_domain, nil, ::String, nil
1065
1092
 
1066
1093
  # @private
1067
1094
  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
  #