google-cloud-compute-v1 2.6.0 → 2.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +33 -7
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +23 -2
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +34 -7
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +23 -2
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +34 -7
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +23 -2
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +34 -7
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +23 -2
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +34 -7
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +23 -2
  13. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +33 -7
  14. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +23 -2
  15. data/lib/google/cloud/compute/v1/disks/rest/client.rb +34 -7
  16. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +23 -2
  17. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +34 -7
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +23 -2
  19. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +34 -7
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +23 -2
  21. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +34 -7
  22. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +23 -2
  23. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +34 -7
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +23 -2
  25. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +23 -2
  27. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +34 -7
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +23 -2
  29. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +34 -7
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +23 -2
  31. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +33 -7
  32. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +23 -2
  33. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +33 -7
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +23 -2
  35. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +34 -7
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +23 -2
  37. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +34 -7
  38. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +23 -2
  39. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +33 -7
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +23 -2
  41. data/lib/google/cloud/compute/v1/images/rest/client.rb +34 -7
  42. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +23 -2
  43. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +34 -7
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +23 -2
  45. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +34 -7
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +23 -2
  47. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +23 -2
  49. data/lib/google/cloud/compute/v1/instances/rest/client.rb +34 -7
  50. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +23 -2
  51. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +34 -7
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +23 -2
  53. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +33 -7
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +23 -2
  55. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +33 -7
  56. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +23 -2
  57. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +34 -7
  58. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +23 -2
  59. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +33 -7
  60. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +23 -2
  61. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
  62. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +23 -2
  63. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +34 -7
  64. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +23 -2
  65. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +33 -7
  66. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +23 -2
  67. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +34 -7
  68. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +23 -2
  69. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +34 -7
  70. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +23 -2
  71. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +34 -7
  72. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +23 -2
  73. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +34 -7
  74. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +23 -2
  75. data/lib/google/cloud/compute/v1/networks/rest/client.rb +34 -7
  76. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +23 -2
  77. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +34 -7
  78. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +23 -2
  79. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +34 -7
  80. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +23 -2
  81. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +33 -7
  82. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +23 -2
  83. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +34 -7
  84. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +23 -2
  85. data/lib/google/cloud/compute/v1/projects/rest/client.rb +34 -7
  86. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +23 -2
  87. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +34 -7
  88. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +23 -2
  89. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +34 -7
  90. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +23 -2
  91. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +34 -7
  92. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +23 -2
  93. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +34 -7
  94. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +23 -2
  95. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +34 -7
  96. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +23 -2
  97. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +33 -7
  98. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +23 -2
  99. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +34 -7
  100. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +23 -2
  101. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +34 -7
  102. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +23 -2
  103. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +34 -7
  104. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +23 -2
  105. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +34 -7
  106. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +23 -2
  107. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +34 -7
  108. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +23 -2
  109. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +34 -7
  110. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +23 -2
  111. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +34 -7
  112. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +23 -2
  113. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +34 -7
  114. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +23 -2
  115. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +34 -7
  116. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +23 -2
  117. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +34 -7
  118. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +23 -2
  119. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +33 -7
  120. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +23 -2
  121. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +34 -7
  122. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +23 -2
  123. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +34 -7
  124. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +23 -2
  125. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +34 -7
  126. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +23 -2
  127. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +34 -7
  128. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +23 -2
  129. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +34 -7
  130. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +23 -2
  131. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +34 -7
  132. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +23 -2
  133. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +34 -7
  134. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +23 -2
  135. data/lib/google/cloud/compute/v1/regions/rest/client.rb +33 -7
  136. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +23 -2
  137. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +34 -7
  138. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +23 -2
  139. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +34 -7
  140. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +23 -2
  141. data/lib/google/cloud/compute/v1/routers/rest/client.rb +34 -7
  142. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +23 -2
  143. data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
  144. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +23 -2
  145. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +34 -7
  146. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +23 -2
  147. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +34 -7
  148. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +23 -2
  149. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +34 -7
  150. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +23 -2
  151. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +34 -7
  152. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +23 -2
  153. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +34 -7
  154. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +23 -2
  155. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +34 -7
  156. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +23 -2
  157. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +34 -7
  158. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +23 -2
  159. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +34 -7
  160. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +23 -2
  161. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +34 -7
  162. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +23 -2
  163. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +34 -7
  164. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +23 -2
  165. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +34 -7
  166. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +23 -2
  167. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +34 -7
  168. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +23 -2
  169. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +34 -7
  170. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +23 -2
  171. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +34 -7
  172. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +23 -2
  173. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +34 -7
  174. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +23 -2
  175. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +34 -7
  176. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +23 -2
  177. data/lib/google/cloud/compute/v1/version.rb +1 -1
  178. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +34 -7
  179. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +23 -2
  180. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +34 -7
  181. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +23 -2
  182. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +33 -7
  183. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +23 -2
  184. data/lib/google/cloud/compute/v1/zones/rest/client.rb +33 -7
  185. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +23 -2
  186. data/proto_docs/google/api/client.rb +1 -0
  187. metadata +5 -5
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the delete REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The HealthChecks API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :health_checks_stub
38
41
 
