Skip to content

Commit 15ee9d4

Browse files
docs: Update README in wrapper libraries (#31309)
* chore: Update README in wrapper libraries PiperOrigin-RevId: 805921945 Source-Link: googleapis/googleapis@d64d4b9 Source-Link: googleapis/googleapis-gen@effc246 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNocm9uaWNsZS8uT3dsQm90LnlhbWwiLCJoIjoiZWZmYzI0NmJmMzA5MDVkYTAwZmFmNzRlYzZmYzY2ZjE2NWM3ZDBjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNsb3VkX2NvbnRyb2xzX3BhcnRuZXIvLk93bEJvdC55YW1sIiwiaCI6ImVmZmMyNDZiZjMwOTA1ZGEwMGZhZjc0ZWM2ZmM2NmYxNjVjN2QwYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNsb3VkX2Rtcy8uT3dsQm90LnlhbWwiLCJoIjoiZWZmYzI0NmJmMzA5MDVkYTAwZmFmNzRlYzZmYzY2ZjE2NWM3ZDBjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNsb3VkX3F1b3Rhcy8uT3dsQm90LnlhbWwiLCJoIjoiZWZmYzI0NmJmMzA5MDVkYTAwZmFmNzRlYzZmYzY2ZjE2NWM3ZDBjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNvbW1lcmNlLWNvbnN1bWVyLXByb2N1cmVtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiJlZmZjMjQ2YmYzMDkwNWRhMDBmYWY3NGVjNmZjNjZmMTY1YzdkMGM3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNvbXB1dGUvLk93bEJvdC55YW1sIiwiaCI6ImVmZmMyNDZiZjMwOTA1ZGEwMGZhZjc0ZWM2ZmM2NmYxNjVjN2QwYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNvbmZpZGVudGlhbF9jb21wdXRpbmcvLk93bEJv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GVjNmZjNjZmMTY1YzdkMGM3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFfY2F0YWxvZy8uT3dsQm90LnlhbWwiLCJoIjoiZWZmYzI0NmJmMzA5MDVkYTAwZmFmNzRlYzZmYzY2ZjE2NWM3ZDBjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFfZnVzaW9uLy5Pd2xCb3QueWFtbCIsImgiOiJlZmZjMjQ2YmYzMDkwNWRhMDBmYWY3NGVjNmZjNjZmMTY1YzdkMGM3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFfbGFiZWxpbmcvLk93bEJvdC55YW1sIiwiaCI6ImVmZmMyNDZiZjMwOTA1ZGEwMGZhZjc0ZWM2ZmM2NmYxNjVjN2QwYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFmbG93Ly5Pd2xCb3QueWFtbCIsImgiOiJlZmZjMjQ2YmYzMDkwNWRhMDBmYWY3NGVjNmZjNjZmMTY1YzdkMGM3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJlZmZjMjQ2YmYzMDkwNWRhMDBmYWY3NGVjNmZjNjZmMTY1YzdkMGM3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiJlZmZjMjQ2YmYzMDkwNWRhMDBmYWY3NGVjNmZjNjZmMTY1YzdkMGM3In0= * 🦉 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 67de247 commit 15ee9d4

3 files changed

Lines changed: 227 additions & 0 deletions

File tree

google-cloud-compute/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ In order to use this library, you first need to go through the following steps:
3434
1. [Enable the API.](https://console.cloud.google.com/apis/library/compute.googleapis.com)
3535
1. [Set up authentication.](AUTHENTICATION.md)
3636

37+
```ruby
38+
require "google/cloud/compute"
39+
40+
client = Google::Cloud::Compute.accelerator_types
41+
request = ::Google::Cloud::Compute::V1::AggregatedListAcceleratorTypesRequest.new # (request fields as keyword arguments...)
42+
response = client.aggregated_list request
43+
```
44+
3745
## Debug Logging
3846

3947
This library comes with opt-in Debug Logging that can help you troubleshoot

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

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,69 @@ def self.instant_snapshots_available? version: :v1
17471747
false
17481748
end
17491749

1750+
##
1751+
# Create a new client object for InterconnectAttachmentGroups.
1752+
#
1753+
# By default, this returns an instance of
1754+
# [Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectAttachmentGroups-Rest-Client)
1755+
# for a REST client for version V1 of the API.
1756+
# However, you can specify a different API version by passing it in the
1757+
# `version` parameter. If the InterconnectAttachmentGroups service is
1758+
# supported by that API version, and the corresponding gem is available, the
1759+
# appropriate versioned client will be returned.
1760+
#
1761+
# Raises an exception if the currently installed versioned client gem for the
1762+
# given API version does not support the InterconnectAttachmentGroups service.
1763+
# You can determine whether the method will succeed by calling
1764+
# {Google::Cloud::Compute.interconnect_attachment_groups_available?}.
1765+
#
1766+
# ## About InterconnectAttachmentGroups
1767+
#
1768+
# The InterconnectAttachmentGroups API.
1769+
#
1770+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
1771+
# Defaults to `:v1`.
1772+
# @return [::Object] A client object for the specified version.
1773+
#
1774+
def self.interconnect_attachment_groups version: :v1, &block
1775+
require "google/cloud/compute/#{version.to_s.downcase}"
1776+
1777+
package_name = Google::Cloud::Compute
1778+
.constants
1779+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
1780+
.first
1781+
service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectAttachmentGroups)
1782+
service_module.const_get(:Rest).const_get(:Client).new(&block)
1783+
end
1784+
1785+
##
1786+
# Determines whether the InterconnectAttachmentGroups service is supported by the current client.
1787+
# If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_attachment_groups}.
1788+
# If false, that method will raise an exception. This could happen if the given
1789+
# API version does not exist or does not support the InterconnectAttachmentGroups service,
1790+
# or if the versioned client gem needs an update to support the InterconnectAttachmentGroups service.
1791+
#
1792+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
1793+
# Defaults to `:v1`.
1794+
# @return [boolean] Whether the service is available.
1795+
#
1796+
def self.interconnect_attachment_groups_available? version: :v1
1797+
require "google/cloud/compute/#{version.to_s.downcase}"
1798+
package_name = Google::Cloud::Compute
1799+
.constants
1800+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
1801+
.first
1802+
return false unless package_name
1803+
service_module = Google::Cloud::Compute.const_get package_name
1804+
return false unless service_module.const_defined? :InterconnectAttachmentGroups
1805+
service_module = service_module.const_get :InterconnectAttachmentGroups
1806+
return false unless service_module.const_defined? :Rest
1807+
service_module = service_module.const_get :Rest
1808+
service_module.const_defined? :Client
1809+
rescue ::LoadError
1810+
false
1811+
end
1812+
17501813
##
17511814
# Create a new client object for InterconnectAttachments.
17521815
#
@@ -1810,6 +1873,69 @@ def self.interconnect_attachments_available? version: :v1
18101873
false
18111874
end
18121875

1876+
##
1877+
# Create a new client object for InterconnectGroups.
1878+
#
1879+
# By default, this returns an instance of
1880+
# [Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectGroups-Rest-Client)
1881+
# for a REST client for version V1 of the API.
1882+
# However, you can specify a different API version by passing it in the
1883+
# `version` parameter. If the InterconnectGroups service is
1884+
# supported by that API version, and the corresponding gem is available, the
1885+
# appropriate versioned client will be returned.
1886+
#
1887+
# Raises an exception if the currently installed versioned client gem for the
1888+
# given API version does not support the InterconnectGroups service.
1889+
# You can determine whether the method will succeed by calling
1890+
# {Google::Cloud::Compute.interconnect_groups_available?}.
1891+
#
1892+
# ## About InterconnectGroups
1893+
#
1894+
# The InterconnectGroups API.
1895+
#
1896+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
1897+
# Defaults to `:v1`.
1898+
# @return [::Object] A client object for the specified version.
1899+
#
1900+
def self.interconnect_groups version: :v1, &block
1901+
require "google/cloud/compute/#{version.to_s.downcase}"
1902+
1903+
package_name = Google::Cloud::Compute
1904+
.constants
1905+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
1906+
.first
1907+
service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectGroups)
1908+
service_module.const_get(:Rest).const_get(:Client).new(&block)
1909+
end
1910+
1911+
##
1912+
# Determines whether the InterconnectGroups service is supported by the current client.
1913+
# If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_groups}.
1914+
# If false, that method will raise an exception. This could happen if the given
1915+
# API version does not exist or does not support the InterconnectGroups service,
1916+
# or if the versioned client gem needs an update to support the InterconnectGroups service.
1917+
#
1918+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
1919+
# Defaults to `:v1`.
1920+
# @return [boolean] Whether the service is available.
1921+
#
1922+
def self.interconnect_groups_available? version: :v1
1923+
require "google/cloud/compute/#{version.to_s.downcase}"
1924+
package_name = Google::Cloud::Compute
1925+
.constants
1926+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
1927+
.first
1928+
return false unless package_name
1929+
service_module = Google::Cloud::Compute.const_get package_name
1930+
return false unless service_module.const_defined? :InterconnectGroups
1931+
service_module = service_module.const_get :InterconnectGroups
1932+
return false unless service_module.const_defined? :Rest
1933+
service_module = service_module.const_get :Rest
1934+
service_module.const_defined? :Client
1935+
rescue ::LoadError
1936+
false
1937+
end
1938+
18131939
##
18141940
# Create a new client object for InterconnectLocations.
18151941
#
@@ -4708,6 +4834,69 @@ def self.reservation_blocks_available? version: :v1
47084834
false
47094835
end
47104836

