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 RegionInstanceTemplates API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_instance_templates_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
+ @region_instance_templates_stub.universe_domain
118
+ end
119
+
108
120
  ##
109
121
  # Create a new RegionInstanceTemplates 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
- @region_instance_templates_stub = ::Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
166
+ @region_instance_templates_stub = ::Google::Cloud::Compute::V1::RegionInstanceTemplates::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
  ##
@@ -550,9 +569,9 @@ module Google
550
569
  # end
551
570
  #
552
571
  # @!attribute [rw] endpoint
553
- # The hostname or hostname:port of the service endpoint.
554
- # Defaults to `"compute.googleapis.com"`.
555
- # @return [::String]
572
+ # A custom service endpoint, as a hostname or hostname:port. The default is
573
+ # nil, indicating to use the default endpoint in the current universe domain.
574
+ # @return [::String,nil]
556
575
  # @!attribute [rw] credentials
557
576
  # Credentials to send with calls. You may provide any of the following types:
558
577
  # * (`String`) The path to a service account key file in JSON format
@@ -589,13 +608,20 @@ module Google
589
608
  # @!attribute [rw] quota_project
590
609
  # A separate project against which to charge quota.
591
610
  # @return [::String]
611
+ # @!attribute [rw] universe_domain
612
+ # The universe domain within which to make requests. This determines the
613
+ # default endpoint URL. The default value of nil uses the environment
614
+ # universe (usually the default "googleapis.com" universe).
615
+ # @return [::String,nil]
592
616
  #
593
617
  class Configuration
594
618
  extend ::Gapic::Config
595
619
 
620
+ # @private
621
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
596
622
  DEFAULT_ENDPOINT = "compute.googleapis.com"
597
623
 
598
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
624
+ config_attr :endpoint, nil, ::String, nil
599
625
  config_attr :credentials, nil do |value|
600
626
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
601
627
  allowed.any? { |klass| klass === value }
@@ -607,6 +633,7 @@ module Google
607
633
  config_attr :metadata, nil, ::Hash, nil
608
634
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
609
635
  config_attr :quota_project, nil, ::String, nil
636
+ config_attr :universe_domain, nil, ::String, nil
610
637
 
611
638
  # @private
612
639
  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 RegionInstances API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_instances_stub
38
41
 
@@ -93,6 +96,15 @@ module Google
93
96
  @config
94
97
  end
95
98
 
99
+ ##
100
+ # The effective universe domain
101
+ #
102
+ # @return [String]
103
+ #
104
+ def universe_domain
105
+ @region_instances_stub.universe_domain
106
+ end
107
+
96
108
  ##
97
109
  # Create a new RegionInstances REST client object.
98
110
  #
@@ -120,8 +132,9 @@ module Google
120
132
  credentials = @config.credentials
121
133
  # Use self-signed JWT if the endpoint is unchanged from default,
122
134
  # but only if the default endpoint does not have a region prefix.
123
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
124
- !@config.endpoint.split(".").first.include?("-")
135
+ enable_self_signed_jwt = @config.endpoint.nil? ||
136
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
137
+ !@config.endpoint.split(".").first.include?("-"))
125
138
  credentials ||= Credentials.default scope: @config.scope,
126
139
  enable_self_signed_jwt: enable_self_signed_jwt
127
140
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -135,9 +148,15 @@ module Google
135
148
  config.credentials = credentials
136
149
  config.quota_project = @quota_project_id
137
150
  config.endpoint = @config.endpoint
151
+ config.universe_domain = @config.universe_domain
138
152
  end
139
153
 
140
- @region_instances_stub = ::Google::Cloud::Compute::V1::RegionInstances::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
154
+ @region_instances_stub = ::Google::Cloud::Compute::V1::RegionInstances::Rest::ServiceStub.new(
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ credentials: credentials
159
+ )
141
160
  end
142
161
 
143
162
  ##
@@ -272,9 +291,9 @@ module Google
272
291
  # end
273
292
  #
274
293
  # @!attribute [rw] endpoint
275
- # The hostname or hostname:port of the service endpoint.
276
- # Defaults to `"compute.googleapis.com"`.
277
- # @return [::String]
294
+ # A custom service endpoint, as a hostname or hostname:port. The default is
295
+ # nil, indicating to use the default endpoint in the current universe domain.
296
+ # @return [::String,nil]
278
297
  # @!attribute [rw] credentials
279
298
  # Credentials to send with calls. You may provide any of the following types:
280
299
  # * (`String`) The path to a service account key file in JSON format
@@ -311,13 +330,20 @@ module Google
311
330
  # @!attribute [rw] quota_project