@@ -114,6 +117,15 @@ module Google
114
117
  @config
115
118
  end
116
119
 
120
+ ##
121
+ # The effective universe domain
122
+ #
123
+ # @return [String]
124
+ #
125
+ def universe_domain
126
+ @health_checks_stub.universe_domain
127
+ end
128
+
117
129
  ##
118
130
  # Create a new HealthChecks REST client object.
119
131
  #
@@ -141,8 +153,9 @@ module Google
141
153
  credentials = @config.credentials
142
154
  # Use self-signed JWT if the endpoint is unchanged from default,
143
155
  # but only if the default endpoint does not have a region prefix.
144
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
- !@config.endpoint.split(".").first.include?("-")
156
+ enable_self_signed_jwt = @config.endpoint.nil? ||
157
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
158
+ !@config.endpoint.split(".").first.include?("-"))
146
159
  credentials ||= Credentials.default scope: @config.scope,
147
160
  enable_self_signed_jwt: enable_self_signed_jwt
148
161
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -156,9 +169,15 @@ module Google
156
169
  config.credentials = credentials
157
170
  config.quota_project = @quota_project_id
158
171
  config.endpoint = @config.endpoint
172
+ config.universe_domain = @config.universe_domain
159
173
  end
160
174
 
161
- @health_checks_stub = ::Google::Cloud::Compute::V1::HealthChecks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
175
+ @health_checks_stub = ::Google::Cloud::Compute::V1::HealthChecks::Rest::ServiceStub.new(
176
+ endpoint: @config.endpoint,
177
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
178
+ universe_domain: @config.universe_domain,
179
+ credentials: credentials
180
+ )
162
181
  end
163
182
 
164
183
  ##
@@ -825,9 +844,9 @@ module Google
825
844
  # end
826
845
  #
827
846
  # @!attribute [rw] endpoint
828
- # The hostname or hostname:port of the service endpoint.
829
- # Defaults to `"compute.googleapis.com"`.
830
- # @return [::String]
847
+ # A custom service endpoint, as a hostname or hostname:port. The default is
848
+ # nil, indicating to use the default endpoint in the current universe domain.
849
+ # @return [::String,nil]
831
850
  # @!attribute [rw] credentials
832
851
  # Credentials to send with calls. You may provide any of the following types:
833
852
  # * (`String`) The path to a service account key file in JSON format
@@ -864,13 +883,20 @@ module Google
864
883
  # @!attribute [rw] quota_project
865
884
  # A separate project against which to charge quota.
866
885
  # @return [::String]
886
+ # @!attribute [rw] universe_domain
887
+ # The universe domain within which to make requests. This determines the
888
+ # default endpoint URL. The default value of nil uses the environment
889
+ # universe (usually the default "googleapis.com" universe).
890
+ # @return [::String,nil]
867
891
  #
868
892
  class Configuration
869
893
  extend ::Gapic::Config
870
894
 
895
+ # @private
896
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
871
897
  DEFAULT_ENDPOINT = "compute.googleapis.com"
872
898
 
873
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
899
+ config_attr :endpoint, nil, ::String, nil
874
900
  config_attr :credentials, nil do |value|
875
901
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
876
902
  allowed.any? { |klass| klass === value }
@@ -882,6 +908,7 @@ module Google
882
908
  config_attr :metadata, nil, ::Hash, nil
883
909
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
884
910
  config_attr :quota_project, nil, ::String, nil
911
+ config_attr :universe_domain, nil, ::String, nil
885
912
 
886
913
  # @private
887
914
  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 ImageFamilyViews API.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :image_family_views_stub
37
40
 
@@ -95,6 +98,15 @@ module Google
95
98
  @config
96
99
  end
97
100
 
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @image_family_views_stub.universe_domain
108
+ end
109
+
98
110
  ##
99
111
  # Create a new ImageFamilyViews REST client object.
100
112
  #
@@ -122,8 +134,9 @@ module Google
122
134
  credentials = @config.credentials
123
135
  # Use self-signed JWT if the endpoint is unchanged from default,
124
136
  # but only if the default endpoint does not have a region prefix.
125
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
126
- !@config.endpoint.split(".").first.include?("-")
137
+ enable_self_signed_jwt = @config.endpoint.nil? ||
138
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
139
+ !@config.endpoint.split(".").first.include?("-"))
127
140
  credentials ||= Credentials.default scope: @config.scope,
128
141
  enable_self_signed_jwt: enable_self_signed_jwt