4837+
##
4838+
# Create a new client object for ReservationSubBlocks.
4839+
#
4840+
# By default, this returns an instance of
4841+
# [Google::Cloud::Compute::V1::ReservationSubBlocks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationSubBlocks-Rest-Client)
4842+
# for a REST client for version V1 of the API.
4843+
# However, you can specify a different API version by passing it in the
4844+
# `version` parameter. If the ReservationSubBlocks service is
4845+
# supported by that API version, and the corresponding gem is available, the
4846+
# appropriate versioned client will be returned.
4847+
#
4848+
# Raises an exception if the currently installed versioned client gem for the
4849+
# given API version does not support the ReservationSubBlocks service.
4850+
# You can determine whether the method will succeed by calling
4851+
# {Google::Cloud::Compute.reservation_sub_blocks_available?}.
4852+
#
4853+
# ## About ReservationSubBlocks
4854+
#
4855+
# The ReservationSubBlocks API.
4856+
#
4857+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
4858+
# Defaults to `:v1`.
4859+
# @return [::Object] A client object for the specified version.
4860+
#
4861+
def self.reservation_sub_blocks version: :v1, &block
4862+
require "google/cloud/compute/#{version.to_s.downcase}"
4863+
4864+
package_name = Google::Cloud::Compute
4865+
.constants
4866+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
4867+
.first
4868+
service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationSubBlocks)
4869+
service_module.const_get(:Rest).const_get(:Client).new(&block)
4870+
end
4871+
4872+
##
4873+
# Determines whether the ReservationSubBlocks service is supported by the current client.
4874+
# If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_sub_blocks}.
4875+
# If false, that method will raise an exception. This could happen if the given
4876+
# API version does not exist or does not support the ReservationSubBlocks service,
4877+
# or if the versioned client gem needs an update to support the ReservationSubBlocks service.
4878+
#
4879+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
4880+
# Defaults to `:v1`.
4881+
# @return [boolean] Whether the service is available.
4882+
#
4883+
def self.reservation_sub_blocks_available? version: :v1
4884+
require "google/cloud/compute/#{version.to_s.downcase}"
4885+
package_name = Google::Cloud::Compute
4886+
.constants
4887+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
4888+
.first
4889+
return false unless package_name
4890+
service_module = Google::Cloud::Compute.const_get package_name
4891+
return false unless service_module.const_defined? :ReservationSubBlocks
4892+
service_module = service_module.const_get :ReservationSubBlocks
4893+
return false unless service_module.const_defined? :Rest
4894+
service_module = service_module.const_get :Rest
4895+
service_module.const_defined? :Client
4896+
rescue ::LoadError
4897+
false
4898+
end
4899+
47114900
##
47124901
# Create a new client object for Reservations.
47134902
#

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,16 @@ def test_instant_snapshots_rest
310310
end
311311
end
312312