312
331
  # A separate project against which to charge quota.
313
332
  # @return [::String]
333
+ # @!attribute [rw] universe_domain
334
+ # The universe domain within which to make requests. This determines the
335
+ # default endpoint URL. The default value of nil uses the environment
336
+ # universe (usually the default "googleapis.com" universe).
337
+ # @return [::String,nil]
314
338
  #
315
339
  class Configuration
316
340
  extend ::Gapic::Config
317
341
 
342
+ # @private
343
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
318
344
  DEFAULT_ENDPOINT = "compute.googleapis.com"
319
345
 
320
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
346
+ config_attr :endpoint, nil, ::String, nil
321
347
  config_attr :credentials, nil do |value|
322
348
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
323
349
  allowed.any? { |klass| klass === value }
@@ -329,6 +355,7 @@ module Google
329
355
  config_attr :metadata, nil, ::Hash, nil
330
356
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
331
357
  config_attr :quota_project, nil, ::String, nil
358
+ config_attr :universe_domain, nil, ::String, nil
332
359
 
333
360
  # @private
334
361
  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 bulk_insert REST call
45
57
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The RegionNetworkEndpointGroups API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_network_endpoint_groups_stub
38
41
 
@@ -111,6 +114,15 @@ module Google
111
114
  @config
112
115
  end
113
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @region_network_endpoint_groups_stub.universe_domain
124
+ end
125
+
114
126
  ##
115
127
  # Create a new RegionNetworkEndpointGroups REST client object.
116
128
  #
@@ -138,8 +150,9 @@ module Google
138
150
  credentials = @config.credentials
139
151
  # Use self-signed JWT if the endpoint is unchanged from default,
140
152
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
- !@config.endpoint.split(".").first.include?("-")
153
+ enable_self_signed_jwt = @config.endpoint.nil? ||
154
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-"))
143
156
  credentials ||= Credentials.default scope: @config.scope,
144
157
  enable_self_signed_jwt: enable_self_signed_jwt
145
158
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -153,9 +166,15 @@ module Google
153
166
  config.credentials = credentials
154
167
  config.quota_project = @quota_project_id
155
168
  config.endpoint = @config.endpoint
169
+ config.universe_domain = @config.universe_domain
156
170
  end
157
171
 
158
- @region_network_endpoint_groups_stub = ::Google::Cloud::Compute::V1::RegionNetworkEndpointGroups::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
172
+ @region_network_endpoint_groups_stub = ::Google::Cloud::Compute::V1::RegionNetworkEndpointGroups::Rest::ServiceStub.new(
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
176
+ credentials: credentials
177
+ )
159
178
  end
160
179
 
161
180
  ##
@@ -839,9 +858,9 @@ module Google
839
858
  # end
840
859
  #
841
860
  # @!attribute [rw] endpoint
842
- # The hostname or hostname:port of the service endpoint.
843
- # Defaults to `"compute.googleapis.com"`.
844
- # @return [::String]
861
+ # A custom service endpoint, as a hostname or hostname:port. The default is
862
+ # nil, indicating to use the default endpoint in the current universe domain.
863
+ # @return [::String,nil]
845
864
  # @!attribute [rw] credentials
846
865
  # Credentials to send with calls. You may provide any of the following types:
847
866
  # * (`String`) The path to a service account key file in JSON format
@@ -878,13 +897,20 @@ module Google
878
897
  # @!attribute [rw] quota_project
879
898
  # A separate project against which to charge quota.
880
899
  # @return [::String]
900
+ # @!attribute [rw] universe_domain
901
+ # The universe domain within which to make requests. This determines the
902
+ # default endpoint URL. The default value of nil uses the environment
903
+ # universe (usually the default "googleapis.com" universe).
904
+ # @return [::String,nil]
881
905
  #
882
906
  class Configuration
883
907
  extend ::Gapic::Config
884
908
 
909
+ # @private
910
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
885
911
  DEFAULT_ENDPOINT = "compute.googleapis.com"
886
912
 
887
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
913
+ config_attr :endpoint, nil, ::String, nil
888
914
  config_attr :credentials, nil do |value|
889
915
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
890
916
  allowed.any? { |klass| klass === value }
@@ -896,6 +922,7 @@ module Google
896
922
  config_attr :metadata, nil, ::Hash, nil
897
923
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
898
924
  config_attr :quota_project, nil, ::String, nil
925
+ config_attr :universe_domain, nil, ::String, nil
899
926
 
900
927
  # @private
901
928
  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 attach_network_endpoints REST call
