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 SslCertificates API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :ssl_certificates_stub
38
41
 
@@ -110,6 +113,15 @@ module Google
110
113
  @config
111
114
  end
112
115
 
116
+ ##
117
+ # The effective universe domain
118
+ #
119
+ # @return [String]
120
+ #
121
+ def universe_domain
122
+ @ssl_certificates_stub.universe_domain
123
+ end
124
+
113
125
  ##
114
126
  # Create a new SslCertificates REST client object.
115
127
  #
@@ -137,8 +149,9 @@ module Google
137
149
  credentials = @config.credentials
138
150
  # Use self-signed JWT if the endpoint is unchanged from default,
139
151
  # but only if the default endpoint does not have a region prefix.
140
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
- !@config.endpoint.split(".").first.include?("-")
152
+ enable_self_signed_jwt = @config.endpoint.nil? ||
153
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
154
+ !@config.endpoint.split(".").first.include?("-"))
142
155
  credentials ||= Credentials.default scope: @config.scope,
143
156
  enable_self_signed_jwt: enable_self_signed_jwt
144
157
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -152,9 +165,15 @@ module Google
152
165
  config.credentials = credentials
153
166
  config.quota_project = @quota_project_id
154
167
  config.endpoint = @config.endpoint
168
+ config.universe_domain = @config.universe_domain
155
169
  end
156
170
 
157
- @ssl_certificates_stub = ::Google::Cloud::Compute::V1::SslCertificates::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
171
+ @ssl_certificates_stub = ::Google::Cloud::Compute::V1::SslCertificates::Rest::ServiceStub.new(
172
+ endpoint: @config.endpoint,
173
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
174
+ universe_domain: @config.universe_domain,
175
+ credentials: credentials
176
+ )
158
177
  end
159
178
 
160
179
  ##
@@ -637,9 +656,9 @@ module Google
637
656
  # end
638
657
  #
639
658
  # @!attribute [rw] endpoint
640
- # The hostname or hostname:port of the service endpoint.
641
- # Defaults to `"compute.googleapis.com"`.
642
- # @return [::String]
659
+ # A custom service endpoint, as a hostname or hostname:port. The default is
660
+ # nil, indicating to use the default endpoint in the current universe domain.
661
+ # @return [::String,nil]
643
662
  # @!attribute [rw] credentials
644
663
  # Credentials to send with calls. You may provide any of the following types:
645
664
  # * (`String`) The path to a service account key file in JSON format
@@ -676,13 +695,20 @@ module Google
676
695
  # @!attribute [rw] quota_project
677
696
  # A separate project against which to charge quota.
678
697
  # @return [::String]
698
+ # @!attribute [rw] universe_domain
699
+ # The universe domain within which to make requests. This determines the
700
+ # default endpoint URL. The default value of nil uses the environment
701
+ # universe (usually the default "googleapis.com" universe).
702
+ # @return [::String,nil]
679
703
  #
680
704
  class Configuration
681
705
  extend ::Gapic::Config
682
706
 
707
+ # @private
708
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
683
709
  DEFAULT_ENDPOINT = "compute.googleapis.com"
684
710
 
685
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
711
+ config_attr :endpoint, nil, ::String, nil
686
712
  config_attr :credentials, nil do |value|
687
713
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
688
714
  allowed.any? { |klass| klass === value }
@@ -694,6 +720,7 @@ module Google
694
720
  config_attr :metadata, nil, ::Hash, nil
695
721
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
696
722
  config_attr :quota_project, nil, ::String, nil
723
+ config_attr :universe_domain, nil, ::String, nil
697
724
 
698
725
  # @private
699
726
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the aggregated_list REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The SslPolicies API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :ssl_policies_stub
38
41
 
@@ -117,6 +120,15 @@ module Google
117
120
  @config
118
121
  end
119
122
 
123
+ ##
124
+ # The effective universe domain
125
+ #
126
+ # @return [String]
127
+ #
128
+ def universe_domain
129
+ @ssl_policies_stub.universe_domain
130
+ end
131
+
120
132
  ##
121
133
  # Create a new SslPolicies REST client object.
122
134
  #
@@ -144,8 +156,9 @@ module Google
144
156
  credentials = @config.credentials
145
157
  # Use self-signed JWT if the endpoint is unchanged from default,
146
158
  # but only if the default endpoint does not have a region prefix.
147
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
- !@config.endpoint.split(".").first.include?("-")
159
+ enable_self_signed_jwt = @config.endpoint.nil? ||
160
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
161
+ !@config.endpoint.split(".").first.include?("-"))
149
162
  credentials ||= Credentials.default scope: @config.scope,
150
163
  enable_self_signed_jwt: enable_self_signed_jwt
151
164
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -159,9 +172,15 @@ module Google
159
172
  config.credentials = credentials
160
173
  config.quota_project = @quota_project_id
161
174
  config.endpoint = @config.endpoint
175
+ config.universe_domain = @config.universe_domain
162
176
  end
163
177
 
164
- @ssl_policies_stub = ::Google::Cloud::Compute::V1::SslPolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
178
+ @ssl_policies_stub = ::Google::Cloud::Compute::V1::SslPolicies::Rest::ServiceStub.new(
179
+ endpoint: @config.endpoint,
180
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
181
+ universe_domain: @config.universe_domain,
182
+ credentials: credentials
183
+ )
165
184
  end
