google-cloud-network_connectivity 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2252fe32be8e24fae0a643a9e71c949681671561ab7eec1f9ddd974aa2ccd5d2
|
4
|
+
data.tar.gz: 12350f8883e04ca96a1a81fd2be6a1199b01a911c7f838cddf09f162f8ba3188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99dbb64099b821b531faf94321eda5891cca3a4f45a5ac994d3a10c9eb56882142ec549f190fae227ba3a0c2034312e760740f799b1fdfed7547101dd435de9d
|
7
|
+
data.tar.gz: ae6c4dcd230ad76f1bccb400a0d8d510e73ac8f0516c7eee4496ecd1eed949255e4a27555e935d0932289b11982619af8be5259b608451995a0c2361a736e5c5
|
@@ -106,6 +106,67 @@ module Google
|
|
106
106
|
false
|
107
107
|
end
|
108
108
|
|
109
|
+
##
|
110
|
+
# Create a new client object for DataTransferService.
|
111
|
+
#
|
112
|
+
# By default, this returns an instance of
|
113
|
+
# [Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-DataTransferService-Client)
|
114
|
+
# for a gRPC client for version V1 of the API.
|
115
|
+
# However, you can specify a different API version by passing it in the
|
116
|
+
# `version` parameter. If the DataTransferService service is
|
117
|
+
# supported by that API version, and the corresponding gem is available, the
|
118
|
+
# appropriate versioned client will be returned.
|
119
|
+
#
|
120
|
+
# Raises an exception if the currently installed versioned client gem for the
|
121
|
+
# given API version does not support the DataTransferService service.
|
122
|
+
# You can determine whether the method will succeed by calling
|
123
|
+
# {Google::Cloud::NetworkConnectivity.data_transfer_service_available?}.
|
124
|
+
#
|
125
|
+
# ## About DataTransferService
|
126
|
+
#
|
127
|
+
# DataTransferService is the service for the Data Transfer API.
|
128
|
+
#
|
129
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
130
|
+
# Defaults to `:v1`.
|
131
|
+
# @return [::Object] A client object for the specified version.
|
132
|
+
#
|
133
|
+
def self.data_transfer_service version: :v1, &block
|
134
|
+
require "google/cloud/network_connectivity/#{version.to_s.downcase}"
|
135
|
+
|
136
|
+
package_name = Google::Cloud::NetworkConnectivity
|
137
|
+
.constants
|
138
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
139
|
+
.first
|
140
|
+
service_module = Google::Cloud::NetworkConnectivity.const_get(package_name).const_get(:DataTransferService)
|
141
|
+
service_module.const_get(:Client).new(&block)
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Determines whether the DataTransferService service is supported by the current client.
|
146
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::NetworkConnectivity.data_transfer_service}.
|
147
|
+
# If false, that method will raise an exception. This could happen if the given
|
148
|
+
# API version does not exist or does not support the DataTransferService service,
|
149
|
+
# or if the versioned client gem needs an update to support the DataTransferService service.
|
150
|
+
#
|
151
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
152
|
+
# Defaults to `:v1`.
|
153
|
+
# @return [boolean] Whether the service is available.
|
154
|
+
#
|
155
|
+
def self.data_transfer_service_available? version: :v1
|
156
|
+
require "google/cloud/network_connectivity/#{version.to_s.downcase}"
|
157
|
+
package_name = Google::Cloud::NetworkConnectivity
|
158
|
+
.constants
|
159
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
160
|
+
.first
|
161
|
+
return false unless package_name
|
162
|
+
service_module = Google::Cloud::NetworkConnectivity.const_get package_name
|
163
|
+
return false unless service_module.const_defined? :DataTransferService
|
164
|
+
service_module = service_module.const_get :DataTransferService
|
165
|
+
service_module.const_defined? :Client
|
166
|
+
rescue ::LoadError
|
167
|
+
false
|
168
|
+
end
|
169
|
+
|
109
170
|
##
|
110
171
|
# Create a new client object for HubService.
|
111
172
|
#
|