45
57
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The RegionNetworkFirewallPolicies API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_network_firewall_policies_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
+ @region_network_firewall_policies_stub.universe_domain
156
+ end
157
+
146
158
  ##
147
159
  # Create a new RegionNetworkFirewallPolicies 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
- @region_network_firewall_policies_stub = ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
204
+ @region_network_firewall_policies_stub = ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::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
  ##
@@ -1763,9 +1782,9 @@ module Google
1763
1782
  # end
1764
1783
  #
1765
1784
  # @!attribute [rw] endpoint
1766
- # The hostname or hostname:port of the service endpoint.
1767
- # Defaults to `"compute.googleapis.com"`.
1768
- # @return [::String]
1785
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1786
+ # nil, indicating to use the default endpoint in the current universe domain.
1787
+ # @return [::String,nil]
1769
1788
  # @!attribute [rw] credentials
1770
1789
  # Credentials to send with calls. You may provide any of the following types:
1771
1790
  # * (`String`) The path to a service account key file in JSON format
@@ -1802,13 +1821,20 @@ module Google
1802
1821
  # @!attribute [rw] quota_project
1803
1822
  # A separate project against which to charge quota.
1804
1823
  # @return [::String]
1824
+ # @!attribute [rw] universe_domain
1825
+ # The universe domain within which to make requests. This determines the
1826
+ # default endpoint URL. The default value of nil uses the environment
1827
+ # universe (usually the default "googleapis.com" universe).
1828
+ # @return [::String,nil]
1805
1829
  #
1806
1830
  class Configuration
1807
1831
  extend ::Gapic::Config
1808
1832
 
1833
+ # @private
1834
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1809
1835
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1810
1836
 
1811
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1837
+ config_attr :endpoint, nil, ::String, nil
1812
1838
  config_attr :credentials, nil do |value|
1813
1839
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1814
1840
  allowed.any? { |klass| klass === value }
@@ -1820,6 +1846,7 @@ module Google
1820
1846
  config_attr :metadata, nil, ::Hash, nil
1821
1847
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1822
1848
  config_attr :quota_project, nil, ::String, nil
1849
+ config_attr :universe_domain, nil, ::String, nil
1823
1850
 
1824
1851
  # @private
1825
1852
  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_association REST call
45
57
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The RegionNotificationEndpoints API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :region_notification_endpoints_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
+ @region_notification_endpoints_stub.universe_domain
118
+ end
119
+
108
120
  ##
109
121
  # Create a new RegionNotificationEndpoints 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
- @region_notification_endpoints_stub = ::Google::Cloud::Compute::V1::RegionNotificationEndpoints::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
166
+ @region_notification_endpoints_stub = ::Google::Cloud::Compute::V1::RegionNotificationEndpoints::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
  ##
@@ -550,9 +569,9 @@ module Google
550
569
  # end
551
570
  #
552
571
  # @!attribute [rw] endpoint
553
- # The hostname or hostname:port of the service endpoint.
554
- # Defaults to `"compute.googleapis.com"`.
555
- # @return [::String]
572
+ # A custom service endpoint, as a hostname or hostname:port. The default is
573
+ # nil, indicating to use the default endpoint in the current universe domain.
574
+ # @return [::String,nil]
556
575
  # @!attribute [rw] credentials
557
576
  # Credentials to send with calls. You may provide any of the following types:
558
577
  # * (`String`) The path to a service account key file in JSON format
@@ -589,13 +608,20 @@ module Google
589
608
  # @!attribute [rw] quota_project
590
609
  # A separate project against which to charge quota.
591
610
  # @return [::String]
611
+ # @!attribute [rw] universe_domain
612
+ # The universe domain within which to make requests. This determines the
613
+ # default endpoint URL. The default value of nil uses the environment
614
+ # universe (usually the default "googleapis.com" universe).
615
+ # @return [::String,nil]
592
616
  #
593
617
  class Configuration
594
618
  extend ::Gapic::Config
595
619
 
620
+ # @private
621
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
596
622
  DEFAULT_ENDPOINT = "compute.googleapis.com"
597
623
 
598
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
624
+ config_attr :endpoint, nil, ::String, nil
599
625
  config_attr :credentials, nil do |value|
600
626
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
601
627
  allowed.any? { |klass| klass === value }
@@ -607,6 +633,7 @@ module Google
607
633
  config_attr :metadata, nil, ::Hash, nil
608
634
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
609
635
  config_attr :quota_project, nil, ::String, nil
636
+ config_attr :universe_domain, nil, ::String, nil
610
637
 
611
638
  # @private
612
639
  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
  #