129
142
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -133,7 +146,12 @@ module Google
133
146
  @quota_project_id = @config.quota_project
134
147
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
135
148
 
136
- @image_family_views_stub = ::Google::Cloud::Compute::V1::ImageFamilyViews::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
149
+ @image_family_views_stub = ::Google::Cloud::Compute::V1::ImageFamilyViews::Rest::ServiceStub.new(
150
+ endpoint: @config.endpoint,
151
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
+ universe_domain: @config.universe_domain,
153
+ credentials: credentials
154
+ )
137
155
  end
138
156
 
139
157
  # Service calls
@@ -250,9 +268,9 @@ module Google
250
268
  # end
251
269
  #
252
270
  # @!attribute [rw] endpoint
253
- # The hostname or hostname:port of the service endpoint.
254
- # Defaults to `"compute.googleapis.com"`.
255
- # @return [::String]
271
+ # A custom service endpoint, as a hostname or hostname:port. The default is
272
+ # nil, indicating to use the default endpoint in the current universe domain.
273
+ # @return [::String,nil]
256
274
  # @!attribute [rw] credentials
257
275
  # Credentials to send with calls. You may provide any of the following types:
258
276
  # * (`String`) The path to a service account key file in JSON format
@@ -289,13 +307,20 @@ module Google
289
307
  # @!attribute [rw] quota_project
290
308
  # A separate project against which to charge quota.
291
309
  # @return [::String]
310
+ # @!attribute [rw] universe_domain
311
+ # The universe domain within which to make requests. This determines the
312
+ # default endpoint URL. The default value of nil uses the environment
313
+ # universe (usually the default "googleapis.com" universe).
314
+ # @return [::String,nil]
292
315
  #
293
316
  class Configuration
294
317
  extend ::Gapic::Config
295
318
 
319
+ # @private
320
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
296
321
  DEFAULT_ENDPOINT = "compute.googleapis.com"
297
322
 
298
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
323
+ config_attr :endpoint, nil, ::String, nil
299
324
  config_attr :credentials, nil do |value|
300
325
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
301
326
  allowed.any? { |klass| klass === value }
@@ -307,6 +332,7 @@ module Google
307
332
  config_attr :metadata, nil, ::Hash, nil
308
333
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
309
334
  config_attr :quota_project, nil, ::String, nil
335
+ config_attr :universe_domain, nil, ::String, nil
310
336
 
311
337
  # @private
312
338
  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 get REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The Images API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :images_stub
38
41
 
@@ -125,6 +128,15 @@ module Google
125
128
  @config
126
129
  end
127
130
 
131
+ ##
132
+ # The effective universe domain
133
+ #
134
+ # @return [String]
135
+ #
136
+ def universe_domain
137
+ @images_stub.universe_domain
138
+ end
139
+
128
140
  ##
129
141
  # Create a new Images REST client object.
130
142
  #
@@ -152,8 +164,9 @@ module Google
152
164
  credentials = @config.credentials
153
165
  # Use self-signed JWT if the endpoint is unchanged from default,
154
166
  # but only if the default endpoint does not have a region prefix.
155
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
156
- !@config.endpoint.split(".").first.include?("-")
167
+ enable_self_signed_jwt = @config.endpoint.nil? ||
168
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
169
+ !@config.endpoint.split(".").first.include?("-"))
157
170
  credentials ||= Credentials.default scope: @config.scope,
158
171
  enable_self_signed_jwt: enable_self_signed_jwt
159
172
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -167,9 +180,15 @@ module Google
167
180
  config.credentials = credentials
168
181
  config.quota_project = @quota_project_id
169
182
  config.endpoint = @config.endpoint
183
+ config.universe_domain = @config.universe_domain
170
184
  end
171
185
 
172
- @images_stub = ::Google::Cloud::Compute::V1::Images::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
186
+ @images_stub = ::Google::Cloud::Compute::V1::Images::Rest::ServiceStub.new(
187
+ endpoint: @config.endpoint,
188
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
189
+ universe_domain: @config.universe_domain,
190
+ credentials: credentials
191
+ )
173
192
  end
174
193
 
175
194
  ##
@@ -1162,9 +1181,9 @@ module Google
1162
1181
  # end
1163
1182
  #
1164
1183
  # @!attribute [rw] endpoint
1165
- # The hostname or hostname:port of the service endpoint.
1166
- # Defaults to `"compute.googleapis.com"`.
1167
- # @return [::String]
1184
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1185
+ # nil, indicating to use the default endpoint in the current universe domain.
1186
+ # @return [::String,nil]
1168
1187
  # @!attribute [rw] credentials
1169
1188
  # Credentials to send with calls. You may provide any of the following types:
1170
1189
  # * (`String`) The path to a service account key file in JSON format
@@ -1201,13 +1220,20 @@ module Google
1201
1220
  # @!attribute [rw] quota_project