313+
def test_interconnect_attachment_groups_rest
314+
skip unless Google::Cloud::Compute.interconnect_attachment_groups_available?
315+
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
316+
client = Google::Cloud::Compute.interconnect_attachment_groups do |config|
317+
config.credentials = :dummy_credentials
318+
end
319+
assert_kind_of Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client, client
320+
end
321+
end
322+
313323
def test_interconnect_attachments_rest
314324
skip unless Google::Cloud::Compute.interconnect_attachments_available?
315325
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
@@ -320,6 +330,16 @@ def test_interconnect_attachments_rest
320330
end
321331
end
322332

333+
def test_interconnect_groups_rest
334+
skip unless Google::Cloud::Compute.interconnect_groups_available?
335+
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
336+
client = Google::Cloud::Compute.interconnect_groups do |config|
337+
config.credentials = :dummy_credentials
338+
end
339+
assert_kind_of Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client, client
340+
end
341+
end
342+
323343
def test_interconnect_locations_rest
324344
skip unless Google::Cloud::Compute.interconnect_locations_available?
325345
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
@@ -780,6 +800,16 @@ def test_reservation_blocks_rest
780800
end
781801
end
782802

803+
def test_reservation_sub_blocks_rest
804+
skip unless Google::Cloud::Compute.reservation_sub_blocks_available?
805+
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
806+
client = Google::Cloud::Compute.reservation_sub_blocks do |config|
807+
config.credentials = :dummy_credentials
808+
end
809+
assert_kind_of Google::Cloud::Compute::V1::ReservationSubBlocks::Rest::Client, client
810+
end
811+
end
812+
783813
def test_reservations_rest
784814
skip unless Google::Cloud::Compute.reservations_available?
785815
Gapic::Rest::ClientStub.stub :new, DummyStub.new do

0 commit comments

Comments
 (0)