google-cloud-network_connectivity-v1alpha1 0.1.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.
Files changed (28) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-network_connectivity-v1alpha1.rb +21 -0
  7. data/lib/google/cloud/network_connectivity/v1alpha1.rb +38 -0
  8. data/lib/google/cloud/network_connectivity/v1alpha1/hub_service.rb +52 -0
  9. data/lib/google/cloud/network_connectivity/v1alpha1/hub_service/client.rb +1188 -0
  10. data/lib/google/cloud/network_connectivity/v1alpha1/hub_service/credentials.rb +51 -0
  11. data/lib/google/cloud/network_connectivity/v1alpha1/hub_service/operations.rb +570 -0
  12. data/lib/google/cloud/network_connectivity/v1alpha1/hub_service/paths.rb +143 -0
  13. data/lib/google/cloud/network_connectivity/v1alpha1/version.rb +28 -0
  14. data/lib/google/cloud/networkconnectivity/v1alpha1/common_pb.rb +31 -0
  15. data/lib/google/cloud/networkconnectivity/v1alpha1/hub_pb.rb +126 -0
  16. data/lib/google/cloud/networkconnectivity/v1alpha1/hub_services_pb.rb +65 -0
  17. data/proto_docs/README.md +4 -0
  18. data/proto_docs/google/api/field_behavior.rb +59 -0
  19. data/proto_docs/google/api/resource.rb +283 -0
  20. data/proto_docs/google/cloud/networkconnectivity/v1alpha1/common.rb +56 -0
  21. data/proto_docs/google/cloud/networkconnectivity/v1alpha1/hub.rb +393 -0
  22. data/proto_docs/google/longrunning/operations.rb +150 -0
  23. data/proto_docs/google/protobuf/any.rb +138 -0
  24. data/proto_docs/google/protobuf/empty.rb +36 -0
  25. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  26. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  27. data/proto_docs/google/rpc/status.rb +46 -0
  28. metadata +210 -0
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/network_connectivity/v1alpha1"
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/network_connectivity/v1alpha1/hub_service"
20
+ require "google/cloud/network_connectivity/v1alpha1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module NetworkConnectivity
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/network_connectivity/v1alpha1"
29
+ # client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new
30
+ #
31
+ module V1alpha1
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ helper_path = ::File.join __dir__, "v1alpha1", "_helpers.rb"
38
+ require "google/cloud/network_connectivity/v1alpha1/_helpers" if ::File.file? helper_path
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/network_connectivity/v1alpha1/version"
24
+
25
+ require "google/cloud/network_connectivity/v1alpha1/hub_service/credentials"
26
+ require "google/cloud/network_connectivity/v1alpha1/hub_service/paths"
27
+ require "google/cloud/network_connectivity/v1alpha1/hub_service/operations"
28
+ require "google/cloud/network_connectivity/v1alpha1/hub_service/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module NetworkConnectivity
33
+ module V1alpha1
34
+ ##
35
+ # Connectivity Hub is a hub-and-spoke abstraction for network connectivity
36
+ # management in Google Cloud. The Hub aims to reduce operational complexity
37
+ # through a simple, centralized connectivity management model.
38
+ #
39
+ # To load this service and instantiate a client:
40
+ #
41
+ # require "google/cloud/network_connectivity/v1alpha1/hub_service"
42
+ # client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new
43
+ #
44
+ module HubService
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "hub_service", "helpers.rb"
52
+ require "google/cloud/network_connectivity/v1alpha1/hub_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,1188 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/networkconnectivity/v1alpha1/hub_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module NetworkConnectivity
25
+ module V1alpha1
26
+ module HubService
27
+ ##
28
+ # Client for the HubService service.
29
+ #
30
+ # Connectivity Hub is a hub-and-spoke abstraction for network connectivity
31
+ # management in Google Cloud. The Hub aims to reduce operational complexity
32
+ # through a simple, centralized connectivity management model.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :hub_service_stub
39
+
40
+ ##
41
+ # Configure the HubService Client class.
42
+ #
43
+ # See {::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # ## Example
47
+ #
48
+ # To modify the configuration for all HubService clients:
49
+ #
50
+ # ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "NetworkConnectivity", "V1alpha1"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const&.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.timeout = 60.0
71
+ default_config.retry_policy = {
72
+ initial_delay: 1.0,
73
+ max_delay: 10.0,
74
+ multiplier: 1.3,
75
+ retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.create_hub.timeout = 60.0
79
+
80
+ default_config.rpcs.update_hub.timeout = 60.0
81
+
82
+ default_config.rpcs.delete_hub.timeout = 60.0
83
+
84
+ default_config.rpcs.create_spoke.timeout = 60.0
85
+
86
+ default_config.rpcs.update_spoke.timeout = 60.0
87
+
88
+ default_config.rpcs.delete_spoke.timeout = 60.0
89
+
90
+ default_config
91
+ end
92
+ yield @configure if block_given?
93
+ @configure
94
+ end
95
+
96
+ ##
97
+ # Configure the HubService Client instance.
98
+ #
99
+ # The configuration is set to the derived mode, meaning that values can be changed,
100
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
101
+ # should be made on {Client.configure}.
102
+ #
103
+ # See {::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client::Configuration}
104
+ # for a description of the configuration fields.
105
+ #
106
+ # @yield [config] Configure the Client client.
107
+ # @yieldparam config [Client::Configuration]
108
+ #
109
+ # @return [Client::Configuration]
110
+ #
111
+ def configure
112
+ yield @config if block_given?
113
+ @config
114
+ end
115
+
116
+ ##
117
+ # Create a new HubService client object.
118
+ #
119
+ # ## Examples
120
+ #
121
+ # To create a new HubService client with the default
122
+ # configuration:
123
+ #
124
+ # client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new
125
+ #
126
+ # To create a new HubService client with a custom
127
+ # configuration:
128
+ #
129
+ # client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config|
130
+ # config.timeout = 10.0
131
+ # end
132
+ #
133
+ # @yield [config] Configure the HubService client.
134
+ # @yieldparam config [Client::Configuration]
135
+ #
136
+ def initialize
137
+ # These require statements are intentionally placed here to initialize
138
+ # the gRPC module only when it's required.
139
+ # See https://github.com/googleapis/toolkit/issues/446
140
+ require "gapic/grpc"
141
+ require "google/cloud/networkconnectivity/v1alpha1/hub_services_pb"
142
+
143
+ # Create the configuration object
144
+ @config = Configuration.new Client.configure
145
+
146
+ # Yield the configuration if needed
147
+ yield @config if block_given?
148
+
149
+ # Create credentials
150
+ credentials = @config.credentials
151
+ credentials ||= Credentials.default scope: @config.scope
152
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @operations_client = Operations.new do |config|
159
+ config.credentials = credentials
160
+ config.endpoint = @config.endpoint
161
+ end
162
+
163
+ @hub_service_stub = ::Gapic::ServiceStub.new(
164
+ ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Stub,
165
+ credentials: credentials,
166
+ endpoint: @config.endpoint,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors
169
+ )
170
+ end
171
+
172
+ ##
173
+ # Get the associated client for long-running operations.
174
+ #
175
+ # @return [::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Operations]
176
+ #
177
+ attr_reader :operations_client
178
+
179
+ # Service calls
180
+
181
+ ##
182
+ # Lists Hubs in a given project and location.
183
+ #
184
+ # @overload list_hubs(request, options = nil)
185
+ # Pass arguments to `list_hubs` via a request object, either of type
186
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::ListHubsRequest} or an equivalent Hash.
187
+ #
188
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::ListHubsRequest, ::Hash]
189
+ # A request object representing the call parameters. Required. To specify no
190
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
191
+ # @param options [::Gapic::CallOptions, ::Hash]
192
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
193
+ #
194
+ # @overload list_hubs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
195
+ # Pass arguments to `list_hubs` via keyword arguments. Note that at
196
+ # least one keyword argument is required. To specify no parameters, or to keep all
197
+ # the default parameter values, pass an empty Hash as a request object (see above).
198
+ #
199
+ # @param parent [::String]
200
+ # Required. The parent resource's name.
201
+ # @param page_size [::Integer]
202
+ # The maximum number of results per page that should be returned.
203
+ # @param page_token [::String]
204
+ # The page token.
205
+ # @param filter [::String]
206
+ # A filter expression that filters the results listed in the response.
207
+ # @param order_by [::String]
208
+ # Sort the results by a certain order.
209
+ #
210
+ # @yield [response, operation] Access the result along with the RPC operation
211
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Hub>]
212
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
213
+ #
214
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Hub>]
215
+ #
216
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
+ #
218
+ def list_hubs request, options = nil
219
+ raise ::ArgumentError, "request must be provided" if request.nil?
220
+
221
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::ListHubsRequest
222
+
223
+ # Converts hash and nil to an options object
224
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
225
+
226
+ # Customize the options with defaults
227
+ metadata = @config.rpcs.list_hubs.metadata.to_h
228
+
229
+ # Set x-goog-api-client and x-goog-user-project headers
230
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
231
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
232
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
233
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
+
235
+ header_params = {
236
+ "parent" => request.parent
237
+ }
238
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
+ metadata[:"x-goog-request-params"] ||= request_params_header
240
+
241
+ options.apply_defaults timeout: @config.rpcs.list_hubs.timeout,
242
+ metadata: metadata,
243
+ retry_policy: @config.rpcs.list_hubs.retry_policy
244
+ options.apply_defaults metadata: @config.metadata,
245
+ retry_policy: @config.retry_policy
246
+
247
+ @hub_service_stub.call_rpc :list_hubs, request, options: options do |response, operation|
248
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hubs, request, response, operation, options
249
+ yield response, operation if block_given?
250
+ return response
251
+ end
252
+ rescue ::GRPC::BadStatus => e
253
+ raise ::Google::Cloud::Error.from_error(e)
254
+ end
255
+
256
+ ##
257
+ # Gets details of a single Hub.
258
+ #
259
+ # @overload get_hub(request, options = nil)
260
+ # Pass arguments to `get_hub` via a request object, either of type
261
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::GetHubRequest} or an equivalent Hash.
262
+ #
263
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::GetHubRequest, ::Hash]
264
+ # A request object representing the call parameters. Required. To specify no
265
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
266
+ # @param options [::Gapic::CallOptions, ::Hash]
267
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
268
+ #
269
+ # @overload get_hub(name: nil)
270
+ # Pass arguments to `get_hub` via keyword arguments. Note that at
271
+ # least one keyword argument is required. To specify no parameters, or to keep all
272
+ # the default parameter values, pass an empty Hash as a request object (see above).
273
+ #
274
+ # @param name [::String]
275
+ # Required. Name of the Hub resource to get.
276
+ #
277
+ # @yield [response, operation] Access the result along with the RPC operation
278
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1alpha1::Hub]
279
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
280
+ #
281
+ # @return [::Google::Cloud::NetworkConnectivity::V1alpha1::Hub]
282
+ #
283
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
284
+ #
285
+ def get_hub request, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request.nil?
287
+
288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::GetHubRequest
289
+
290
+ # Converts hash and nil to an options object
291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
292
+
293
+ # Customize the options with defaults
294
+ metadata = @config.rpcs.get_hub.metadata.to_h
295
+
296
+ # Set x-goog-api-client and x-goog-user-project headers
297
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
299
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
300
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
301
+
302
+ header_params = {
303
+ "name" => request.name
304
+ }
305
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
306
+ metadata[:"x-goog-request-params"] ||= request_params_header
307
+
308
+ options.apply_defaults timeout: @config.rpcs.get_hub.timeout,
309
+ metadata: metadata,
310
+ retry_policy: @config.rpcs.get_hub.retry_policy
311
+ options.apply_defaults metadata: @config.metadata,
312
+ retry_policy: @config.retry_policy
313
+
314
+ @hub_service_stub.call_rpc :get_hub, request, options: options do |response, operation|
315
+ yield response, operation if block_given?
316
+ return response
317
+ end
318
+ rescue ::GRPC::BadStatus => e
319
+ raise ::Google::Cloud::Error.from_error(e)
320
+ end
321
+
322
+ ##
323
+ # Creates a new Hub in a given project and location.
324
+ #
325
+ # @overload create_hub(request, options = nil)
326
+ # Pass arguments to `create_hub` via a request object, either of type
327
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::CreateHubRequest} or an equivalent Hash.
328
+ #
329
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::CreateHubRequest, ::Hash]
330
+ # A request object representing the call parameters. Required. To specify no
331
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
332
+ # @param options [::Gapic::CallOptions, ::Hash]
333
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
334
+ #
335
+ # @overload create_hub(parent: nil, hub_id: nil, hub: nil, request_id: nil)
336
+ # Pass arguments to `create_hub` via keyword arguments. Note that at
337
+ # least one keyword argument is required. To specify no parameters, or to keep all
338
+ # the default parameter values, pass an empty Hash as a request object (see above).
339
+ #
340
+ # @param parent [::String]
341
+ # Required. The parent resource's name of the Hub.
342
+ # @param hub_id [::String]
343
+ # Optional. Unique id for the Hub to create.
344
+ # @param hub [::Google::Cloud::NetworkConnectivity::V1alpha1::Hub, ::Hash]
345
+ # Required. Initial values for a new Hub.
346
+ # @param request_id [::String]
347
+ # Optional. An optional request ID to identify requests. Specify a unique request ID
348
+ # so that if you must retry your request, the server will know to ignore
349
+ # the request if it has already been completed. The server will guarantee
350
+ # that for at least 60 minutes since the first request.
351
+ #
352
+ # For example, consider a situation where you make an initial request and t
353
+ # he request times out. If you make the request again with the same request
354
+ # ID, the server can check if original operation with the same request ID
355
+ # was received, and if so, will ignore the second request. This prevents
356
+ # clients from accidentally creating duplicate commitments.
357
+ #
358
+ # The request ID must be a valid UUID with the exception that zero UUID is
359
+ # not supported (00000000-0000-0000-0000-000000000000).
360
+ #
361
+ # @yield [response, operation] Access the result along with the RPC operation
362
+ # @yieldparam response [::Gapic::Operation]
363
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
364
+ #
365
+ # @return [::Gapic::Operation]
366
+ #
367
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
368
+ #
369
+ def create_hub request, options = nil
370
+ raise ::ArgumentError, "request must be provided" if request.nil?
371
+
372
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::CreateHubRequest
373
+
374
+ # Converts hash and nil to an options object
375
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
376
+
377
+ # Customize the options with defaults
378
+ metadata = @config.rpcs.create_hub.metadata.to_h
379
+
380
+ # Set x-goog-api-client and x-goog-user-project headers
381
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
382
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
383
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
384
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
385
+
386
+ header_params = {
387
+ "parent" => request.parent
388
+ }
389
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
390
+ metadata[:"x-goog-request-params"] ||= request_params_header
391
+
392
+ options.apply_defaults timeout: @config.rpcs.create_hub.timeout,
393
+ metadata: metadata,
394
+ retry_policy: @config.rpcs.create_hub.retry_policy
395
+ options.apply_defaults metadata: @config.metadata,
396
+ retry_policy: @config.retry_policy
397
+
398
+ @hub_service_stub.call_rpc :create_hub, request, options: options do |response, operation|
399
+ response = ::Gapic::Operation.new response, @operations_client, options: options
400
+ yield response, operation if block_given?
401
+ return response
402
+ end
403
+ rescue ::GRPC::BadStatus => e
404
+ raise ::Google::Cloud::Error.from_error(e)
405
+ end
406
+
407
+ ##
408
+ # Updates the parameters of a single Hub.
409
+ #
410
+ # @overload update_hub(request, options = nil)
411
+ # Pass arguments to `update_hub` via a request object, either of type
412
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateHubRequest} or an equivalent Hash.
413
+ #
414
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateHubRequest, ::Hash]
415
+ # A request object representing the call parameters. Required. To specify no
416
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
417
+ # @param options [::Gapic::CallOptions, ::Hash]
418
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
419
+ #
420
+ # @overload update_hub(update_mask: nil, hub: nil, request_id: nil)
421
+ # Pass arguments to `update_hub` via keyword arguments. Note that at
422
+ # least one keyword argument is required. To specify no parameters, or to keep all
423
+ # the default parameter values, pass an empty Hash as a request object (see above).
424
+ #
425
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
426
+ # Optional. Field mask is used to specify the fields to be overwritten in the
427
+ # Hub resource by the update.
428
+ # The fields specified in the update_mask are relative to the resource, not
429
+ # the full request. A field will be overwritten if it is in the mask. If the
430
+ # user does not provide a mask then all fields will be overwritten.
431
+ # @param hub [::Google::Cloud::NetworkConnectivity::V1alpha1::Hub, ::Hash]
432
+ # Required. The state that the Hub should be in after the update.
433
+ # @param request_id [::String]
434
+ # Optional. An optional request ID to identify requests. Specify a unique request ID
435
+ # so that if you must retry your request, the server will know to ignore
436
+ # the request if it has already been completed. The server will guarantee
437
+ # that for at least 60 minutes since the first request.
438
+ #
439
+ # For example, consider a situation where you make an initial request and t
440
+ # he request times out. If you make the request again with the same request
441
+ # ID, the server can check if original operation with the same request ID
442
+ # was received, and if so, will ignore the second request. This prevents
443
+ # clients from accidentally creating duplicate commitments.
444
+ #
445
+ # The request ID must be a valid UUID with the exception that zero UUID is
446
+ # not supported (00000000-0000-0000-0000-000000000000).
447
+ #
448
+ # @yield [response, operation] Access the result along with the RPC operation
449
+ # @yieldparam response [::Gapic::Operation]
450
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
451
+ #
452
+ # @return [::Gapic::Operation]
453
+ #
454
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
455
+ #
456
+ def update_hub request, options = nil
457
+ raise ::ArgumentError, "request must be provided" if request.nil?
458
+
459
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateHubRequest
460
+
461
+ # Converts hash and nil to an options object
462
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
463
+
464
+ # Customize the options with defaults
465
+ metadata = @config.rpcs.update_hub.metadata.to_h
466
+
467
+ # Set x-goog-api-client and x-goog-user-project headers
468
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
469
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
470
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
471
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
472
+
473
+ header_params = {
474
+ "hub.name" => request.hub.name
475
+ }
476
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
477
+ metadata[:"x-goog-request-params"] ||= request_params_header
478
+
479
+ options.apply_defaults timeout: @config.rpcs.update_hub.timeout,
480
+ metadata: metadata,
481
+ retry_policy: @config.rpcs.update_hub.retry_policy
482
+ options.apply_defaults metadata: @config.metadata,
483
+ retry_policy: @config.retry_policy
484
+
485
+ @hub_service_stub.call_rpc :update_hub, request, options: options do |response, operation|
486
+ response = ::Gapic::Operation.new response, @operations_client, options: options
487
+ yield response, operation if block_given?
488
+ return response
489
+ end
490
+ rescue ::GRPC::BadStatus => e
491
+ raise ::Google::Cloud::Error.from_error(e)
492
+ end
493
+
494
+ ##
495
+ # Deletes a single Hub.
496
+ #
497
+ # @overload delete_hub(request, options = nil)
498
+ # Pass arguments to `delete_hub` via a request object, either of type
499
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteHubRequest} or an equivalent Hash.
500
+ #
501
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteHubRequest, ::Hash]
502
+ # A request object representing the call parameters. Required. To specify no
503
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
504
+ # @param options [::Gapic::CallOptions, ::Hash]
505
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
506
+ #
507
+ # @overload delete_hub(name: nil, request_id: nil)
508
+ # Pass arguments to `delete_hub` via keyword arguments. Note that at
509
+ # least one keyword argument is required. To specify no parameters, or to keep all
510
+ # the default parameter values, pass an empty Hash as a request object (see above).
511
+ #
512
+ # @param name [::String]
513
+ # Required. The name of the Hub to delete.
514
+ # @param request_id [::String]
515
+ # Optional. An optional request ID to identify requests. Specify a unique request ID
516
+ # so that if you must retry your request, the server will know to ignore
517
+ # the request if it has already been completed. The server will guarantee
518
+ # that for at least 60 minutes after the first request.
519
+ #
520
+ # For example, consider a situation where you make an initial request and t
521
+ # he request times out. If you make the request again with the same request
522
+ # ID, the server can check if original operation with the same request ID
523
+ # was received, and if so, will ignore the second request. This prevents
524
+ # clients from accidentally creating duplicate commitments.
525
+ #
526
+ # The request ID must be a valid UUID with the exception that zero UUID is
527
+ # not supported (00000000-0000-0000-0000-000000000000).
528
+ #
529
+ # @yield [response, operation] Access the result along with the RPC operation
530
+ # @yieldparam response [::Gapic::Operation]
531
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
532
+ #
533
+ # @return [::Gapic::Operation]
534
+ #
535
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
536
+ #
537
+ def delete_hub request, options = nil
538
+ raise ::ArgumentError, "request must be provided" if request.nil?
539
+
540
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteHubRequest
541
+
542
+ # Converts hash and nil to an options object
543
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
544
+
545
+ # Customize the options with defaults
546
+ metadata = @config.rpcs.delete_hub.metadata.to_h
547
+
548
+ # Set x-goog-api-client and x-goog-user-project headers
549
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
550
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
551
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
552
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
553
+
554
+ header_params = {
555
+ "name" => request.name
556
+ }
557
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
558
+ metadata[:"x-goog-request-params"] ||= request_params_header
559
+
560
+ options.apply_defaults timeout: @config.rpcs.delete_hub.timeout,
561
+ metadata: metadata,
562
+ retry_policy: @config.rpcs.delete_hub.retry_policy
563
+ options.apply_defaults metadata: @config.metadata,
564
+ retry_policy: @config.retry_policy
565
+
566
+ @hub_service_stub.call_rpc :delete_hub, request, options: options do |response, operation|
567
+ response = ::Gapic::Operation.new response, @operations_client, options: options
568
+ yield response, operation if block_given?
569
+ return response
570
+ end
571
+ rescue ::GRPC::BadStatus => e
572
+ raise ::Google::Cloud::Error.from_error(e)
573
+ end
574
+
575
+ ##
576
+ # Lists Spokes in a given project and location.
577
+ #
578
+ # @overload list_spokes(request, options = nil)
579
+ # Pass arguments to `list_spokes` via a request object, either of type
580
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::ListSpokesRequest} or an equivalent Hash.
581
+ #
582
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::ListSpokesRequest, ::Hash]
583
+ # A request object representing the call parameters. Required. To specify no
584
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
585
+ # @param options [::Gapic::CallOptions, ::Hash]
586
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
587
+ #
588
+ # @overload list_spokes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
589
+ # Pass arguments to `list_spokes` via keyword arguments. Note that at
590
+ # least one keyword argument is required. To specify no parameters, or to keep all
591
+ # the default parameter values, pass an empty Hash as a request object (see above).
592
+ #
593
+ # @param parent [::String]
594
+ # Required. The parent's resource name.
595
+ # @param page_size [::Integer]
596
+ # The maximum number of results per page that should be returned.
597
+ # @param page_token [::String]
598
+ # The page token.
599
+ # @param filter [::String]
600
+ # A filter expression that filters the results listed in the response.
601
+ # @param order_by [::String]
602
+ # Sort the results by a certain order.
603
+ #
604
+ # @yield [response, operation] Access the result along with the RPC operation
605
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke>]
606
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
607
+ #
608
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke>]
609
+ #
610
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
611
+ #
612
+ def list_spokes request, options = nil
613
+ raise ::ArgumentError, "request must be provided" if request.nil?
614
+
615
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::ListSpokesRequest
616
+
617
+ # Converts hash and nil to an options object
618
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
619
+
620
+ # Customize the options with defaults
621
+ metadata = @config.rpcs.list_spokes.metadata.to_h
622
+
623
+ # Set x-goog-api-client and x-goog-user-project headers
624
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
625
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
626
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
627
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
628
+
629
+ header_params = {
630
+ "parent" => request.parent
631
+ }
632
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
633
+ metadata[:"x-goog-request-params"] ||= request_params_header
634
+
635
+ options.apply_defaults timeout: @config.rpcs.list_spokes.timeout,
636
+ metadata: metadata,
637
+ retry_policy: @config.rpcs.list_spokes.retry_policy
638
+ options.apply_defaults metadata: @config.metadata,
639
+ retry_policy: @config.retry_policy
640
+
641
+ @hub_service_stub.call_rpc :list_spokes, request, options: options do |response, operation|
642
+ response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_spokes, request, response, operation, options
643
+ yield response, operation if block_given?
644
+ return response
645
+ end
646
+ rescue ::GRPC::BadStatus => e
647
+ raise ::Google::Cloud::Error.from_error(e)
648
+ end
649
+
650
+ ##
651
+ # Gets details of a single Spoke.
652
+ #
653
+ # @overload get_spoke(request, options = nil)
654
+ # Pass arguments to `get_spoke` via a request object, either of type
655
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::GetSpokeRequest} or an equivalent Hash.
656
+ #
657
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::GetSpokeRequest, ::Hash]
658
+ # A request object representing the call parameters. Required. To specify no
659
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
660
+ # @param options [::Gapic::CallOptions, ::Hash]
661
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
662
+ #
663
+ # @overload get_spoke(name: nil)
664
+ # Pass arguments to `get_spoke` via keyword arguments. Note that at
665
+ # least one keyword argument is required. To specify no parameters, or to keep all
666
+ # the default parameter values, pass an empty Hash as a request object (see above).
667
+ #
668
+ # @param name [::String]
669
+ # Required. The name of Spoke resource.
670
+ #
671
+ # @yield [response, operation] Access the result along with the RPC operation
672
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke]
673
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
674
+ #
675
+ # @return [::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke]
676
+ #
677
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
678
+ #
679
+ def get_spoke request, options = nil
680
+ raise ::ArgumentError, "request must be provided" if request.nil?
681
+
682
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::GetSpokeRequest
683
+
684
+ # Converts hash and nil to an options object
685
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
686
+
687
+ # Customize the options with defaults
688
+ metadata = @config.rpcs.get_spoke.metadata.to_h
689
+
690
+ # Set x-goog-api-client and x-goog-user-project headers
691
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
692
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
693
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
694
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
695
+
696
+ header_params = {
697
+ "name" => request.name
698
+ }
699
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
700
+ metadata[:"x-goog-request-params"] ||= request_params_header
701
+
702
+ options.apply_defaults timeout: @config.rpcs.get_spoke.timeout,
703
+ metadata: metadata,
704
+ retry_policy: @config.rpcs.get_spoke.retry_policy
705
+ options.apply_defaults metadata: @config.metadata,
706
+ retry_policy: @config.retry_policy
707
+
708
+ @hub_service_stub.call_rpc :get_spoke, request, options: options do |response, operation|
709
+ yield response, operation if block_given?
710
+ return response
711
+ end
712
+ rescue ::GRPC::BadStatus => e
713
+ raise ::Google::Cloud::Error.from_error(e)
714
+ end
715
+
716
+ ##
717
+ # Creates a new Spoke in a given project and location.
718
+ #
719
+ # @overload create_spoke(request, options = nil)
720
+ # Pass arguments to `create_spoke` via a request object, either of type
721
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::CreateSpokeRequest} or an equivalent Hash.
722
+ #
723
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::CreateSpokeRequest, ::Hash]
724
+ # A request object representing the call parameters. Required. To specify no
725
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
726
+ # @param options [::Gapic::CallOptions, ::Hash]
727
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
728
+ #
729
+ # @overload create_spoke(parent: nil, spoke_id: nil, spoke: nil, request_id: nil)
730
+ # Pass arguments to `create_spoke` via keyword arguments. Note that at
731
+ # least one keyword argument is required. To specify no parameters, or to keep all
732
+ # the default parameter values, pass an empty Hash as a request object (see above).
733
+ #
734
+ # @param parent [::String]
735
+ # Required. The parent's resource name of the Spoke.
736
+ # @param spoke_id [::String]
737
+ # Optional. Unique id for the Spoke to create.
738
+ # @param spoke [::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke, ::Hash]
739
+ # Required. Initial values for a new Hub.
740
+ # @param request_id [::String]
741
+ # Optional. An optional request ID to identify requests. Specify a unique request ID
742
+ # so that if you must retry your request, the server will know to ignore
743
+ # the request if it has already been completed. The server will guarantee
744
+ # that for at least 60 minutes since the first request.
745
+ #
746
+ # For example, consider a situation where you make an initial request and t
747
+ # he request times out. If you make the request again with the same request
748
+ # ID, the server can check if original operation with the same request ID
749
+ # was received, and if so, will ignore the second request. This prevents
750
+ # clients from accidentally creating duplicate commitments.
751
+ #
752
+ # The request ID must be a valid UUID with the exception that zero UUID is
753
+ # not supported (00000000-0000-0000-0000-000000000000).
754
+ #
755
+ # @yield [response, operation] Access the result along with the RPC operation
756
+ # @yieldparam response [::Gapic::Operation]
757
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
758
+ #
759
+ # @return [::Gapic::Operation]
760
+ #
761
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
762
+ #
763
+ def create_spoke request, options = nil
764
+ raise ::ArgumentError, "request must be provided" if request.nil?
765
+
766
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::CreateSpokeRequest
767
+
768
+ # Converts hash and nil to an options object
769
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
770
+
771
+ # Customize the options with defaults
772
+ metadata = @config.rpcs.create_spoke.metadata.to_h
773
+
774
+ # Set x-goog-api-client and x-goog-user-project headers
775
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
776
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
777
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
778
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
779
+
780
+ header_params = {
781
+ "parent" => request.parent
782
+ }
783
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
784
+ metadata[:"x-goog-request-params"] ||= request_params_header
785
+
786
+ options.apply_defaults timeout: @config.rpcs.create_spoke.timeout,
787
+ metadata: metadata,
788
+ retry_policy: @config.rpcs.create_spoke.retry_policy
789
+ options.apply_defaults metadata: @config.metadata,
790
+ retry_policy: @config.retry_policy
791
+
792
+ @hub_service_stub.call_rpc :create_spoke, request, options: options do |response, operation|
793
+ response = ::Gapic::Operation.new response, @operations_client, options: options
794
+ yield response, operation if block_given?
795
+ return response
796
+ end
797
+ rescue ::GRPC::BadStatus => e
798
+ raise ::Google::Cloud::Error.from_error(e)
799
+ end
800
+
801
+ ##
802
+ # Updates the parameters of a single Spoke.
803
+ #
804
+ # @overload update_spoke(request, options = nil)
805
+ # Pass arguments to `update_spoke` via a request object, either of type
806
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateSpokeRequest} or an equivalent Hash.
807
+ #
808
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateSpokeRequest, ::Hash]
809
+ # A request object representing the call parameters. Required. To specify no
810
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
811
+ # @param options [::Gapic::CallOptions, ::Hash]
812
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
813
+ #
814
+ # @overload update_spoke(update_mask: nil, spoke: nil, request_id: nil)
815
+ # Pass arguments to `update_spoke` via keyword arguments. Note that at
816
+ # least one keyword argument is required. To specify no parameters, or to keep all
817
+ # the default parameter values, pass an empty Hash as a request object (see above).
818
+ #
819
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
820
+ # Optional. Field mask is used to specify the fields to be overwritten in the
821
+ # Spoke resource by the update.
822
+ # The fields specified in the update_mask are relative to the resource, not
823
+ # the full request. A field will be overwritten if it is in the mask. If the
824
+ # user does not provide a mask then all fields will be overwritten.
825
+ # @param spoke [::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke, ::Hash]
826
+ # Required. The state that the Spoke should be in after the update.
827
+ # @param request_id [::String]
828
+ # Optional. An optional request ID to identify requests. Specify a unique request ID
829
+ # so that if you must retry your request, the server will know to ignore
830
+ # the request if it has already been completed. The server will guarantee
831
+ # that for at least 60 minutes since the first request.
832
+ #
833
+ # For example, consider a situation where you make an initial request and t
834
+ # he request times out. If you make the request again with the same request
835
+ # ID, the server can check if original operation with the same request ID
836
+ # was received, and if so, will ignore the second request. This prevents
837
+ # clients from accidentally creating duplicate commitments.
838
+ #
839
+ # The request ID must be a valid UUID with the exception that zero UUID is
840
+ # not supported (00000000-0000-0000-0000-000000000000).
841
+ #
842
+ # @yield [response, operation] Access the result along with the RPC operation
843
+ # @yieldparam response [::Gapic::Operation]
844
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
845
+ #
846
+ # @return [::Gapic::Operation]
847
+ #
848
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
849
+ #
850
+ def update_spoke request, options = nil
851
+ raise ::ArgumentError, "request must be provided" if request.nil?
852
+
853
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateSpokeRequest
854
+
855
+ # Converts hash and nil to an options object
856
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
857
+
858
+ # Customize the options with defaults
859
+ metadata = @config.rpcs.update_spoke.metadata.to_h
860
+
861
+ # Set x-goog-api-client and x-goog-user-project headers
862
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
863
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
864
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
865
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
866
+
867
+ header_params = {
868
+ "spoke.name" => request.spoke.name
869
+ }
870
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
871
+ metadata[:"x-goog-request-params"] ||= request_params_header
872
+
873
+ options.apply_defaults timeout: @config.rpcs.update_spoke.timeout,
874
+ metadata: metadata,
875
+ retry_policy: @config.rpcs.update_spoke.retry_policy
876
+ options.apply_defaults metadata: @config.metadata,
877
+ retry_policy: @config.retry_policy
878
+
879
+ @hub_service_stub.call_rpc :update_spoke, request, options: options do |response, operation|
880
+ response = ::Gapic::Operation.new response, @operations_client, options: options
881
+ yield response, operation if block_given?
882
+ return response
883
+ end
884
+ rescue ::GRPC::BadStatus => e
885
+ raise ::Google::Cloud::Error.from_error(e)
886
+ end
887
+
888
+ ##
889
+ # Deletes a single Spoke.
890
+ #
891
+ # @overload delete_spoke(request, options = nil)
892
+ # Pass arguments to `delete_spoke` via a request object, either of type
893
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteSpokeRequest} or an equivalent Hash.
894
+ #
895
+ # @param request [::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteSpokeRequest, ::Hash]
896
+ # A request object representing the call parameters. Required. To specify no
897
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
898
+ # @param options [::Gapic::CallOptions, ::Hash]
899
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
900
+ #
901
+ # @overload delete_spoke(name: nil, request_id: nil)
902
+ # Pass arguments to `delete_spoke` via keyword arguments. Note that at
903
+ # least one keyword argument is required. To specify no parameters, or to keep all
904
+ # the default parameter values, pass an empty Hash as a request object (see above).
905
+ #
906
+ # @param name [::String]
907
+ # Required. The name of the Spoke to delete.
908
+ # @param request_id [::String]
909
+ # Optional. An optional request ID to identify requests. Specify a unique request ID
910
+ # so that if you must retry your request, the server will know to ignore
911
+ # the request if it has already been completed. The server will guarantee
912
+ # that for at least 60 minutes after the first request.
913
+ #
914
+ # For example, consider a situation where you make an initial request and t
915
+ # he request times out. If you make the request again with the same request
916
+ # ID, the server can check if original operation with the same request ID
917
+ # was received, and if so, will ignore the second request. This prevents
918
+ # clients from accidentally creating duplicate commitments.
919
+ #
920
+ # The request ID must be a valid UUID with the exception that zero UUID is
921
+ # not supported (00000000-0000-0000-0000-000000000000).
922
+ #
923
+ # @yield [response, operation] Access the result along with the RPC operation
924
+ # @yieldparam response [::Gapic::Operation]
925
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
926
+ #
927
+ # @return [::Gapic::Operation]
928
+ #
929
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
930
+ #
931
+ def delete_spoke request, options = nil
932
+ raise ::ArgumentError, "request must be provided" if request.nil?
933
+
934
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteSpokeRequest
935
+
936
+ # Converts hash and nil to an options object
937
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
938
+
939
+ # Customize the options with defaults
940
+ metadata = @config.rpcs.delete_spoke.metadata.to_h
941
+
942
+ # Set x-goog-api-client and x-goog-user-project headers
943
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
944
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
945
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1alpha1::VERSION
946
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
947
+
948
+ header_params = {
949
+ "name" => request.name
950
+ }
951
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
952
+ metadata[:"x-goog-request-params"] ||= request_params_header
953
+
954
+ options.apply_defaults timeout: @config.rpcs.delete_spoke.timeout,
955
+ metadata: metadata,
956
+ retry_policy: @config.rpcs.delete_spoke.retry_policy
957
+ options.apply_defaults metadata: @config.metadata,
958
+ retry_policy: @config.retry_policy
959
+
960
+ @hub_service_stub.call_rpc :delete_spoke, request, options: options do |response, operation|
961
+ response = ::Gapic::Operation.new response, @operations_client, options: options
962
+ yield response, operation if block_given?
963
+ return response
964
+ end
965
+ rescue ::GRPC::BadStatus => e
966
+ raise ::Google::Cloud::Error.from_error(e)
967
+ end
968
+
969
+ ##
970
+ # Configuration class for the HubService API.
971
+ #
972
+ # This class represents the configuration for HubService,
973
+ # providing control over timeouts, retry behavior, logging, transport
974
+ # parameters, and other low-level controls. Certain parameters can also be
975
+ # applied individually to specific RPCs. See
976
+ # {::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client::Configuration::Rpcs}
977
+ # for a list of RPCs that can be configured independently.
978
+ #
979
+ # Configuration can be applied globally to all clients, or to a single client
980
+ # on construction.
981
+ #
982
+ # # Examples
983
+ #
984
+ # To modify the global config, setting the timeout for list_hubs
985
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
986
+ #
987
+ # ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.configure do |config|
988
+ # config.timeout = 10.0
989
+ # config.rpcs.list_hubs.timeout = 20.0
990
+ # end
991
+ #
992
+ # To apply the above configuration only to a new client:
993
+ #
994
+ # client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config|
995
+ # config.timeout = 10.0
996
+ # config.rpcs.list_hubs.timeout = 20.0
997
+ # end
998
+ #
999
+ # @!attribute [rw] endpoint
1000
+ # The hostname or hostname:port of the service endpoint.
1001
+ # Defaults to `"networkconnectivity.googleapis.com"`.
1002
+ # @return [::String]
1003
+ # @!attribute [rw] credentials
1004
+ # Credentials to send with calls. You may provide any of the following types:
1005
+ # * (`String`) The path to a service account key file in JSON format
1006
+ # * (`Hash`) A service account key as a Hash
1007
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1008
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1009
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1010
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1011
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1012
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1013
+ # * (`nil`) indicating no credentials
1014
+ # @return [::Object]
1015
+ # @!attribute [rw] scope
1016
+ # The OAuth scopes
1017
+ # @return [::Array<::String>]
1018
+ # @!attribute [rw] lib_name
1019
+ # The library name as recorded in instrumentation and logging
1020
+ # @return [::String]
1021
+ # @!attribute [rw] lib_version
1022
+ # The library version as recorded in instrumentation and logging
1023
+ # @return [::String]
1024
+ # @!attribute [rw] channel_args
1025
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1026
+ # `GRPC::Core::Channel` object is provided as the credential.
1027
+ # @return [::Hash]
1028
+ # @!attribute [rw] interceptors
1029
+ # An array of interceptors that are run before calls are executed.
1030
+ # @return [::Array<::GRPC::ClientInterceptor>]
1031
+ # @!attribute [rw] timeout
1032
+ # The call timeout in seconds.
1033
+ # @return [::Numeric]
1034
+ # @!attribute [rw] metadata
1035
+ # Additional gRPC headers to be sent with the call.
1036
+ # @return [::Hash{::Symbol=>::String}]
1037
+ # @!attribute [rw] retry_policy
1038
+ # The retry policy. The value is a hash with the following keys:
1039
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1040
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1041
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1042
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1043
+ # trigger a retry.
1044
+ # @return [::Hash]
1045
+ # @!attribute [rw] quota_project
1046
+ # A separate project against which to charge quota.
1047
+ # @return [::String]
1048
+ #
1049
+ class Configuration
1050
+ extend ::Gapic::Config
1051
+
1052
+ config_attr :endpoint, "networkconnectivity.googleapis.com", ::String
1053
+ config_attr :credentials, nil do |value|
1054
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1055
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1056
+ allowed.any? { |klass| klass === value }
1057
+ end
1058
+ config_attr :scope, nil, ::String, ::Array, nil
1059
+ config_attr :lib_name, nil, ::String, nil
1060
+ config_attr :lib_version, nil, ::String, nil
1061
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1062
+ config_attr :interceptors, nil, ::Array, nil
1063
+ config_attr :timeout, nil, ::Numeric, nil
1064
+ config_attr :metadata, nil, ::Hash, nil
1065
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1066
+ config_attr :quota_project, nil, ::String, nil
1067
+
1068
+ # @private
1069
+ def initialize parent_config = nil
1070
+ @parent_config = parent_config unless parent_config.nil?
1071
+
1072
+ yield self if block_given?
1073
+ end
1074
+
1075
+ ##
1076
+ # Configurations for individual RPCs
1077
+ # @return [Rpcs]
1078
+ #
1079
+ def rpcs
1080
+ @rpcs ||= begin
1081
+ parent_rpcs = nil
1082
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1083
+ Rpcs.new parent_rpcs
1084
+ end
1085
+ end
1086
+
1087
+ ##
1088
+ # Configuration RPC class for the HubService API.
1089
+ #
1090
+ # Includes fields providing the configuration for each RPC in this service.
1091
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1092
+ # the following configuration fields:
1093
+ #
1094
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1095
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1096
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1097
+ # include the following keys:
1098
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1099
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1100
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1101
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1102
+ # trigger a retry.
1103
+ #
1104
+ class Rpcs
1105
+ ##
1106
+ # RPC-specific configuration for `list_hubs`
1107
+ # @return [::Gapic::Config::Method]
1108
+ #
1109
+ attr_reader :list_hubs
1110
+ ##
1111
+ # RPC-specific configuration for `get_hub`
1112
+ # @return [::Gapic::Config::Method]
1113
+ #
1114
+ attr_reader :get_hub
1115
+ ##
1116
+ # RPC-specific configuration for `create_hub`
1117
+ # @return [::Gapic::Config::Method]
1118
+ #
1119
+ attr_reader :create_hub
1120
+ ##
1121
+ # RPC-specific configuration for `update_hub`
1122
+ # @return [::Gapic::Config::Method]
1123
+ #
1124
+ attr_reader :update_hub
1125
+ ##
1126
+ # RPC-specific configuration for `delete_hub`
1127
+ # @return [::Gapic::Config::Method]
1128
+ #
1129
+ attr_reader :delete_hub
1130
+ ##
1131
+ # RPC-specific configuration for `list_spokes`
1132
+ # @return [::Gapic::Config::Method]
1133
+ #
1134
+ attr_reader :list_spokes
1135
+ ##
1136
+ # RPC-specific configuration for `get_spoke`
1137
+ # @return [::Gapic::Config::Method]
1138
+ #
1139
+ attr_reader :get_spoke
1140
+ ##
1141
+ # RPC-specific configuration for `create_spoke`
1142
+ # @return [::Gapic::Config::Method]
1143
+ #
1144
+ attr_reader :create_spoke
1145
+ ##
1146
+ # RPC-specific configuration for `update_spoke`
1147
+ # @return [::Gapic::Config::Method]
1148
+ #
1149
+ attr_reader :update_spoke
1150
+ ##
1151
+ # RPC-specific configuration for `delete_spoke`
1152
+ # @return [::Gapic::Config::Method]
1153
+ #
1154
+ attr_reader :delete_spoke
1155
+
1156
+ # @private
1157
+ def initialize parent_rpcs = nil
1158
+ list_hubs_config = parent_rpcs&.list_hubs if parent_rpcs&.respond_to? :list_hubs
1159
+ @list_hubs = ::Gapic::Config::Method.new list_hubs_config
1160
+ get_hub_config = parent_rpcs&.get_hub if parent_rpcs&.respond_to? :get_hub
1161
+ @get_hub = ::Gapic::Config::Method.new get_hub_config
1162
+ create_hub_config = parent_rpcs&.create_hub if parent_rpcs&.respond_to? :create_hub
1163
+ @create_hub = ::Gapic::Config::Method.new create_hub_config
1164
+ update_hub_config = parent_rpcs&.update_hub if parent_rpcs&.respond_to? :update_hub
1165
+ @update_hub = ::Gapic::Config::Method.new update_hub_config
1166
+ delete_hub_config = parent_rpcs&.delete_hub if parent_rpcs&.respond_to? :delete_hub
1167
+ @delete_hub = ::Gapic::Config::Method.new delete_hub_config
1168
+ list_spokes_config = parent_rpcs&.list_spokes if parent_rpcs&.respond_to? :list_spokes
1169
+ @list_spokes = ::Gapic::Config::Method.new list_spokes_config
1170
+ get_spoke_config = parent_rpcs&.get_spoke if parent_rpcs&.respond_to? :get_spoke
1171
+ @get_spoke = ::Gapic::Config::Method.new get_spoke_config
1172
+ create_spoke_config = parent_rpcs&.create_spoke if parent_rpcs&.respond_to? :create_spoke
1173
+ @create_spoke = ::Gapic::Config::Method.new create_spoke_config
1174
+ update_spoke_config = parent_rpcs&.update_spoke if parent_rpcs&.respond_to? :update_spoke
1175
+ @update_spoke = ::Gapic::Config::Method.new update_spoke_config
1176
+ delete_spoke_config = parent_rpcs&.delete_spoke if parent_rpcs&.respond_to? :delete_spoke
1177
+ @delete_spoke = ::Gapic::Config::Method.new delete_spoke_config
1178
+
1179
+ yield self if block_given?
1180
+ end
1181
+ end
1182
+ end
1183
+ end
1184
+ end
1185
+ end
1186
+ end
1187
+ end
1188
+ end