1202
1221
  # A separate project against which to charge quota.
1203
1222
  # @return [::String]
1223
+ # @!attribute [rw] universe_domain
1224
+ # The universe domain within which to make requests. This determines the
1225
+ # default endpoint URL. The default value of nil uses the environment
1226
+ # universe (usually the default "googleapis.com" universe).
1227
+ # @return [::String,nil]
1204
1228
  #
1205
1229
  class Configuration
1206
1230
  extend ::Gapic::Config
1207
1231
 
1232
+ # @private
1233
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1208
1234
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1209
1235
 
1210
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1236
+ config_attr :endpoint, nil, ::String, nil
1211
1237
  config_attr :credentials, nil do |value|
1212
1238
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1213
1239
  allowed.any? { |klass| klass === value }
@@ -1219,6 +1245,7 @@ module Google
1219
1245
  config_attr :metadata, nil, ::Hash, nil
1220
1246
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1221
1247
  config_attr :quota_project, nil, ::String, nil
1248
+ config_attr :universe_domain, nil, ::String, nil
1222
1249
 
1223
1250
  # @private
1224
1251
  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 InstanceGroupManagers API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :instance_group_managers_stub
38
41
 
@@ -143,6 +146,15 @@ module Google
143
146
  @config
144
147
  end
145
148
 
149
+ ##
150
+ # The effective universe domain
151
+ #
152
+ # @return [String]
153
+ #
154
+ def universe_domain
155
+ @instance_group_managers_stub.universe_domain
156
+ end
157
+
146
158
  ##
147
159
  # Create a new InstanceGroupManagers REST client object.
148
160
  #
@@ -170,8 +182,9 @@ module Google
170
182
  credentials = @config.credentials
171
183
  # Use self-signed JWT if the endpoint is unchanged from default,
172
184
  # but only if the default endpoint does not have a region prefix.
173
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
174
- !@config.endpoint.split(".").first.include?("-")
185
+ enable_self_signed_jwt = @config.endpoint.nil? ||
186
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
187
+ !@config.endpoint.split(".").first.include?("-"))
175
188
  credentials ||= Credentials.default scope: @config.scope,
176
189
  enable_self_signed_jwt: enable_self_signed_jwt
177
190
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -185,9 +198,15 @@ module Google
185
198
  config.credentials = credentials
186
199
  config.quota_project = @quota_project_id
187
200
  config.endpoint = @config.endpoint
201
+ config.universe_domain = @config.universe_domain
188
202
  end
189
203
 
190
- @instance_group_managers_stub = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
204
+ @instance_group_managers_stub = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::ServiceStub.new(
205
+ endpoint: @config.endpoint,
206
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
207
+ universe_domain: @config.universe_domain,
208
+ credentials: credentials
209
+ )
191
210
  end
192
211
 
193
212
  ##
@@ -2095,9 +2114,9 @@ module Google
2095
2114
  # end
2096
2115
  #
2097
2116
  # @!attribute [rw] endpoint
2098
- # The hostname or hostname:port of the service endpoint.
2099
- # Defaults to `"compute.googleapis.com"`.
2100
- # @return [::String]
2117
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2118
+ # nil, indicating to use the default endpoint in the current universe domain.
2119
+ # @return [::String,nil]
2101
2120
  # @!attribute [rw] credentials
2102
2121
  # Credentials to send with calls. You may provide any of the following types:
2103
2122
  # * (`String`) The path to a service account key file in JSON format
@@ -2134,13 +2153,20 @@ module Google
2134
2153
  # @!attribute [rw] quota_project
2135
2154
  # A separate project against which to charge quota.
2136
2155
  # @return [::String]
2156
+ # @!attribute [rw] universe_domain
2157
+ # The universe domain within which to make requests. This determines the
2158
+ # default endpoint URL. The default value of nil uses the environment
2159
+ # universe (usually the default "googleapis.com" universe).
2160
+ # @return [::String,nil]
2137
2161
  #
2138
2162
  class Configuration
2139
2163
  extend ::Gapic::Config
2140
2164
 
2165
+ # @private
2166
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2141
2167
  DEFAULT_ENDPOINT = "compute.googleapis.com"
2142
2168
 
2143
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2169
+ config_attr :endpoint, nil, ::String, nil
2144
2170
  config_attr :credentials, nil do |value|
2145
2171
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2146
2172
  allowed.any? { |klass| klass === value }
@@ -2152,6 +2178,7 @@ module Google
2152
2178
  config_attr :metadata, nil, ::Hash, nil
2153
2179
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2154
2180
  config_attr :quota_project, nil, ::String, nil
2181
+ config_attr :universe_domain, nil, ::String, nil
2155
2182
 
2156
2183
  # @private
2157
2184
  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 abandon_instances REST call
45
66
  #