166
185
 
167
186
  ##
@@ -824,9 +843,9 @@ module Google
824
843
  # end
825
844
  #
826
845
  # @!attribute [rw] endpoint
827
- # The hostname or hostname:port of the service endpoint.
828
- # Defaults to `"compute.googleapis.com"`.
829
- # @return [::String]
846
+ # A custom service endpoint, as a hostname or hostname:port. The default is
847
+ # nil, indicating to use the default endpoint in the current universe domain.
848
+ # @return [::String,nil]
830
849
  # @!attribute [rw] credentials
831
850
  # Credentials to send with calls. You may provide any of the following types:
832
851
  # * (`String`) The path to a service account key file in JSON format
@@ -863,13 +882,20 @@ module Google
863
882
  # @!attribute [rw] quota_project
864
883
  # A separate project against which to charge quota.
865
884
  # @return [::String]
885
+ # @!attribute [rw] universe_domain
886
+ # The universe domain within which to make requests. This determines the
887
+ # default endpoint URL. The default value of nil uses the environment
888
+ # universe (usually the default "googleapis.com" universe).
889
+ # @return [::String,nil]
866
890
  #
867
891
  class Configuration
868
892
  extend ::Gapic::Config
869
893
 
894
+ # @private
895
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
870
896
  DEFAULT_ENDPOINT = "compute.googleapis.com"
871
897
 
872
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
898
+ config_attr :endpoint, nil, ::String, nil
873
899
  config_attr :credentials, nil do |value|
874
900
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
875
901
  allowed.any? { |klass| klass === value }
@@ -881,6 +907,7 @@ module Google
881
907
  config_attr :metadata, nil, ::Hash, nil
882
908
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
883
909
  config_attr :quota_project, nil, ::String, nil
910
+ config_attr :universe_domain, nil, ::String, nil
884
911
 
885
912
  # @private
886
913
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the aggregated_list REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The Subnetworks API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :subnetworks_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
+ @subnetworks_stub.universe_domain
143
+ end
144
+
133
145
  ##
134
146
  # Create a new Subnetworks 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
- @subnetworks_stub = ::Google::Cloud::Compute::V1::Subnetworks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
191
+ @subnetworks_stub = ::Google::Cloud::Compute::V1::Subnetworks::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
  ##
@@ -1295,9 +1314,9 @@ module Google
1295
1314
  # end
1296
1315
  #
1297
1316
  # @!attribute [rw] endpoint
1298
- # The hostname or hostname:port of the service endpoint.
1299
- # Defaults to `"compute.googleapis.com"`.
1300
- # @return [::String]
1317
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1318
+ # nil, indicating to use the default endpoint in the current universe domain.
1319
+ # @return [::String,nil]
1301
1320
  # @!attribute [rw] credentials
1302
1321
  # Credentials to send with calls. You may provide any of the following types:
1303
1322
  # * (`String`) The path to a service account key file in JSON format
@@ -1334,13 +1353,20 @@ module Google
1334
1353
  # @!attribute [rw] quota_project
1335
1354
  # A separate project against which to charge quota.
1336
1355
  # @return [::String]
1356
+ # @!attribute [rw] universe_domain
1357
+ # The universe domain within which to make requests. This determines the
1358
+ # default endpoint URL. The default value of nil uses the environment
1359
+ # universe (usually the default "googleapis.com" universe).
1360
+ # @return [::String,nil]
1337
1361
  #
1338
1362
  class Configuration
1339
1363
  extend ::Gapic::Config
1340
1364
 
1365
+ # @private
1366
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1341
1367
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1342
1368
 
1343
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1369
+ config_attr :endpoint, nil, ::String, nil
1344
1370
  config_attr :credentials, nil do |value|
1345
1371
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1346
1372
  allowed.any? { |klass| klass === value }
@@ -1352,6 +1378,7 @@ module Google
1352
1378
  config_attr :metadata, nil, ::Hash, nil
1353
1379
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1354
1380
  config_attr :quota_project, nil, ::String, nil
1381
+ config_attr :universe_domain, nil, ::String, nil
1355
1382
 
1356
1383
  # @private
1357
1384
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the aggregated_list REST call
45
66
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The TargetGrpcProxies API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :target_grpc_proxies_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
+ @target_grpc_proxies_stub.universe_domain
120
+ end
121
+
110
122
  ##
111
123
  # Create a new TargetGrpcProxies 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
- @target_grpc_proxies_stub = ::Google::Cloud::Compute::V1::TargetGrpcProxies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
168
+ @target_grpc_proxies_stub = ::Google::Cloud::Compute::V1::TargetGrpcProxies::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
@@ -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 TargetHttpProxies API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :target_http_proxies_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
+ @target_http_proxies_stub.universe_domain
127
+ end
128
+
117
129
  ##
118
130
  # Create a new TargetHttpProxies 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
- @target_http_proxies_stub = ::Google::Cloud::Compute::V1::TargetHttpProxies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
175
+ @target_http_proxies_stub = ::Google::Cloud::Compute::V1::TargetHttpProxies::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