Skip to content

Commit b7949d7

Browse files
feat: Update Compute Engine v1 API to revision 20251031 (#32244)
* feat: Update Compute Engine v1 API to revision 20251031 Source-Link: googleapis/googleapis@4667f02 Source-Link: googleapis/googleapis-gen@b96cd54 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNvbXB1dGUvLk93bEJvdC55YW1sIiwiaCI6ImI5NmNkNTQwMDM0ZWUxMDRkOTc5ZDFkOTRkZDM4OTZmNzY3Y2JkYTMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent b0cf964 commit b7949d7

2 files changed

Lines changed: 219 additions & 0 deletions

File tree

google-cloud-compute/lib/google/cloud/compute.rb

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,69 @@ def self.backend_services_available? version: :v1
361361
false
362362
end
363363

364+
##
365+
# Create a new client object for CrossSiteNetworks.
366+
#
367+
# By default, this returns an instance of
368+
# [Google::Cloud::Compute::V1::CrossSiteNetworks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-CrossSiteNetworks-Rest-Client)
369+
# for a REST client for version V1 of the API.
370+
# However, you can specify a different API version by passing it in the
371+
# `version` parameter. If the CrossSiteNetworks service is
372+
# supported by that API version, and the corresponding gem is available, the
373+
# appropriate versioned client will be returned.
374+
#
375+
# Raises an exception if the currently installed versioned client gem for the
376+
# given API version does not support the CrossSiteNetworks service.
377+
# You can determine whether the method will succeed by calling
378+
# {Google::Cloud::Compute.cross_site_networks_available?}.
379+
#
380+
# ## About CrossSiteNetworks
381+
#
382+
# The CrossSiteNetworks API.
383+
#
384+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
385+
# Defaults to `:v1`.
386+
# @return [::Object] A client object for the specified version.
387+
#
388+
def self.cross_site_networks version: :v1, &block
389+
require "google/cloud/compute/#{version.to_s.downcase}"
390+
391+
package_name = Google::Cloud::Compute
392+
.constants
393+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
394+
.first
395+
service_module = Google::Cloud::Compute.const_get(package_name).const_get(:CrossSiteNetworks)
396+
service_module.const_get(:Rest).const_get(:Client).new(&block)
397+
end
398+
399+
##
400+
# Determines whether the CrossSiteNetworks service is supported by the current client.
401+
# If true, you can retrieve a client object by calling {Google::Cloud::Compute.cross_site_networks}.
402+
# If false, that method will raise an exception. This could happen if the given
403+
# API version does not exist or does not support the CrossSiteNetworks service,
404+
# or if the versioned client gem needs an update to support the CrossSiteNetworks service.
405+
#
406+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
407+
# Defaults to `:v1`.
408+
# @return [boolean] Whether the service is available.
409+
#
410+
def self.cross_site_networks_available? version: :v1
411+
require "google/cloud/compute/#{version.to_s.downcase}"
412+
package_name = Google::Cloud::Compute
413+
.constants
414+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
415+
.first
416+
return false unless package_name
417+
service_module = Google::Cloud::Compute.const_get package_name
418+
return false unless service_module.const_defined? :CrossSiteNetworks
419+
service_module = service_module.const_get :CrossSiteNetworks
420+
return false unless service_module.const_defined? :Rest
421+
service_module = service_module.const_get :Rest
422+
service_module.const_defined? :Client
423+
rescue ::LoadError
424+
false
425+
end
426+
364427
##
365428
# Create a new client object for DiskTypes.
366429
#
@@ -739,6 +802,69 @@ def self.forwarding_rules_available? version: :v1
739802
false
740803
end
741804

805+
##
806+
# Create a new client object for FutureReservations.
807+
#
808+
# By default, this returns an instance of
809+
# [Google::Cloud::Compute::V1::FutureReservations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-FutureReservations-Rest-Client)
810+
# for a REST client for version V1 of the API.
811+
# However, you can specify a different API version by passing it in the
812+
# `version` parameter. If the FutureReservations service is
813+
# supported by that API version, and the corresponding gem is available, the
814+
# appropriate versioned client will be returned.
815+
#
816+
# Raises an exception if the currently installed versioned client gem for the
817+
# given API version does not support the FutureReservations service.
818+
# You can determine whether the method will succeed by calling
819+
# {Google::Cloud::Compute.future_reservations_available?}.
820+
#
821+
# ## About FutureReservations
822+
#
823+
# The FutureReservations API.
824+
#
825+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
826+
# Defaults to `:v1`.
827+
# @return [::Object] A client object for the specified version.
828+
#
829+
def self.future_reservations version: :v1, &block
830+
require "google/cloud/compute/#{version.to_s.downcase}"
831+
832+
package_name = Google::Cloud::Compute
833+
.constants
834+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
835+
.first
836+
service_module = Google::Cloud::Compute.const_get(package_name).const_get(:FutureReservations)
837+
service_module.const_get(:Rest).const_get(:Client).new(&block)
838+
end
839+
840+
##
841+
# Determines whether the FutureReservations service is supported by the current client.
842+
# If true, you can retrieve a client object by calling {Google::Cloud::Compute.future_reservations}.
843+
# If false, that method will raise an exception. This could happen if the given
844+
# API version does not exist or does not support the FutureReservations service,
845+
# or if the versioned client gem needs an update to support the FutureReservations service.
846+
#
847+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
848+
# Defaults to `:v1`.
849+
# @return [boolean] Whether the service is available.
850+
#
851+
def self.future_reservations_available? version: :v1
852+
require "google/cloud/compute/#{version.to_s.downcase}"
853+
package_name = Google::Cloud::Compute
854+
.constants
855+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
856+
.first
857+
return false unless package_name
858+
service_module = Google::Cloud::Compute.const_get package_name
859+
return false unless service_module.const_defined? :FutureReservations
860+
service_module = service_module.const_get :FutureReservations
861+
return false unless service_module.const_defined? :Rest
862+
service_module = service_module.const_get :Rest
863+
service_module.const_defined? :Client
864+
rescue ::LoadError
865+
false
866+
end
867+
742868
##
743869
# Create a new client object for GlobalAddresses.
744870
#
@@ -6535,6 +6661,69 @@ def self.vpn_tunnels_available? version: :v1
65356661
false
65366662
end
65376663

6664+
##
6665+
# Create a new client object for WireGroups.
6666+
#
6667+
# By default, this returns an instance of
6668+
# [Google::Cloud::Compute::V1::WireGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-WireGroups-Rest-Client)
6669+
# for a REST client for version V1 of the API.
6670+
# However, you can specify a different API version by passing it in the
6671+
# `version` parameter. If the WireGroups service is
6672+
# supported by that API version, and the corresponding gem is available, the
6673+
# appropriate versioned client will be returned.
6674+
#
6675+
# Raises an exception if the currently installed versioned client gem for the
6676+
# given API version does not support the WireGroups service.
6677+
# You can determine whether the method will succeed by calling
6678+
# {Google::Cloud::Compute.wire_groups_available?}.
6679+
#
6680+
# ## About WireGroups
6681+
#
6682+
# The WireGroups API.
6683+
#
6684+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
6685+
# Defaults to `:v1`.
6686+
# @return [::Object] A client object for the specified version.
6687+
#
6688+
def self.wire_groups version: :v1, &block
6689+
require "google/cloud/compute/#{version.to_s.downcase}"
6690+
6691+
package_name = Google::Cloud::Compute
6692+
.constants
6693+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
6694+
.first
6695+
service_module = Google::Cloud::Compute.const_get(package_name).const_get(:WireGroups)
6696+
service_module.const_get(:Rest).const_get(:Client).new(&block)
6697+
end
6698+
6699+
##
6700+
# Determines whether the WireGroups service is supported by the current client.
6701+
# If true, you can retrieve a client object by calling {Google::Cloud::Compute.wire_groups}.
6702+
# If false, that method will raise an exception. This could happen if the given
6703+
# API version does not exist or does not support the WireGroups service,
6704+
# or if the versioned client gem needs an update to support the WireGroups service.
6705+
#
6706+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
6707+
# Defaults to `:v1`.
6708+
# @return [boolean] Whether the service is available.
6709+
#
6710+
def self.wire_groups_available? version: :v1
6711+
require "google/cloud/compute/#{version.to_s.downcase}"
6712+
package_name = Google::Cloud::Compute
6713+
.constants
6714+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
6715+
.first
6716+
return false unless package_name
6717+
service_module = Google::Cloud::Compute.const_get package_name
6718+
return false unless service_module.const_defined? :WireGroups
6719+
service_module = service_module.const_get :WireGroups
6720+
return false unless service_module.const_defined? :Rest
6721+
service_module = service_module.const_get :Rest
6722+
service_module.const_defined? :Client
6723+
rescue ::LoadError
6724+
false
6725+
end
6726+
65386727
##
65396728
# Create a new client object for ZoneOperations.
65406729
#

google-cloud-compute/test/google/cloud/compute/client_test.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ def test_backend_services_rest
9090
end
9191
end
9292

93+
def test_cross_site_networks_rest
94+
skip unless Google::Cloud::Compute.cross_site_networks_available?
95+
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
96+
client = Google::Cloud::Compute.cross_site_networks do |config|
97+
config.credentials = :dummy_credentials
98+
end
99+
assert_kind_of Google::Cloud::Compute::V1::CrossSiteNetworks::Rest::Client, client
100+
end
101+
end
102+
93103
def test_disk_types_rest
94104
skip unless Google::Cloud::Compute.disk_types_available?
95105
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
@@ -150,6 +160,16 @@ def test_forwarding_rules_rest
150160
end
151161
end
152162

163+
def test_future_reservations_rest
164+
skip unless Google::Cloud::Compute.future_reservations_available?
165+
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
166+
client = Google::Cloud::Compute.future_reservations do |config|
167+
config.credentials = :dummy_credentials
168+
end
169+
assert_kind_of Google::Cloud::Compute::V1::FutureReservations::Rest::Client, client
170+
end
171+
end
172+
153173
def test_global_addresses_rest
154174
skip unless Google::Cloud::Compute.global_addresses_available?
155175
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
@@ -1070,6 +1090,16 @@ def test_vpn_tunnels_rest
10701090
end
10711091
end
10721092

1093+
def test_wire_groups_rest
1094+
skip unless Google::Cloud::Compute.wire_groups_available?
1095+
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
1096+
client = Google::Cloud::Compute.wire_groups do |config|
1097+
config.credentials = :dummy_credentials
1098+
end
1099+
assert_kind_of Google::Cloud::Compute::V1::WireGroups::Rest::Client, client
1100+
end
1101+
end
1102+
10731103
def test_zone_operations_rest
10741104
skip unless Google::Cloud::Compute.zone_operations_available?
10751105
Gapic::Rest::ClientStub.stub :new, DummyStub.new do

0 commit comments

Comments
 (0)