google-cloud-network_services-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/network_services/v1/bindings_override.rb +279 -0
  6. data/lib/google/cloud/network_services/v1/dep_service/client.rb +1503 -0
  7. data/lib/google/cloud/network_services/v1/dep_service/credentials.rb +47 -0
  8. data/lib/google/cloud/network_services/v1/dep_service/operations.rb +809 -0
  9. data/lib/google/cloud/network_services/v1/dep_service/paths.rb +88 -0
  10. data/lib/google/cloud/network_services/v1/dep_service/rest/client.rb +1414 -0
  11. data/lib/google/cloud/network_services/v1/dep_service/rest/operations.rb +902 -0
  12. data/lib/google/cloud/network_services/v1/dep_service/rest/service_stub.rb +663 -0
  13. data/lib/google/cloud/network_services/v1/dep_service/rest.rb +54 -0
  14. data/lib/google/cloud/network_services/v1/dep_service.rb +56 -0
  15. data/lib/google/cloud/network_services/v1/network_services/client.rb +4383 -0
  16. data/lib/google/cloud/network_services/v1/network_services/credentials.rb +47 -0
  17. data/lib/google/cloud/network_services/v1/network_services/operations.rb +809 -0
  18. data/lib/google/cloud/network_services/v1/network_services/paths.rb +278 -0
  19. data/lib/google/cloud/network_services/v1/network_services/rest/client.rb +4093 -0
  20. data/lib/google/cloud/network_services/v1/network_services/rest/operations.rb +902 -0
  21. data/lib/google/cloud/network_services/v1/network_services/rest/service_stub.rb +2385 -0
  22. data/lib/google/cloud/network_services/v1/network_services/rest.rb +52 -0
  23. data/lib/google/cloud/network_services/v1/network_services.rb +54 -0
  24. data/lib/google/cloud/network_services/v1/rest.rb +39 -0
  25. data/lib/google/cloud/network_services/v1/version.rb +7 -2
  26. data/lib/google/cloud/network_services/v1.rb +46 -0
  27. data/lib/google/cloud/networkservices/v1/common_pb.rb +51 -0
  28. data/lib/google/cloud/networkservices/v1/dep_pb.rb +75 -0
  29. data/lib/google/cloud/networkservices/v1/dep_services_pb.rb +64 -0
  30. data/lib/google/cloud/networkservices/v1/endpoint_policy_pb.rb +58 -0
  31. data/lib/google/cloud/networkservices/v1/gateway_pb.rb +56 -0
  32. data/lib/google/cloud/networkservices/v1/grpc_route_pb.rb +69 -0
  33. data/lib/google/cloud/networkservices/v1/http_route_pb.rb +74 -0
  34. data/lib/google/cloud/networkservices/v1/mesh_pb.rb +55 -0
  35. data/lib/google/cloud/networkservices/v1/network_services_pb.rb +53 -0
  36. data/lib/google/cloud/networkservices/v1/network_services_services_pb.rb +120 -0
  37. data/lib/google/cloud/networkservices/v1/service_binding_pb.rb +52 -0
  38. data/lib/google/cloud/networkservices/v1/tcp_route_pb.rb +59 -0
  39. data/lib/google/cloud/networkservices/v1/tls_route_pb.rb +59 -0
  40. data/lib/google-cloud-network_services-v1.rb +21 -0
  41. data/proto_docs/README.md +4 -0
  42. data/proto_docs/google/api/client.rb +399 -0
  43. data/proto_docs/google/api/field_behavior.rb +85 -0
  44. data/proto_docs/google/api/field_info.rb +65 -0
  45. data/proto_docs/google/api/launch_stage.rb +71 -0
  46. data/proto_docs/google/api/resource.rb +222 -0
  47. data/proto_docs/google/cloud/networkservices/v1/common.rb +147 -0
  48. data/proto_docs/google/cloud/networkservices/v1/dep.rb +569 -0
  49. data/proto_docs/google/cloud/networkservices/v1/endpoint_policy.rb +194 -0
  50. data/proto_docs/google/cloud/networkservices/v1/gateway.rb +187 -0
  51. data/proto_docs/google/cloud/networkservices/v1/grpc_route.rb +430 -0
  52. data/proto_docs/google/cloud/networkservices/v1/http_route.rb +670 -0
  53. data/proto_docs/google/cloud/networkservices/v1/mesh.rb +155 -0
  54. data/proto_docs/google/cloud/networkservices/v1/service_binding.rb +131 -0
  55. data/proto_docs/google/cloud/networkservices/v1/tcp_route.rb +247 -0
  56. data/proto_docs/google/cloud/networkservices/v1/tls_route.rb +219 -0
  57. data/proto_docs/google/longrunning/operations.rb +164 -0
  58. data/proto_docs/google/protobuf/any.rb +145 -0
  59. data/proto_docs/google/protobuf/duration.rb +98 -0
  60. data/proto_docs/google/protobuf/empty.rb +34 -0
  61. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  62. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  63. data/proto_docs/google/rpc/status.rb +48 -0
  64. data/proto_docs/google/type/expr.rb +75 -0
  65. metadata +144 -10
@@ -0,0 +1,4093 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/networkservices/v1/network_services_pb"
21
+ require "google/cloud/network_services/v1/network_services/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module NetworkServices
28
+ module V1
29
+ module NetworkServices
30
+ module Rest
31
+ ##
32
+ # REST client for the NetworkServices service.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "networkservices.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :network_services_stub
45
+
46
+ ##
47
+ # Configure the NetworkServices Client class.
48
+ #
49
+ # See {::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all NetworkServices clients
55
+ # ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "NetworkServices", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.timeout = 60.0
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the NetworkServices Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @network_services_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new NetworkServices REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the NetworkServices client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ def initialize
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+
148
+ @quota_project_id = @config.quota_project
149
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
150
+
151
+ @operations_client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Operations.new do |config|
152
+ config.credentials = credentials
153
+ config.quota_project = @quota_project_id
154
+ config.endpoint = @config.endpoint
155
+ config.universe_domain = @config.universe_domain
156
+ end
157
+
158
+ @network_services_stub = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::ServiceStub.new(
159
+ endpoint: @config.endpoint,
160
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
161
+ universe_domain: @config.universe_domain,
162
+ credentials: credentials
163
+ )
164
+
165
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
166
+ config.credentials = credentials
167
+ config.quota_project = @quota_project_id
168
+ config.endpoint = @network_services_stub.endpoint
169
+ config.universe_domain = @network_services_stub.universe_domain
170
+ config.bindings_override = @config.bindings_override
171
+ end
172
+
173
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
174
+ config.credentials = credentials
175
+ config.quota_project = @quota_project_id
176
+ config.endpoint = @network_services_stub.endpoint
177
+ config.universe_domain = @network_services_stub.universe_domain
178
+ config.bindings_override = @config.bindings_override
179
+ end
180
+ end
181
+
182
+ ##
183
+ # Get the associated client for long-running operations.
184
+ #
185
+ # @return [::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Operations]
186
+ #
187
+ attr_reader :operations_client
188
+
189
+ ##
190
+ # Get the associated client for mix-in of the Locations.
191
+ #
192
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
193
+ #
194
+ attr_reader :location_client
195
+
196
+ ##
197
+ # Get the associated client for mix-in of the IAMPolicy.
198
+ #
199
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
200
+ #
201
+ attr_reader :iam_policy_client
202
+
203
+ # Service calls
204
+
205
+ ##
206
+ # Lists EndpointPolicies in a given project and location.
207
+ #
208
+ # @overload list_endpoint_policies(request, options = nil)
209
+ # Pass arguments to `list_endpoint_policies` via a request object, either of type
210
+ # {::Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest} or an equivalent Hash.
211
+ #
212
+ # @param request [::Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest, ::Hash]
213
+ # A request object representing the call parameters. Required. To specify no
214
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
215
+ # @param options [::Gapic::CallOptions, ::Hash]
216
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
217
+ #
218
+ # @overload list_endpoint_policies(parent: nil, page_size: nil, page_token: nil)
219
+ # Pass arguments to `list_endpoint_policies` via keyword arguments. Note that at
220
+ # least one keyword argument is required. To specify no parameters, or to keep all
221
+ # the default parameter values, pass an empty Hash as a request object (see above).
222
+ #
223
+ # @param parent [::String]
224
+ # Required. The project and location from which the EndpointPolicies should
225
+ # be listed, specified in the format `projects/*/locations/global`.
226
+ # @param page_size [::Integer]
227
+ # Maximum number of EndpointPolicies to return per call.
228
+ # @param page_token [::String]
229
+ # The value returned by the last `ListEndpointPoliciesResponse`
230
+ # Indicates that this is a continuation of a prior
231
+ # `ListEndpointPolicies` call, and that the system should return the
232
+ # next page of data.
233
+ # @yield [result, operation] Access the result along with the TransportOperation object
234
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::EndpointPolicy>]
235
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
236
+ #
237
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::EndpointPolicy>]
238
+ #
239
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
240
+ #
241
+ # @example Basic example
242
+ # require "google/cloud/network_services/v1"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest.new
249
+ #
250
+ # # Call the list_endpoint_policies method.
251
+ # result = client.list_endpoint_policies request
252
+ #
253
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
254
+ # # over elements, and API calls will be issued to fetch pages as needed.
255
+ # result.each do |item|
256
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::EndpointPolicy.
257
+ # p item
258
+ # end
259
+ #
260
+ def list_endpoint_policies request, options = nil
261
+ raise ::ArgumentError, "request must be provided" if request.nil?
262
+
263
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest
264
+
265
+ # Converts hash and nil to an options object
266
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
267
+
268
+ # Customize the options with defaults
269
+ call_metadata = @config.rpcs.list_endpoint_policies.metadata.to_h
270
+
271
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
272
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
273
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
274
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
275
+ transports_version_send: [:rest]
276
+
277
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
278
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
279
+
280
+ options.apply_defaults timeout: @config.rpcs.list_endpoint_policies.timeout,
281
+ metadata: call_metadata,
282
+ retry_policy: @config.rpcs.list_endpoint_policies.retry_policy
283
+
284
+ options.apply_defaults timeout: @config.timeout,
285
+ metadata: @config.metadata,
286
+ retry_policy: @config.retry_policy
287
+
288
+ @network_services_stub.list_endpoint_policies request, options do |result, operation|
289
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_endpoint_policies, "endpoint_policies", request, result, options
290
+ yield result, operation if block_given?
291
+ return result
292
+ end
293
+ rescue ::Gapic::Rest::Error => e
294
+ raise ::Google::Cloud::Error.from_error(e)
295
+ end
296
+
297
+ ##
298
+ # Gets details of a single EndpointPolicy.
299
+ #
300
+ # @overload get_endpoint_policy(request, options = nil)
301
+ # Pass arguments to `get_endpoint_policy` via a request object, either of type
302
+ # {::Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest} or an equivalent Hash.
303
+ #
304
+ # @param request [::Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest, ::Hash]
305
+ # A request object representing the call parameters. Required. To specify no
306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
307
+ # @param options [::Gapic::CallOptions, ::Hash]
308
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
309
+ #
310
+ # @overload get_endpoint_policy(name: nil)
311
+ # Pass arguments to `get_endpoint_policy` via keyword arguments. Note that at
312
+ # least one keyword argument is required. To specify no parameters, or to keep all
313
+ # the default parameter values, pass an empty Hash as a request object (see above).
314
+ #
315
+ # @param name [::String]
316
+ # Required. A name of the EndpointPolicy to get. Must be in the format
317
+ # `projects/*/locations/global/endpointPolicies/*`.
318
+ # @yield [result, operation] Access the result along with the TransportOperation object
319
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::EndpointPolicy]
320
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
321
+ #
322
+ # @return [::Google::Cloud::NetworkServices::V1::EndpointPolicy]
323
+ #
324
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
325
+ #
326
+ # @example Basic example
327
+ # require "google/cloud/network_services/v1"
328
+ #
329
+ # # Create a client object. The client can be reused for multiple calls.
330
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
331
+ #
332
+ # # Create a request. To set request fields, pass in keyword arguments.
333
+ # request = Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest.new
334
+ #
335
+ # # Call the get_endpoint_policy method.
336
+ # result = client.get_endpoint_policy request
337
+ #
338
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::EndpointPolicy.
339
+ # p result
340
+ #
341
+ def get_endpoint_policy request, options = nil
342
+ raise ::ArgumentError, "request must be provided" if request.nil?
343
+
344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest
345
+
346
+ # Converts hash and nil to an options object
347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+
349
+ # Customize the options with defaults
350
+ call_metadata = @config.rpcs.get_endpoint_policy.metadata.to_h
351
+
352
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
353
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
355
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
356
+ transports_version_send: [:rest]
357
+
358
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
359
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
360
+
361
+ options.apply_defaults timeout: @config.rpcs.get_endpoint_policy.timeout,
362
+ metadata: call_metadata,
363
+ retry_policy: @config.rpcs.get_endpoint_policy.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @network_services_stub.get_endpoint_policy request, options do |result, operation|
370
+ yield result, operation if block_given?
371
+ return result
372
+ end
373
+ rescue ::Gapic::Rest::Error => e
374
+ raise ::Google::Cloud::Error.from_error(e)
375
+ end
376
+
377
+ ##
378
+ # Creates a new EndpointPolicy in a given project and location.
379
+ #
380
+ # @overload create_endpoint_policy(request, options = nil)
381
+ # Pass arguments to `create_endpoint_policy` via a request object, either of type
382
+ # {::Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest} or an equivalent Hash.
383
+ #
384
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest, ::Hash]
385
+ # A request object representing the call parameters. Required. To specify no
386
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
387
+ # @param options [::Gapic::CallOptions, ::Hash]
388
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
389
+ #
390
+ # @overload create_endpoint_policy(parent: nil, endpoint_policy_id: nil, endpoint_policy: nil)
391
+ # Pass arguments to `create_endpoint_policy` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param parent [::String]
396
+ # Required. The parent resource of the EndpointPolicy. Must be in the
397
+ # format `projects/*/locations/global`.
398
+ # @param endpoint_policy_id [::String]
399
+ # Required. Short name of the EndpointPolicy resource to be created.
400
+ # E.g. "CustomECS".
401
+ # @param endpoint_policy [::Google::Cloud::NetworkServices::V1::EndpointPolicy, ::Hash]
402
+ # Required. EndpointPolicy resource to be created.
403
+ # @yield [result, operation] Access the result along with the TransportOperation object
404
+ # @yieldparam result [::Gapic::Operation]
405
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
406
+ #
407
+ # @return [::Gapic::Operation]
408
+ #
409
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
410
+ #
411
+ # @example Basic example
412
+ # require "google/cloud/network_services/v1"
413
+ #
414
+ # # Create a client object. The client can be reused for multiple calls.
415
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
416
+ #
417
+ # # Create a request. To set request fields, pass in keyword arguments.
418
+ # request = Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest.new
419
+ #
420
+ # # Call the create_endpoint_policy method.
421
+ # result = client.create_endpoint_policy request
422
+ #
423
+ # # The returned object is of type Gapic::Operation. You can use it to
424
+ # # check the status of an operation, cancel it, or wait for results.
425
+ # # Here is how to wait for a response.
426
+ # result.wait_until_done! timeout: 60
427
+ # if result.response?
428
+ # p result.response
429
+ # else
430
+ # puts "No response received."
431
+ # end
432
+ #
433
+ def create_endpoint_policy request, options = nil
434
+ raise ::ArgumentError, "request must be provided" if request.nil?
435
+
436
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest
437
+
438
+ # Converts hash and nil to an options object
439
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
440
+
441
+ # Customize the options with defaults
442
+ call_metadata = @config.rpcs.create_endpoint_policy.metadata.to_h
443
+
444
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
445
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
446
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
447
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
448
+ transports_version_send: [:rest]
449
+
450
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
451
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
452
+
453
+ options.apply_defaults timeout: @config.rpcs.create_endpoint_policy.timeout,
454
+ metadata: call_metadata,
455
+ retry_policy: @config.rpcs.create_endpoint_policy.retry_policy
456
+
457
+ options.apply_defaults timeout: @config.timeout,
458
+ metadata: @config.metadata,
459
+ retry_policy: @config.retry_policy
460
+
461
+ @network_services_stub.create_endpoint_policy request, options do |result, operation|
462
+ result = ::Gapic::Operation.new result, @operations_client, options: options
463
+ yield result, operation if block_given?
464
+ return result
465
+ end
466
+ rescue ::Gapic::Rest::Error => e
467
+ raise ::Google::Cloud::Error.from_error(e)
468
+ end
469
+
470
+ ##
471
+ # Updates the parameters of a single EndpointPolicy.
472
+ #
473
+ # @overload update_endpoint_policy(request, options = nil)
474
+ # Pass arguments to `update_endpoint_policy` via a request object, either of type
475
+ # {::Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest} or an equivalent Hash.
476
+ #
477
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest, ::Hash]
478
+ # A request object representing the call parameters. Required. To specify no
479
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
480
+ # @param options [::Gapic::CallOptions, ::Hash]
481
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
482
+ #
483
+ # @overload update_endpoint_policy(update_mask: nil, endpoint_policy: nil)
484
+ # Pass arguments to `update_endpoint_policy` via keyword arguments. Note that at
485
+ # least one keyword argument is required. To specify no parameters, or to keep all
486
+ # the default parameter values, pass an empty Hash as a request object (see above).
487
+ #
488
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
489
+ # Optional. Field mask is used to specify the fields to be overwritten in the
490
+ # EndpointPolicy resource by the update.
491
+ # The fields specified in the update_mask are relative to the resource, not
492
+ # the full request. A field will be overwritten if it is in the mask. If the
493
+ # user does not provide a mask then all fields will be overwritten.
494
+ # @param endpoint_policy [::Google::Cloud::NetworkServices::V1::EndpointPolicy, ::Hash]
495
+ # Required. Updated EndpointPolicy resource.
496
+ # @yield [result, operation] Access the result along with the TransportOperation object
497
+ # @yieldparam result [::Gapic::Operation]
498
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
499
+ #
500
+ # @return [::Gapic::Operation]
501
+ #
502
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
503
+ #
504
+ # @example Basic example
505
+ # require "google/cloud/network_services/v1"
506
+ #
507
+ # # Create a client object. The client can be reused for multiple calls.
508
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
509
+ #
510
+ # # Create a request. To set request fields, pass in keyword arguments.
511
+ # request = Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest.new
512
+ #
513
+ # # Call the update_endpoint_policy method.
514
+ # result = client.update_endpoint_policy request
515
+ #
516
+ # # The returned object is of type Gapic::Operation. You can use it to
517
+ # # check the status of an operation, cancel it, or wait for results.
518
+ # # Here is how to wait for a response.
519
+ # result.wait_until_done! timeout: 60
520
+ # if result.response?
521
+ # p result.response
522
+ # else
523
+ # puts "No response received."
524
+ # end
525
+ #
526
+ def update_endpoint_policy request, options = nil
527
+ raise ::ArgumentError, "request must be provided" if request.nil?
528
+
529
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest
530
+
531
+ # Converts hash and nil to an options object
532
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
533
+
534
+ # Customize the options with defaults
535
+ call_metadata = @config.rpcs.update_endpoint_policy.metadata.to_h
536
+
537
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
538
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
539
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
540
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
541
+ transports_version_send: [:rest]
542
+
543
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
544
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
545
+
546
+ options.apply_defaults timeout: @config.rpcs.update_endpoint_policy.timeout,
547
+ metadata: call_metadata,
548
+ retry_policy: @config.rpcs.update_endpoint_policy.retry_policy
549
+
550
+ options.apply_defaults timeout: @config.timeout,
551
+ metadata: @config.metadata,
552
+ retry_policy: @config.retry_policy
553
+
554
+ @network_services_stub.update_endpoint_policy request, options do |result, operation|
555
+ result = ::Gapic::Operation.new result, @operations_client, options: options
556
+ yield result, operation if block_given?
557
+ return result
558
+ end
559
+ rescue ::Gapic::Rest::Error => e
560
+ raise ::Google::Cloud::Error.from_error(e)
561
+ end
562
+
563
+ ##
564
+ # Deletes a single EndpointPolicy.
565
+ #
566
+ # @overload delete_endpoint_policy(request, options = nil)
567
+ # Pass arguments to `delete_endpoint_policy` via a request object, either of type
568
+ # {::Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest} or an equivalent Hash.
569
+ #
570
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest, ::Hash]
571
+ # A request object representing the call parameters. Required. To specify no
572
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
573
+ # @param options [::Gapic::CallOptions, ::Hash]
574
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
575
+ #
576
+ # @overload delete_endpoint_policy(name: nil)
577
+ # Pass arguments to `delete_endpoint_policy` via keyword arguments. Note that at
578
+ # least one keyword argument is required. To specify no parameters, or to keep all
579
+ # the default parameter values, pass an empty Hash as a request object (see above).
580
+ #
581
+ # @param name [::String]
582
+ # Required. A name of the EndpointPolicy to delete. Must be in the format
583
+ # `projects/*/locations/global/endpointPolicies/*`.
584
+ # @yield [result, operation] Access the result along with the TransportOperation object
585
+ # @yieldparam result [::Gapic::Operation]
586
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
587
+ #
588
+ # @return [::Gapic::Operation]
589
+ #
590
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
591
+ #
592
+ # @example Basic example
593
+ # require "google/cloud/network_services/v1"
594
+ #
595
+ # # Create a client object. The client can be reused for multiple calls.
596
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
597
+ #
598
+ # # Create a request. To set request fields, pass in keyword arguments.
599
+ # request = Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest.new
600
+ #
601
+ # # Call the delete_endpoint_policy method.
602
+ # result = client.delete_endpoint_policy request
603
+ #
604
+ # # The returned object is of type Gapic::Operation. You can use it to
605
+ # # check the status of an operation, cancel it, or wait for results.
606
+ # # Here is how to wait for a response.
607
+ # result.wait_until_done! timeout: 60
608
+ # if result.response?
609
+ # p result.response
610
+ # else
611
+ # puts "No response received."
612
+ # end
613
+ #
614
+ def delete_endpoint_policy request, options = nil
615
+ raise ::ArgumentError, "request must be provided" if request.nil?
616
+
617
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest
618
+
619
+ # Converts hash and nil to an options object
620
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
621
+
622
+ # Customize the options with defaults
623
+ call_metadata = @config.rpcs.delete_endpoint_policy.metadata.to_h
624
+
625
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
626
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
627
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
628
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
629
+ transports_version_send: [:rest]
630
+
631
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
632
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
633
+
634
+ options.apply_defaults timeout: @config.rpcs.delete_endpoint_policy.timeout,
635
+ metadata: call_metadata,
636
+ retry_policy: @config.rpcs.delete_endpoint_policy.retry_policy
637
+
638
+ options.apply_defaults timeout: @config.timeout,
639
+ metadata: @config.metadata,
640
+ retry_policy: @config.retry_policy
641
+
642
+ @network_services_stub.delete_endpoint_policy request, options do |result, operation|
643
+ result = ::Gapic::Operation.new result, @operations_client, options: options
644
+ yield result, operation if block_given?
645
+ return result
646
+ end
647
+ rescue ::Gapic::Rest::Error => e
648
+ raise ::Google::Cloud::Error.from_error(e)
649
+ end
650
+
651
+ ##
652
+ # Lists Gateways in a given project and location.
653
+ #
654
+ # @overload list_gateways(request, options = nil)
655
+ # Pass arguments to `list_gateways` via a request object, either of type
656
+ # {::Google::Cloud::NetworkServices::V1::ListGatewaysRequest} or an equivalent Hash.
657
+ #
658
+ # @param request [::Google::Cloud::NetworkServices::V1::ListGatewaysRequest, ::Hash]
659
+ # A request object representing the call parameters. Required. To specify no
660
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
661
+ # @param options [::Gapic::CallOptions, ::Hash]
662
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
663
+ #
664
+ # @overload list_gateways(parent: nil, page_size: nil, page_token: nil)
665
+ # Pass arguments to `list_gateways` via keyword arguments. Note that at
666
+ # least one keyword argument is required. To specify no parameters, or to keep all
667
+ # the default parameter values, pass an empty Hash as a request object (see above).
668
+ #
669
+ # @param parent [::String]
670
+ # Required. The project and location from which the Gateways should be
671
+ # listed, specified in the format `projects/*/locations/*`.
672
+ # @param page_size [::Integer]
673
+ # Maximum number of Gateways to return per call.
674
+ # @param page_token [::String]
675
+ # The value returned by the last `ListGatewaysResponse`
676
+ # Indicates that this is a continuation of a prior `ListGateways` call,
677
+ # and that the system should return the next page of data.
678
+ # @yield [result, operation] Access the result along with the TransportOperation object
679
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Gateway>]
680
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
681
+ #
682
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Gateway>]
683
+ #
684
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
685
+ #
686
+ # @example Basic example
687
+ # require "google/cloud/network_services/v1"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Cloud::NetworkServices::V1::ListGatewaysRequest.new
694
+ #
695
+ # # Call the list_gateways method.
696
+ # result = client.list_gateways request
697
+ #
698
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
699
+ # # over elements, and API calls will be issued to fetch pages as needed.
700
+ # result.each do |item|
701
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::Gateway.
702
+ # p item
703
+ # end
704
+ #
705
+ def list_gateways request, options = nil
706
+ raise ::ArgumentError, "request must be provided" if request.nil?
707
+
708
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListGatewaysRequest
709
+
710
+ # Converts hash and nil to an options object
711
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
712
+
713
+ # Customize the options with defaults
714
+ call_metadata = @config.rpcs.list_gateways.metadata.to_h
715
+
716
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
717
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
718
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
719
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
720
+ transports_version_send: [:rest]
721
+
722
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
723
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
724
+
725
+ options.apply_defaults timeout: @config.rpcs.list_gateways.timeout,
726
+ metadata: call_metadata,
727
+ retry_policy: @config.rpcs.list_gateways.retry_policy
728
+
729
+ options.apply_defaults timeout: @config.timeout,
730
+ metadata: @config.metadata,
731
+ retry_policy: @config.retry_policy
732
+
733
+ @network_services_stub.list_gateways request, options do |result, operation|
734
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_gateways, "gateways", request, result, options
735
+ yield result, operation if block_given?
736
+ return result
737
+ end
738
+ rescue ::Gapic::Rest::Error => e
739
+ raise ::Google::Cloud::Error.from_error(e)
740
+ end
741
+
742
+ ##
743
+ # Gets details of a single Gateway.
744
+ #
745
+ # @overload get_gateway(request, options = nil)
746
+ # Pass arguments to `get_gateway` via a request object, either of type
747
+ # {::Google::Cloud::NetworkServices::V1::GetGatewayRequest} or an equivalent Hash.
748
+ #
749
+ # @param request [::Google::Cloud::NetworkServices::V1::GetGatewayRequest, ::Hash]
750
+ # A request object representing the call parameters. Required. To specify no
751
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
752
+ # @param options [::Gapic::CallOptions, ::Hash]
753
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
754
+ #
755
+ # @overload get_gateway(name: nil)
756
+ # Pass arguments to `get_gateway` via keyword arguments. Note that at
757
+ # least one keyword argument is required. To specify no parameters, or to keep all
758
+ # the default parameter values, pass an empty Hash as a request object (see above).
759
+ #
760
+ # @param name [::String]
761
+ # Required. A name of the Gateway to get. Must be in the format
762
+ # `projects/*/locations/*/gateways/*`.
763
+ # @yield [result, operation] Access the result along with the TransportOperation object
764
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::Gateway]
765
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
766
+ #
767
+ # @return [::Google::Cloud::NetworkServices::V1::Gateway]
768
+ #
769
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
770
+ #
771
+ # @example Basic example
772
+ # require "google/cloud/network_services/v1"
773
+ #
774
+ # # Create a client object. The client can be reused for multiple calls.
775
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
776
+ #
777
+ # # Create a request. To set request fields, pass in keyword arguments.
778
+ # request = Google::Cloud::NetworkServices::V1::GetGatewayRequest.new
779
+ #
780
+ # # Call the get_gateway method.
781
+ # result = client.get_gateway request
782
+ #
783
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::Gateway.
784
+ # p result
785
+ #
786
+ def get_gateway request, options = nil
787
+ raise ::ArgumentError, "request must be provided" if request.nil?
788
+
789
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetGatewayRequest
790
+
791
+ # Converts hash and nil to an options object
792
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
793
+
794
+ # Customize the options with defaults
795
+ call_metadata = @config.rpcs.get_gateway.metadata.to_h
796
+
797
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
798
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
799
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
800
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
801
+ transports_version_send: [:rest]
802
+
803
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
804
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
805
+
806
+ options.apply_defaults timeout: @config.rpcs.get_gateway.timeout,
807
+ metadata: call_metadata,
808
+ retry_policy: @config.rpcs.get_gateway.retry_policy
809
+
810
+ options.apply_defaults timeout: @config.timeout,
811
+ metadata: @config.metadata,
812
+ retry_policy: @config.retry_policy
813
+
814
+ @network_services_stub.get_gateway request, options do |result, operation|
815
+ yield result, operation if block_given?
816
+ return result
817
+ end
818
+ rescue ::Gapic::Rest::Error => e
819
+ raise ::Google::Cloud::Error.from_error(e)
820
+ end
821
+
822
+ ##
823
+ # Creates a new Gateway in a given project and location.
824
+ #
825
+ # @overload create_gateway(request, options = nil)
826
+ # Pass arguments to `create_gateway` via a request object, either of type
827
+ # {::Google::Cloud::NetworkServices::V1::CreateGatewayRequest} or an equivalent Hash.
828
+ #
829
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateGatewayRequest, ::Hash]
830
+ # A request object representing the call parameters. Required. To specify no
831
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
832
+ # @param options [::Gapic::CallOptions, ::Hash]
833
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
834
+ #
835
+ # @overload create_gateway(parent: nil, gateway_id: nil, gateway: nil)
836
+ # Pass arguments to `create_gateway` via keyword arguments. Note that at
837
+ # least one keyword argument is required. To specify no parameters, or to keep all
838
+ # the default parameter values, pass an empty Hash as a request object (see above).
839
+ #
840
+ # @param parent [::String]
841
+ # Required. The parent resource of the Gateway. Must be in the
842
+ # format `projects/*/locations/*`.
843
+ # @param gateway_id [::String]
844
+ # Required. Short name of the Gateway resource to be created.
845
+ # @param gateway [::Google::Cloud::NetworkServices::V1::Gateway, ::Hash]
846
+ # Required. Gateway resource to be created.
847
+ # @yield [result, operation] Access the result along with the TransportOperation object
848
+ # @yieldparam result [::Gapic::Operation]
849
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
850
+ #
851
+ # @return [::Gapic::Operation]
852
+ #
853
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
854
+ #
855
+ # @example Basic example
856
+ # require "google/cloud/network_services/v1"
857
+ #
858
+ # # Create a client object. The client can be reused for multiple calls.
859
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
860
+ #
861
+ # # Create a request. To set request fields, pass in keyword arguments.
862
+ # request = Google::Cloud::NetworkServices::V1::CreateGatewayRequest.new
863
+ #
864
+ # # Call the create_gateway method.
865
+ # result = client.create_gateway request
866
+ #
867
+ # # The returned object is of type Gapic::Operation. You can use it to
868
+ # # check the status of an operation, cancel it, or wait for results.
869
+ # # Here is how to wait for a response.
870
+ # result.wait_until_done! timeout: 60
871
+ # if result.response?
872
+ # p result.response
873
+ # else
874
+ # puts "No response received."
875
+ # end
876
+ #
877
+ def create_gateway request, options = nil
878
+ raise ::ArgumentError, "request must be provided" if request.nil?
879
+
880
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateGatewayRequest
881
+
882
+ # Converts hash and nil to an options object
883
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
884
+
885
+ # Customize the options with defaults
886
+ call_metadata = @config.rpcs.create_gateway.metadata.to_h
887
+
888
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
889
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
890
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
891
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
892
+ transports_version_send: [:rest]
893
+
894
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
895
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
896
+
897
+ options.apply_defaults timeout: @config.rpcs.create_gateway.timeout,
898
+ metadata: call_metadata,
899
+ retry_policy: @config.rpcs.create_gateway.retry_policy
900
+
901
+ options.apply_defaults timeout: @config.timeout,
902
+ metadata: @config.metadata,
903
+ retry_policy: @config.retry_policy
904
+
905
+ @network_services_stub.create_gateway request, options do |result, operation|
906
+ result = ::Gapic::Operation.new result, @operations_client, options: options
907
+ yield result, operation if block_given?
908
+ return result
909
+ end
910
+ rescue ::Gapic::Rest::Error => e
911
+ raise ::Google::Cloud::Error.from_error(e)
912
+ end
913
+
914
+ ##
915
+ # Updates the parameters of a single Gateway.
916
+ #
917
+ # @overload update_gateway(request, options = nil)
918
+ # Pass arguments to `update_gateway` via a request object, either of type
919
+ # {::Google::Cloud::NetworkServices::V1::UpdateGatewayRequest} or an equivalent Hash.
920
+ #
921
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateGatewayRequest, ::Hash]
922
+ # A request object representing the call parameters. Required. To specify no
923
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
924
+ # @param options [::Gapic::CallOptions, ::Hash]
925
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
926
+ #
927
+ # @overload update_gateway(update_mask: nil, gateway: nil)
928
+ # Pass arguments to `update_gateway` via keyword arguments. Note that at
929
+ # least one keyword argument is required. To specify no parameters, or to keep all
930
+ # the default parameter values, pass an empty Hash as a request object (see above).
931
+ #
932
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
933
+ # Optional. Field mask is used to specify the fields to be overwritten in the
934
+ # Gateway resource by the update.
935
+ # The fields specified in the update_mask are relative to the resource, not
936
+ # the full request. A field will be overwritten if it is in the mask. If the
937
+ # user does not provide a mask then all fields will be overwritten.
938
+ # @param gateway [::Google::Cloud::NetworkServices::V1::Gateway, ::Hash]
939
+ # Required. Updated Gateway resource.
940
+ # @yield [result, operation] Access the result along with the TransportOperation object
941
+ # @yieldparam result [::Gapic::Operation]
942
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
943
+ #
944
+ # @return [::Gapic::Operation]
945
+ #
946
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
947
+ #
948
+ # @example Basic example
949
+ # require "google/cloud/network_services/v1"
950
+ #
951
+ # # Create a client object. The client can be reused for multiple calls.
952
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
953
+ #
954
+ # # Create a request. To set request fields, pass in keyword arguments.
955
+ # request = Google::Cloud::NetworkServices::V1::UpdateGatewayRequest.new
956
+ #
957
+ # # Call the update_gateway method.
958
+ # result = client.update_gateway request
959
+ #
960
+ # # The returned object is of type Gapic::Operation. You can use it to
961
+ # # check the status of an operation, cancel it, or wait for results.
962
+ # # Here is how to wait for a response.
963
+ # result.wait_until_done! timeout: 60
964
+ # if result.response?
965
+ # p result.response
966
+ # else
967
+ # puts "No response received."
968
+ # end
969
+ #
970
+ def update_gateway request, options = nil
971
+ raise ::ArgumentError, "request must be provided" if request.nil?
972
+
973
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateGatewayRequest
974
+
975
+ # Converts hash and nil to an options object
976
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
977
+
978
+ # Customize the options with defaults
979
+ call_metadata = @config.rpcs.update_gateway.metadata.to_h
980
+
981
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
982
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
983
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
984
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
985
+ transports_version_send: [:rest]
986
+
987
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
988
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
989
+
990
+ options.apply_defaults timeout: @config.rpcs.update_gateway.timeout,
991
+ metadata: call_metadata,
992
+ retry_policy: @config.rpcs.update_gateway.retry_policy
993
+
994
+ options.apply_defaults timeout: @config.timeout,
995
+ metadata: @config.metadata,
996
+ retry_policy: @config.retry_policy
997
+
998
+ @network_services_stub.update_gateway request, options do |result, operation|
999
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1000
+ yield result, operation if block_given?
1001
+ return result
1002
+ end
1003
+ rescue ::Gapic::Rest::Error => e
1004
+ raise ::Google::Cloud::Error.from_error(e)
1005
+ end
1006
+
1007
+ ##
1008
+ # Deletes a single Gateway.
1009
+ #
1010
+ # @overload delete_gateway(request, options = nil)
1011
+ # Pass arguments to `delete_gateway` via a request object, either of type
1012
+ # {::Google::Cloud::NetworkServices::V1::DeleteGatewayRequest} or an equivalent Hash.
1013
+ #
1014
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteGatewayRequest, ::Hash]
1015
+ # A request object representing the call parameters. Required. To specify no
1016
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1017
+ # @param options [::Gapic::CallOptions, ::Hash]
1018
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1019
+ #
1020
+ # @overload delete_gateway(name: nil)
1021
+ # Pass arguments to `delete_gateway` via keyword arguments. Note that at
1022
+ # least one keyword argument is required. To specify no parameters, or to keep all
1023
+ # the default parameter values, pass an empty Hash as a request object (see above).
1024
+ #
1025
+ # @param name [::String]
1026
+ # Required. A name of the Gateway to delete. Must be in the format
1027
+ # `projects/*/locations/*/gateways/*`.
1028
+ # @yield [result, operation] Access the result along with the TransportOperation object
1029
+ # @yieldparam result [::Gapic::Operation]
1030
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1031
+ #
1032
+ # @return [::Gapic::Operation]
1033
+ #
1034
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1035
+ #
1036
+ # @example Basic example
1037
+ # require "google/cloud/network_services/v1"
1038
+ #
1039
+ # # Create a client object. The client can be reused for multiple calls.
1040
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1041
+ #
1042
+ # # Create a request. To set request fields, pass in keyword arguments.
1043
+ # request = Google::Cloud::NetworkServices::V1::DeleteGatewayRequest.new
1044
+ #
1045
+ # # Call the delete_gateway method.
1046
+ # result = client.delete_gateway request
1047
+ #
1048
+ # # The returned object is of type Gapic::Operation. You can use it to
1049
+ # # check the status of an operation, cancel it, or wait for results.
1050
+ # # Here is how to wait for a response.
1051
+ # result.wait_until_done! timeout: 60
1052
+ # if result.response?
1053
+ # p result.response
1054
+ # else
1055
+ # puts "No response received."
1056
+ # end
1057
+ #
1058
+ def delete_gateway request, options = nil
1059
+ raise ::ArgumentError, "request must be provided" if request.nil?
1060
+
1061
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteGatewayRequest
1062
+
1063
+ # Converts hash and nil to an options object
1064
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1065
+
1066
+ # Customize the options with defaults
1067
+ call_metadata = @config.rpcs.delete_gateway.metadata.to_h
1068
+
1069
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1070
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1071
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1072
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1073
+ transports_version_send: [:rest]
1074
+
1075
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1076
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1077
+
1078
+ options.apply_defaults timeout: @config.rpcs.delete_gateway.timeout,
1079
+ metadata: call_metadata,
1080
+ retry_policy: @config.rpcs.delete_gateway.retry_policy
1081
+
1082
+ options.apply_defaults timeout: @config.timeout,
1083
+ metadata: @config.metadata,
1084
+ retry_policy: @config.retry_policy
1085
+
1086
+ @network_services_stub.delete_gateway request, options do |result, operation|
1087
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1088
+ yield result, operation if block_given?
1089
+ return result
1090
+ end
1091
+ rescue ::Gapic::Rest::Error => e
1092
+ raise ::Google::Cloud::Error.from_error(e)
1093
+ end
1094
+
1095
+ ##
1096
+ # Lists GrpcRoutes in a given project and location.
1097
+ #
1098
+ # @overload list_grpc_routes(request, options = nil)
1099
+ # Pass arguments to `list_grpc_routes` via a request object, either of type
1100
+ # {::Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest} or an equivalent Hash.
1101
+ #
1102
+ # @param request [::Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest, ::Hash]
1103
+ # A request object representing the call parameters. Required. To specify no
1104
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1105
+ # @param options [::Gapic::CallOptions, ::Hash]
1106
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1107
+ #
1108
+ # @overload list_grpc_routes(parent: nil, page_size: nil, page_token: nil)
1109
+ # Pass arguments to `list_grpc_routes` via keyword arguments. Note that at
1110
+ # least one keyword argument is required. To specify no parameters, or to keep all
1111
+ # the default parameter values, pass an empty Hash as a request object (see above).
1112
+ #
1113
+ # @param parent [::String]
1114
+ # Required. The project and location from which the GrpcRoutes should be
1115
+ # listed, specified in the format `projects/*/locations/global`.
1116
+ # @param page_size [::Integer]
1117
+ # Maximum number of GrpcRoutes to return per call.
1118
+ # @param page_token [::String]
1119
+ # The value returned by the last `ListGrpcRoutesResponse`
1120
+ # Indicates that this is a continuation of a prior `ListGrpcRoutes` call,
1121
+ # and that the system should return the next page of data.
1122
+ # @yield [result, operation] Access the result along with the TransportOperation object
1123
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::GrpcRoute>]
1124
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1125
+ #
1126
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::GrpcRoute>]
1127
+ #
1128
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1129
+ #
1130
+ # @example Basic example
1131
+ # require "google/cloud/network_services/v1"
1132
+ #
1133
+ # # Create a client object. The client can be reused for multiple calls.
1134
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1135
+ #
1136
+ # # Create a request. To set request fields, pass in keyword arguments.
1137
+ # request = Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest.new
1138
+ #
1139
+ # # Call the list_grpc_routes method.
1140
+ # result = client.list_grpc_routes request
1141
+ #
1142
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1143
+ # # over elements, and API calls will be issued to fetch pages as needed.
1144
+ # result.each do |item|
1145
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::GrpcRoute.
1146
+ # p item
1147
+ # end
1148
+ #
1149
+ def list_grpc_routes request, options = nil
1150
+ raise ::ArgumentError, "request must be provided" if request.nil?
1151
+
1152
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest
1153
+
1154
+ # Converts hash and nil to an options object
1155
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1156
+
1157
+ # Customize the options with defaults
1158
+ call_metadata = @config.rpcs.list_grpc_routes.metadata.to_h
1159
+
1160
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1161
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1162
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1163
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1164
+ transports_version_send: [:rest]
1165
+
1166
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1167
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1168
+
1169
+ options.apply_defaults timeout: @config.rpcs.list_grpc_routes.timeout,
1170
+ metadata: call_metadata,
1171
+ retry_policy: @config.rpcs.list_grpc_routes.retry_policy
1172
+
1173
+ options.apply_defaults timeout: @config.timeout,
1174
+ metadata: @config.metadata,
1175
+ retry_policy: @config.retry_policy
1176
+
1177
+ @network_services_stub.list_grpc_routes request, options do |result, operation|
1178
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_grpc_routes, "grpc_routes", request, result, options
1179
+ yield result, operation if block_given?
1180
+ return result
1181
+ end
1182
+ rescue ::Gapic::Rest::Error => e
1183
+ raise ::Google::Cloud::Error.from_error(e)
1184
+ end
1185
+
1186
+ ##
1187
+ # Gets details of a single GrpcRoute.
1188
+ #
1189
+ # @overload get_grpc_route(request, options = nil)
1190
+ # Pass arguments to `get_grpc_route` via a request object, either of type
1191
+ # {::Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest} or an equivalent Hash.
1192
+ #
1193
+ # @param request [::Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest, ::Hash]
1194
+ # A request object representing the call parameters. Required. To specify no
1195
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1196
+ # @param options [::Gapic::CallOptions, ::Hash]
1197
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1198
+ #
1199
+ # @overload get_grpc_route(name: nil)
1200
+ # Pass arguments to `get_grpc_route` via keyword arguments. Note that at
1201
+ # least one keyword argument is required. To specify no parameters, or to keep all
1202
+ # the default parameter values, pass an empty Hash as a request object (see above).
1203
+ #
1204
+ # @param name [::String]
1205
+ # Required. A name of the GrpcRoute to get. Must be in the format
1206
+ # `projects/*/locations/global/grpcRoutes/*`.
1207
+ # @yield [result, operation] Access the result along with the TransportOperation object
1208
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::GrpcRoute]
1209
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1210
+ #
1211
+ # @return [::Google::Cloud::NetworkServices::V1::GrpcRoute]
1212
+ #
1213
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1214
+ #
1215
+ # @example Basic example
1216
+ # require "google/cloud/network_services/v1"
1217
+ #
1218
+ # # Create a client object. The client can be reused for multiple calls.
1219
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1220
+ #
1221
+ # # Create a request. To set request fields, pass in keyword arguments.
1222
+ # request = Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest.new
1223
+ #
1224
+ # # Call the get_grpc_route method.
1225
+ # result = client.get_grpc_route request
1226
+ #
1227
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::GrpcRoute.
1228
+ # p result
1229
+ #
1230
+ def get_grpc_route request, options = nil
1231
+ raise ::ArgumentError, "request must be provided" if request.nil?
1232
+
1233
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest
1234
+
1235
+ # Converts hash and nil to an options object
1236
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1237
+
1238
+ # Customize the options with defaults
1239
+ call_metadata = @config.rpcs.get_grpc_route.metadata.to_h
1240
+
1241
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1242
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1243
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1244
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1245
+ transports_version_send: [:rest]
1246
+
1247
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1248
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1249
+
1250
+ options.apply_defaults timeout: @config.rpcs.get_grpc_route.timeout,
1251
+ metadata: call_metadata,
1252
+ retry_policy: @config.rpcs.get_grpc_route.retry_policy
1253
+
1254
+ options.apply_defaults timeout: @config.timeout,
1255
+ metadata: @config.metadata,
1256
+ retry_policy: @config.retry_policy
1257
+
1258
+ @network_services_stub.get_grpc_route request, options do |result, operation|
1259
+ yield result, operation if block_given?
1260
+ return result
1261
+ end
1262
+ rescue ::Gapic::Rest::Error => e
1263
+ raise ::Google::Cloud::Error.from_error(e)
1264
+ end
1265
+
1266
+ ##
1267
+ # Creates a new GrpcRoute in a given project and location.
1268
+ #
1269
+ # @overload create_grpc_route(request, options = nil)
1270
+ # Pass arguments to `create_grpc_route` via a request object, either of type
1271
+ # {::Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest} or an equivalent Hash.
1272
+ #
1273
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest, ::Hash]
1274
+ # A request object representing the call parameters. Required. To specify no
1275
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1276
+ # @param options [::Gapic::CallOptions, ::Hash]
1277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1278
+ #
1279
+ # @overload create_grpc_route(parent: nil, grpc_route_id: nil, grpc_route: nil)
1280
+ # Pass arguments to `create_grpc_route` via keyword arguments. Note that at
1281
+ # least one keyword argument is required. To specify no parameters, or to keep all
1282
+ # the default parameter values, pass an empty Hash as a request object (see above).
1283
+ #
1284
+ # @param parent [::String]
1285
+ # Required. The parent resource of the GrpcRoute. Must be in the
1286
+ # format `projects/*/locations/global`.
1287
+ # @param grpc_route_id [::String]
1288
+ # Required. Short name of the GrpcRoute resource to be created.
1289
+ # @param grpc_route [::Google::Cloud::NetworkServices::V1::GrpcRoute, ::Hash]
1290
+ # Required. GrpcRoute resource to be created.
1291
+ # @yield [result, operation] Access the result along with the TransportOperation object
1292
+ # @yieldparam result [::Gapic::Operation]
1293
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1294
+ #
1295
+ # @return [::Gapic::Operation]
1296
+ #
1297
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1298
+ #
1299
+ # @example Basic example
1300
+ # require "google/cloud/network_services/v1"
1301
+ #
1302
+ # # Create a client object. The client can be reused for multiple calls.
1303
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1304
+ #
1305
+ # # Create a request. To set request fields, pass in keyword arguments.
1306
+ # request = Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest.new
1307
+ #
1308
+ # # Call the create_grpc_route method.
1309
+ # result = client.create_grpc_route request
1310
+ #
1311
+ # # The returned object is of type Gapic::Operation. You can use it to
1312
+ # # check the status of an operation, cancel it, or wait for results.
1313
+ # # Here is how to wait for a response.
1314
+ # result.wait_until_done! timeout: 60
1315
+ # if result.response?
1316
+ # p result.response
1317
+ # else
1318
+ # puts "No response received."
1319
+ # end
1320
+ #
1321
+ def create_grpc_route request, options = nil
1322
+ raise ::ArgumentError, "request must be provided" if request.nil?
1323
+
1324
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest
1325
+
1326
+ # Converts hash and nil to an options object
1327
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1328
+
1329
+ # Customize the options with defaults
1330
+ call_metadata = @config.rpcs.create_grpc_route.metadata.to_h
1331
+
1332
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1333
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1334
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1335
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1336
+ transports_version_send: [:rest]
1337
+
1338
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1339
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1340
+
1341
+ options.apply_defaults timeout: @config.rpcs.create_grpc_route.timeout,
1342
+ metadata: call_metadata,
1343
+ retry_policy: @config.rpcs.create_grpc_route.retry_policy
1344
+
1345
+ options.apply_defaults timeout: @config.timeout,
1346
+ metadata: @config.metadata,
1347
+ retry_policy: @config.retry_policy
1348
+
1349
+ @network_services_stub.create_grpc_route request, options do |result, operation|
1350
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1351
+ yield result, operation if block_given?
1352
+ return result
1353
+ end
1354
+ rescue ::Gapic::Rest::Error => e
1355
+ raise ::Google::Cloud::Error.from_error(e)
1356
+ end
1357
+
1358
+ ##
1359
+ # Updates the parameters of a single GrpcRoute.
1360
+ #
1361
+ # @overload update_grpc_route(request, options = nil)
1362
+ # Pass arguments to `update_grpc_route` via a request object, either of type
1363
+ # {::Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest} or an equivalent Hash.
1364
+ #
1365
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest, ::Hash]
1366
+ # A request object representing the call parameters. Required. To specify no
1367
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1368
+ # @param options [::Gapic::CallOptions, ::Hash]
1369
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1370
+ #
1371
+ # @overload update_grpc_route(update_mask: nil, grpc_route: nil)
1372
+ # Pass arguments to `update_grpc_route` via keyword arguments. Note that at
1373
+ # least one keyword argument is required. To specify no parameters, or to keep all
1374
+ # the default parameter values, pass an empty Hash as a request object (see above).
1375
+ #
1376
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1377
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1378
+ # GrpcRoute resource by the update.
1379
+ # The fields specified in the update_mask are relative to the resource, not
1380
+ # the full request. A field will be overwritten if it is in the mask. If the
1381
+ # user does not provide a mask then all fields will be overwritten.
1382
+ # @param grpc_route [::Google::Cloud::NetworkServices::V1::GrpcRoute, ::Hash]
1383
+ # Required. Updated GrpcRoute resource.
1384
+ # @yield [result, operation] Access the result along with the TransportOperation object
1385
+ # @yieldparam result [::Gapic::Operation]
1386
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1387
+ #
1388
+ # @return [::Gapic::Operation]
1389
+ #
1390
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1391
+ #
1392
+ # @example Basic example
1393
+ # require "google/cloud/network_services/v1"
1394
+ #
1395
+ # # Create a client object. The client can be reused for multiple calls.
1396
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1397
+ #
1398
+ # # Create a request. To set request fields, pass in keyword arguments.
1399
+ # request = Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest.new
1400
+ #
1401
+ # # Call the update_grpc_route method.
1402
+ # result = client.update_grpc_route request
1403
+ #
1404
+ # # The returned object is of type Gapic::Operation. You can use it to
1405
+ # # check the status of an operation, cancel it, or wait for results.
1406
+ # # Here is how to wait for a response.
1407
+ # result.wait_until_done! timeout: 60
1408
+ # if result.response?
1409
+ # p result.response
1410
+ # else
1411
+ # puts "No response received."
1412
+ # end
1413
+ #
1414
+ def update_grpc_route request, options = nil
1415
+ raise ::ArgumentError, "request must be provided" if request.nil?
1416
+
1417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest
1418
+
1419
+ # Converts hash and nil to an options object
1420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1421
+
1422
+ # Customize the options with defaults
1423
+ call_metadata = @config.rpcs.update_grpc_route.metadata.to_h
1424
+
1425
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1426
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1428
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1429
+ transports_version_send: [:rest]
1430
+
1431
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1432
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1433
+
1434
+ options.apply_defaults timeout: @config.rpcs.update_grpc_route.timeout,
1435
+ metadata: call_metadata,
1436
+ retry_policy: @config.rpcs.update_grpc_route.retry_policy
1437
+
1438
+ options.apply_defaults timeout: @config.timeout,
1439
+ metadata: @config.metadata,
1440
+ retry_policy: @config.retry_policy
1441
+
1442
+ @network_services_stub.update_grpc_route request, options do |result, operation|
1443
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1444
+ yield result, operation if block_given?
1445
+ return result
1446
+ end
1447
+ rescue ::Gapic::Rest::Error => e
1448
+ raise ::Google::Cloud::Error.from_error(e)
1449
+ end
1450
+
1451
+ ##
1452
+ # Deletes a single GrpcRoute.
1453
+ #
1454
+ # @overload delete_grpc_route(request, options = nil)
1455
+ # Pass arguments to `delete_grpc_route` via a request object, either of type
1456
+ # {::Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest} or an equivalent Hash.
1457
+ #
1458
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest, ::Hash]
1459
+ # A request object representing the call parameters. Required. To specify no
1460
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1461
+ # @param options [::Gapic::CallOptions, ::Hash]
1462
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1463
+ #
1464
+ # @overload delete_grpc_route(name: nil)
1465
+ # Pass arguments to `delete_grpc_route` via keyword arguments. Note that at
1466
+ # least one keyword argument is required. To specify no parameters, or to keep all
1467
+ # the default parameter values, pass an empty Hash as a request object (see above).
1468
+ #
1469
+ # @param name [::String]
1470
+ # Required. A name of the GrpcRoute to delete. Must be in the format
1471
+ # `projects/*/locations/global/grpcRoutes/*`.
1472
+ # @yield [result, operation] Access the result along with the TransportOperation object
1473
+ # @yieldparam result [::Gapic::Operation]
1474
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1475
+ #
1476
+ # @return [::Gapic::Operation]
1477
+ #
1478
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1479
+ #
1480
+ # @example Basic example
1481
+ # require "google/cloud/network_services/v1"
1482
+ #
1483
+ # # Create a client object. The client can be reused for multiple calls.
1484
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1485
+ #
1486
+ # # Create a request. To set request fields, pass in keyword arguments.
1487
+ # request = Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest.new
1488
+ #
1489
+ # # Call the delete_grpc_route method.
1490
+ # result = client.delete_grpc_route request
1491
+ #
1492
+ # # The returned object is of type Gapic::Operation. You can use it to
1493
+ # # check the status of an operation, cancel it, or wait for results.
1494
+ # # Here is how to wait for a response.
1495
+ # result.wait_until_done! timeout: 60
1496
+ # if result.response?
1497
+ # p result.response
1498
+ # else
1499
+ # puts "No response received."
1500
+ # end
1501
+ #
1502
+ def delete_grpc_route request, options = nil
1503
+ raise ::ArgumentError, "request must be provided" if request.nil?
1504
+
1505
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest
1506
+
1507
+ # Converts hash and nil to an options object
1508
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1509
+
1510
+ # Customize the options with defaults
1511
+ call_metadata = @config.rpcs.delete_grpc_route.metadata.to_h
1512
+
1513
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1514
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1515
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1516
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1517
+ transports_version_send: [:rest]
1518
+
1519
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1520
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1521
+
1522
+ options.apply_defaults timeout: @config.rpcs.delete_grpc_route.timeout,
1523
+ metadata: call_metadata,
1524
+ retry_policy: @config.rpcs.delete_grpc_route.retry_policy
1525
+
1526
+ options.apply_defaults timeout: @config.timeout,
1527
+ metadata: @config.metadata,
1528
+ retry_policy: @config.retry_policy
1529
+
1530
+ @network_services_stub.delete_grpc_route request, options do |result, operation|
1531
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1532
+ yield result, operation if block_given?
1533
+ return result
1534
+ end
1535
+ rescue ::Gapic::Rest::Error => e
1536
+ raise ::Google::Cloud::Error.from_error(e)
1537
+ end
1538
+
1539
+ ##
1540
+ # Lists HttpRoute in a given project and location.
1541
+ #
1542
+ # @overload list_http_routes(request, options = nil)
1543
+ # Pass arguments to `list_http_routes` via a request object, either of type
1544
+ # {::Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest} or an equivalent Hash.
1545
+ #
1546
+ # @param request [::Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest, ::Hash]
1547
+ # A request object representing the call parameters. Required. To specify no
1548
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1549
+ # @param options [::Gapic::CallOptions, ::Hash]
1550
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1551
+ #
1552
+ # @overload list_http_routes(parent: nil, page_size: nil, page_token: nil)
1553
+ # Pass arguments to `list_http_routes` via keyword arguments. Note that at
1554
+ # least one keyword argument is required. To specify no parameters, or to keep all
1555
+ # the default parameter values, pass an empty Hash as a request object (see above).
1556
+ #
1557
+ # @param parent [::String]
1558
+ # Required. The project and location from which the HttpRoutes should be
1559
+ # listed, specified in the format `projects/*/locations/global`.
1560
+ # @param page_size [::Integer]
1561
+ # Maximum number of HttpRoutes to return per call.
1562
+ # @param page_token [::String]
1563
+ # The value returned by the last `ListHttpRoutesResponse`
1564
+ # Indicates that this is a continuation of a prior `ListHttpRoutes` call,
1565
+ # and that the system should return the next page of data.
1566
+ # @yield [result, operation] Access the result along with the TransportOperation object
1567
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::HttpRoute>]
1568
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1569
+ #
1570
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::HttpRoute>]
1571
+ #
1572
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1573
+ #
1574
+ # @example Basic example
1575
+ # require "google/cloud/network_services/v1"
1576
+ #
1577
+ # # Create a client object. The client can be reused for multiple calls.
1578
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1579
+ #
1580
+ # # Create a request. To set request fields, pass in keyword arguments.
1581
+ # request = Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest.new
1582
+ #
1583
+ # # Call the list_http_routes method.
1584
+ # result = client.list_http_routes request
1585
+ #
1586
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1587
+ # # over elements, and API calls will be issued to fetch pages as needed.
1588
+ # result.each do |item|
1589
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::HttpRoute.
1590
+ # p item
1591
+ # end
1592
+ #
1593
+ def list_http_routes request, options = nil
1594
+ raise ::ArgumentError, "request must be provided" if request.nil?
1595
+
1596
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest
1597
+
1598
+ # Converts hash and nil to an options object
1599
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1600
+
1601
+ # Customize the options with defaults
1602
+ call_metadata = @config.rpcs.list_http_routes.metadata.to_h
1603
+
1604
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1605
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1606
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1607
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1608
+ transports_version_send: [:rest]
1609
+
1610
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1611
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1612
+
1613
+ options.apply_defaults timeout: @config.rpcs.list_http_routes.timeout,
1614
+ metadata: call_metadata,
1615
+ retry_policy: @config.rpcs.list_http_routes.retry_policy
1616
+
1617
+ options.apply_defaults timeout: @config.timeout,
1618
+ metadata: @config.metadata,
1619
+ retry_policy: @config.retry_policy
1620
+
1621
+ @network_services_stub.list_http_routes request, options do |result, operation|
1622
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_http_routes, "http_routes", request, result, options
1623
+ yield result, operation if block_given?
1624
+ return result
1625
+ end
1626
+ rescue ::Gapic::Rest::Error => e
1627
+ raise ::Google::Cloud::Error.from_error(e)
1628
+ end
1629
+
1630
+ ##
1631
+ # Gets details of a single HttpRoute.
1632
+ #
1633
+ # @overload get_http_route(request, options = nil)
1634
+ # Pass arguments to `get_http_route` via a request object, either of type
1635
+ # {::Google::Cloud::NetworkServices::V1::GetHttpRouteRequest} or an equivalent Hash.
1636
+ #
1637
+ # @param request [::Google::Cloud::NetworkServices::V1::GetHttpRouteRequest, ::Hash]
1638
+ # A request object representing the call parameters. Required. To specify no
1639
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1640
+ # @param options [::Gapic::CallOptions, ::Hash]
1641
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1642
+ #
1643
+ # @overload get_http_route(name: nil)
1644
+ # Pass arguments to `get_http_route` via keyword arguments. Note that at
1645
+ # least one keyword argument is required. To specify no parameters, or to keep all
1646
+ # the default parameter values, pass an empty Hash as a request object (see above).
1647
+ #
1648
+ # @param name [::String]
1649
+ # Required. A name of the HttpRoute to get. Must be in the format
1650
+ # `projects/*/locations/global/httpRoutes/*`.
1651
+ # @yield [result, operation] Access the result along with the TransportOperation object
1652
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::HttpRoute]
1653
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1654
+ #
1655
+ # @return [::Google::Cloud::NetworkServices::V1::HttpRoute]
1656
+ #
1657
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1658
+ #
1659
+ # @example Basic example
1660
+ # require "google/cloud/network_services/v1"
1661
+ #
1662
+ # # Create a client object. The client can be reused for multiple calls.
1663
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1664
+ #
1665
+ # # Create a request. To set request fields, pass in keyword arguments.
1666
+ # request = Google::Cloud::NetworkServices::V1::GetHttpRouteRequest.new
1667
+ #
1668
+ # # Call the get_http_route method.
1669
+ # result = client.get_http_route request
1670
+ #
1671
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::HttpRoute.
1672
+ # p result
1673
+ #
1674
+ def get_http_route request, options = nil
1675
+ raise ::ArgumentError, "request must be provided" if request.nil?
1676
+
1677
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetHttpRouteRequest
1678
+
1679
+ # Converts hash and nil to an options object
1680
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1681
+
1682
+ # Customize the options with defaults
1683
+ call_metadata = @config.rpcs.get_http_route.metadata.to_h
1684
+
1685
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1686
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1687
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1688
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1689
+ transports_version_send: [:rest]
1690
+
1691
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1692
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1693
+
1694
+ options.apply_defaults timeout: @config.rpcs.get_http_route.timeout,
1695
+ metadata: call_metadata,
1696
+ retry_policy: @config.rpcs.get_http_route.retry_policy
1697
+
1698
+ options.apply_defaults timeout: @config.timeout,
1699
+ metadata: @config.metadata,
1700
+ retry_policy: @config.retry_policy
1701
+
1702
+ @network_services_stub.get_http_route request, options do |result, operation|
1703
+ yield result, operation if block_given?
1704
+ return result
1705
+ end
1706
+ rescue ::Gapic::Rest::Error => e
1707
+ raise ::Google::Cloud::Error.from_error(e)
1708
+ end
1709
+
1710
+ ##
1711
+ # Creates a new HttpRoute in a given project and location.
1712
+ #
1713
+ # @overload create_http_route(request, options = nil)
1714
+ # Pass arguments to `create_http_route` via a request object, either of type
1715
+ # {::Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest} or an equivalent Hash.
1716
+ #
1717
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest, ::Hash]
1718
+ # A request object representing the call parameters. Required. To specify no
1719
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1720
+ # @param options [::Gapic::CallOptions, ::Hash]
1721
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1722
+ #
1723
+ # @overload create_http_route(parent: nil, http_route_id: nil, http_route: nil)
1724
+ # Pass arguments to `create_http_route` via keyword arguments. Note that at
1725
+ # least one keyword argument is required. To specify no parameters, or to keep all
1726
+ # the default parameter values, pass an empty Hash as a request object (see above).
1727
+ #
1728
+ # @param parent [::String]
1729
+ # Required. The parent resource of the HttpRoute. Must be in the
1730
+ # format `projects/*/locations/global`.
1731
+ # @param http_route_id [::String]
1732
+ # Required. Short name of the HttpRoute resource to be created.
1733
+ # @param http_route [::Google::Cloud::NetworkServices::V1::HttpRoute, ::Hash]
1734
+ # Required. HttpRoute resource to be created.
1735
+ # @yield [result, operation] Access the result along with the TransportOperation object
1736
+ # @yieldparam result [::Gapic::Operation]
1737
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1738
+ #
1739
+ # @return [::Gapic::Operation]
1740
+ #
1741
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1742
+ #
1743
+ # @example Basic example
1744
+ # require "google/cloud/network_services/v1"
1745
+ #
1746
+ # # Create a client object. The client can be reused for multiple calls.
1747
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1748
+ #
1749
+ # # Create a request. To set request fields, pass in keyword arguments.
1750
+ # request = Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest.new
1751
+ #
1752
+ # # Call the create_http_route method.
1753
+ # result = client.create_http_route request
1754
+ #
1755
+ # # The returned object is of type Gapic::Operation. You can use it to
1756
+ # # check the status of an operation, cancel it, or wait for results.
1757
+ # # Here is how to wait for a response.
1758
+ # result.wait_until_done! timeout: 60
1759
+ # if result.response?
1760
+ # p result.response
1761
+ # else
1762
+ # puts "No response received."
1763
+ # end
1764
+ #
1765
+ def create_http_route request, options = nil
1766
+ raise ::ArgumentError, "request must be provided" if request.nil?
1767
+
1768
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest
1769
+
1770
+ # Converts hash and nil to an options object
1771
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1772
+
1773
+ # Customize the options with defaults
1774
+ call_metadata = @config.rpcs.create_http_route.metadata.to_h
1775
+
1776
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1777
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1778
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1779
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1780
+ transports_version_send: [:rest]
1781
+
1782
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1783
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1784
+
1785
+ options.apply_defaults timeout: @config.rpcs.create_http_route.timeout,
1786
+ metadata: call_metadata,
1787
+ retry_policy: @config.rpcs.create_http_route.retry_policy
1788
+
1789
+ options.apply_defaults timeout: @config.timeout,
1790
+ metadata: @config.metadata,
1791
+ retry_policy: @config.retry_policy
1792
+
1793
+ @network_services_stub.create_http_route request, options do |result, operation|
1794
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1795
+ yield result, operation if block_given?
1796
+ return result
1797
+ end
1798
+ rescue ::Gapic::Rest::Error => e
1799
+ raise ::Google::Cloud::Error.from_error(e)
1800
+ end
1801
+
1802
+ ##
1803
+ # Updates the parameters of a single HttpRoute.
1804
+ #
1805
+ # @overload update_http_route(request, options = nil)
1806
+ # Pass arguments to `update_http_route` via a request object, either of type
1807
+ # {::Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest} or an equivalent Hash.
1808
+ #
1809
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest, ::Hash]
1810
+ # A request object representing the call parameters. Required. To specify no
1811
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1812
+ # @param options [::Gapic::CallOptions, ::Hash]
1813
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1814
+ #
1815
+ # @overload update_http_route(update_mask: nil, http_route: nil)
1816
+ # Pass arguments to `update_http_route` via keyword arguments. Note that at
1817
+ # least one keyword argument is required. To specify no parameters, or to keep all
1818
+ # the default parameter values, pass an empty Hash as a request object (see above).
1819
+ #
1820
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1821
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1822
+ # HttpRoute resource by the update.
1823
+ # The fields specified in the update_mask are relative to the resource, not
1824
+ # the full request. A field will be overwritten if it is in the mask. If the
1825
+ # user does not provide a mask then all fields will be overwritten.
1826
+ # @param http_route [::Google::Cloud::NetworkServices::V1::HttpRoute, ::Hash]
1827
+ # Required. Updated HttpRoute resource.
1828
+ # @yield [result, operation] Access the result along with the TransportOperation object
1829
+ # @yieldparam result [::Gapic::Operation]
1830
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1831
+ #
1832
+ # @return [::Gapic::Operation]
1833
+ #
1834
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1835
+ #
1836
+ # @example Basic example
1837
+ # require "google/cloud/network_services/v1"
1838
+ #
1839
+ # # Create a client object. The client can be reused for multiple calls.
1840
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1841
+ #
1842
+ # # Create a request. To set request fields, pass in keyword arguments.
1843
+ # request = Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest.new
1844
+ #
1845
+ # # Call the update_http_route method.
1846
+ # result = client.update_http_route request
1847
+ #
1848
+ # # The returned object is of type Gapic::Operation. You can use it to
1849
+ # # check the status of an operation, cancel it, or wait for results.
1850
+ # # Here is how to wait for a response.
1851
+ # result.wait_until_done! timeout: 60
1852
+ # if result.response?
1853
+ # p result.response
1854
+ # else
1855
+ # puts "No response received."
1856
+ # end
1857
+ #
1858
+ def update_http_route request, options = nil
1859
+ raise ::ArgumentError, "request must be provided" if request.nil?
1860
+
1861
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest
1862
+
1863
+ # Converts hash and nil to an options object
1864
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1865
+
1866
+ # Customize the options with defaults
1867
+ call_metadata = @config.rpcs.update_http_route.metadata.to_h
1868
+
1869
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1870
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1871
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1872
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1873
+ transports_version_send: [:rest]
1874
+
1875
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1876
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1877
+
1878
+ options.apply_defaults timeout: @config.rpcs.update_http_route.timeout,
1879
+ metadata: call_metadata,
1880
+ retry_policy: @config.rpcs.update_http_route.retry_policy
1881
+
1882
+ options.apply_defaults timeout: @config.timeout,
1883
+ metadata: @config.metadata,
1884
+ retry_policy: @config.retry_policy
1885
+
1886
+ @network_services_stub.update_http_route request, options do |result, operation|
1887
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1888
+ yield result, operation if block_given?
1889
+ return result
1890
+ end
1891
+ rescue ::Gapic::Rest::Error => e
1892
+ raise ::Google::Cloud::Error.from_error(e)
1893
+ end
1894
+
1895
+ ##
1896
+ # Deletes a single HttpRoute.
1897
+ #
1898
+ # @overload delete_http_route(request, options = nil)
1899
+ # Pass arguments to `delete_http_route` via a request object, either of type
1900
+ # {::Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest} or an equivalent Hash.
1901
+ #
1902
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest, ::Hash]
1903
+ # A request object representing the call parameters. Required. To specify no
1904
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1905
+ # @param options [::Gapic::CallOptions, ::Hash]
1906
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1907
+ #
1908
+ # @overload delete_http_route(name: nil)
1909
+ # Pass arguments to `delete_http_route` via keyword arguments. Note that at
1910
+ # least one keyword argument is required. To specify no parameters, or to keep all
1911
+ # the default parameter values, pass an empty Hash as a request object (see above).
1912
+ #
1913
+ # @param name [::String]
1914
+ # Required. A name of the HttpRoute to delete. Must be in the format
1915
+ # `projects/*/locations/global/httpRoutes/*`.
1916
+ # @yield [result, operation] Access the result along with the TransportOperation object
1917
+ # @yieldparam result [::Gapic::Operation]
1918
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1919
+ #
1920
+ # @return [::Gapic::Operation]
1921
+ #
1922
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1923
+ #
1924
+ # @example Basic example
1925
+ # require "google/cloud/network_services/v1"
1926
+ #
1927
+ # # Create a client object. The client can be reused for multiple calls.
1928
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
1929
+ #
1930
+ # # Create a request. To set request fields, pass in keyword arguments.
1931
+ # request = Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest.new
1932
+ #
1933
+ # # Call the delete_http_route method.
1934
+ # result = client.delete_http_route request
1935
+ #
1936
+ # # The returned object is of type Gapic::Operation. You can use it to
1937
+ # # check the status of an operation, cancel it, or wait for results.
1938
+ # # Here is how to wait for a response.
1939
+ # result.wait_until_done! timeout: 60
1940
+ # if result.response?
1941
+ # p result.response
1942
+ # else
1943
+ # puts "No response received."
1944
+ # end
1945
+ #
1946
+ def delete_http_route request, options = nil
1947
+ raise ::ArgumentError, "request must be provided" if request.nil?
1948
+
1949
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest
1950
+
1951
+ # Converts hash and nil to an options object
1952
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1953
+
1954
+ # Customize the options with defaults
1955
+ call_metadata = @config.rpcs.delete_http_route.metadata.to_h
1956
+
1957
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1958
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1959
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1960
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
1961
+ transports_version_send: [:rest]
1962
+
1963
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1964
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1965
+
1966
+ options.apply_defaults timeout: @config.rpcs.delete_http_route.timeout,
1967
+ metadata: call_metadata,
1968
+ retry_policy: @config.rpcs.delete_http_route.retry_policy
1969
+
1970
+ options.apply_defaults timeout: @config.timeout,
1971
+ metadata: @config.metadata,
1972
+ retry_policy: @config.retry_policy
1973
+
1974
+ @network_services_stub.delete_http_route request, options do |result, operation|
1975
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1976
+ yield result, operation if block_given?
1977
+ return result
1978
+ end
1979
+ rescue ::Gapic::Rest::Error => e
1980
+ raise ::Google::Cloud::Error.from_error(e)
1981
+ end
1982
+
1983
+ ##
1984
+ # Lists TcpRoute in a given project and location.
1985
+ #
1986
+ # @overload list_tcp_routes(request, options = nil)
1987
+ # Pass arguments to `list_tcp_routes` via a request object, either of type
1988
+ # {::Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest} or an equivalent Hash.
1989
+ #
1990
+ # @param request [::Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest, ::Hash]
1991
+ # A request object representing the call parameters. Required. To specify no
1992
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1993
+ # @param options [::Gapic::CallOptions, ::Hash]
1994
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1995
+ #
1996
+ # @overload list_tcp_routes(parent: nil, page_size: nil, page_token: nil)
1997
+ # Pass arguments to `list_tcp_routes` via keyword arguments. Note that at
1998
+ # least one keyword argument is required. To specify no parameters, or to keep all
1999
+ # the default parameter values, pass an empty Hash as a request object (see above).
2000
+ #
2001
+ # @param parent [::String]
2002
+ # Required. The project and location from which the TcpRoutes should be
2003
+ # listed, specified in the format `projects/*/locations/global`.
2004
+ # @param page_size [::Integer]
2005
+ # Maximum number of TcpRoutes to return per call.
2006
+ # @param page_token [::String]
2007
+ # The value returned by the last `ListTcpRoutesResponse`
2008
+ # Indicates that this is a continuation of a prior `ListTcpRoutes` call,
2009
+ # and that the system should return the next page of data.
2010
+ # @yield [result, operation] Access the result along with the TransportOperation object
2011
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TcpRoute>]
2012
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2013
+ #
2014
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TcpRoute>]
2015
+ #
2016
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2017
+ #
2018
+ # @example Basic example
2019
+ # require "google/cloud/network_services/v1"
2020
+ #
2021
+ # # Create a client object. The client can be reused for multiple calls.
2022
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2023
+ #
2024
+ # # Create a request. To set request fields, pass in keyword arguments.
2025
+ # request = Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest.new
2026
+ #
2027
+ # # Call the list_tcp_routes method.
2028
+ # result = client.list_tcp_routes request
2029
+ #
2030
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2031
+ # # over elements, and API calls will be issued to fetch pages as needed.
2032
+ # result.each do |item|
2033
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::TcpRoute.
2034
+ # p item
2035
+ # end
2036
+ #
2037
+ def list_tcp_routes request, options = nil
2038
+ raise ::ArgumentError, "request must be provided" if request.nil?
2039
+
2040
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest
2041
+
2042
+ # Converts hash and nil to an options object
2043
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2044
+
2045
+ # Customize the options with defaults
2046
+ call_metadata = @config.rpcs.list_tcp_routes.metadata.to_h
2047
+
2048
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2049
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2050
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2051
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2052
+ transports_version_send: [:rest]
2053
+
2054
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2055
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2056
+
2057
+ options.apply_defaults timeout: @config.rpcs.list_tcp_routes.timeout,
2058
+ metadata: call_metadata,
2059
+ retry_policy: @config.rpcs.list_tcp_routes.retry_policy
2060
+
2061
+ options.apply_defaults timeout: @config.timeout,
2062
+ metadata: @config.metadata,
2063
+ retry_policy: @config.retry_policy
2064
+
2065
+ @network_services_stub.list_tcp_routes request, options do |result, operation|
2066
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_tcp_routes, "tcp_routes", request, result, options
2067
+ yield result, operation if block_given?
2068
+ return result
2069
+ end
2070
+ rescue ::Gapic::Rest::Error => e
2071
+ raise ::Google::Cloud::Error.from_error(e)
2072
+ end
2073
+
2074
+ ##
2075
+ # Gets details of a single TcpRoute.
2076
+ #
2077
+ # @overload get_tcp_route(request, options = nil)
2078
+ # Pass arguments to `get_tcp_route` via a request object, either of type
2079
+ # {::Google::Cloud::NetworkServices::V1::GetTcpRouteRequest} or an equivalent Hash.
2080
+ #
2081
+ # @param request [::Google::Cloud::NetworkServices::V1::GetTcpRouteRequest, ::Hash]
2082
+ # A request object representing the call parameters. Required. To specify no
2083
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2084
+ # @param options [::Gapic::CallOptions, ::Hash]
2085
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2086
+ #
2087
+ # @overload get_tcp_route(name: nil)
2088
+ # Pass arguments to `get_tcp_route` via keyword arguments. Note that at
2089
+ # least one keyword argument is required. To specify no parameters, or to keep all
2090
+ # the default parameter values, pass an empty Hash as a request object (see above).
2091
+ #
2092
+ # @param name [::String]
2093
+ # Required. A name of the TcpRoute to get. Must be in the format
2094
+ # `projects/*/locations/global/tcpRoutes/*`.
2095
+ # @yield [result, operation] Access the result along with the TransportOperation object
2096
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::TcpRoute]
2097
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2098
+ #
2099
+ # @return [::Google::Cloud::NetworkServices::V1::TcpRoute]
2100
+ #
2101
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2102
+ #
2103
+ # @example Basic example
2104
+ # require "google/cloud/network_services/v1"
2105
+ #
2106
+ # # Create a client object. The client can be reused for multiple calls.
2107
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2108
+ #
2109
+ # # Create a request. To set request fields, pass in keyword arguments.
2110
+ # request = Google::Cloud::NetworkServices::V1::GetTcpRouteRequest.new
2111
+ #
2112
+ # # Call the get_tcp_route method.
2113
+ # result = client.get_tcp_route request
2114
+ #
2115
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::TcpRoute.
2116
+ # p result
2117
+ #
2118
+ def get_tcp_route request, options = nil
2119
+ raise ::ArgumentError, "request must be provided" if request.nil?
2120
+
2121
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetTcpRouteRequest
2122
+
2123
+ # Converts hash and nil to an options object
2124
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2125
+
2126
+ # Customize the options with defaults
2127
+ call_metadata = @config.rpcs.get_tcp_route.metadata.to_h
2128
+
2129
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2130
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2131
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2132
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2133
+ transports_version_send: [:rest]
2134
+
2135
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2136
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2137
+
2138
+ options.apply_defaults timeout: @config.rpcs.get_tcp_route.timeout,
2139
+ metadata: call_metadata,
2140
+ retry_policy: @config.rpcs.get_tcp_route.retry_policy
2141
+
2142
+ options.apply_defaults timeout: @config.timeout,
2143
+ metadata: @config.metadata,
2144
+ retry_policy: @config.retry_policy
2145
+
2146
+ @network_services_stub.get_tcp_route request, options do |result, operation|
2147
+ yield result, operation if block_given?
2148
+ return result
2149
+ end
2150
+ rescue ::Gapic::Rest::Error => e
2151
+ raise ::Google::Cloud::Error.from_error(e)
2152
+ end
2153
+
2154
+ ##
2155
+ # Creates a new TcpRoute in a given project and location.
2156
+ #
2157
+ # @overload create_tcp_route(request, options = nil)
2158
+ # Pass arguments to `create_tcp_route` via a request object, either of type
2159
+ # {::Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest} or an equivalent Hash.
2160
+ #
2161
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest, ::Hash]
2162
+ # A request object representing the call parameters. Required. To specify no
2163
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2164
+ # @param options [::Gapic::CallOptions, ::Hash]
2165
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2166
+ #
2167
+ # @overload create_tcp_route(parent: nil, tcp_route_id: nil, tcp_route: nil)
2168
+ # Pass arguments to `create_tcp_route` via keyword arguments. Note that at
2169
+ # least one keyword argument is required. To specify no parameters, or to keep all
2170
+ # the default parameter values, pass an empty Hash as a request object (see above).
2171
+ #
2172
+ # @param parent [::String]
2173
+ # Required. The parent resource of the TcpRoute. Must be in the
2174
+ # format `projects/*/locations/global`.
2175
+ # @param tcp_route_id [::String]
2176
+ # Required. Short name of the TcpRoute resource to be created.
2177
+ # @param tcp_route [::Google::Cloud::NetworkServices::V1::TcpRoute, ::Hash]
2178
+ # Required. TcpRoute resource to be created.
2179
+ # @yield [result, operation] Access the result along with the TransportOperation object
2180
+ # @yieldparam result [::Gapic::Operation]
2181
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2182
+ #
2183
+ # @return [::Gapic::Operation]
2184
+ #
2185
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2186
+ #
2187
+ # @example Basic example
2188
+ # require "google/cloud/network_services/v1"
2189
+ #
2190
+ # # Create a client object. The client can be reused for multiple calls.
2191
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2192
+ #
2193
+ # # Create a request. To set request fields, pass in keyword arguments.
2194
+ # request = Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest.new
2195
+ #
2196
+ # # Call the create_tcp_route method.
2197
+ # result = client.create_tcp_route request
2198
+ #
2199
+ # # The returned object is of type Gapic::Operation. You can use it to
2200
+ # # check the status of an operation, cancel it, or wait for results.
2201
+ # # Here is how to wait for a response.
2202
+ # result.wait_until_done! timeout: 60
2203
+ # if result.response?
2204
+ # p result.response
2205
+ # else
2206
+ # puts "No response received."
2207
+ # end
2208
+ #
2209
+ def create_tcp_route request, options = nil
2210
+ raise ::ArgumentError, "request must be provided" if request.nil?
2211
+
2212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest
2213
+
2214
+ # Converts hash and nil to an options object
2215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2216
+
2217
+ # Customize the options with defaults
2218
+ call_metadata = @config.rpcs.create_tcp_route.metadata.to_h
2219
+
2220
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2221
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2223
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2224
+ transports_version_send: [:rest]
2225
+
2226
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2227
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2228
+
2229
+ options.apply_defaults timeout: @config.rpcs.create_tcp_route.timeout,
2230
+ metadata: call_metadata,
2231
+ retry_policy: @config.rpcs.create_tcp_route.retry_policy
2232
+
2233
+ options.apply_defaults timeout: @config.timeout,
2234
+ metadata: @config.metadata,
2235
+ retry_policy: @config.retry_policy
2236
+
2237
+ @network_services_stub.create_tcp_route request, options do |result, operation|
2238
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2239
+ yield result, operation if block_given?
2240
+ return result
2241
+ end
2242
+ rescue ::Gapic::Rest::Error => e
2243
+ raise ::Google::Cloud::Error.from_error(e)
2244
+ end
2245
+
2246
+ ##
2247
+ # Updates the parameters of a single TcpRoute.
2248
+ #
2249
+ # @overload update_tcp_route(request, options = nil)
2250
+ # Pass arguments to `update_tcp_route` via a request object, either of type
2251
+ # {::Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest} or an equivalent Hash.
2252
+ #
2253
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest, ::Hash]
2254
+ # A request object representing the call parameters. Required. To specify no
2255
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2256
+ # @param options [::Gapic::CallOptions, ::Hash]
2257
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2258
+ #
2259
+ # @overload update_tcp_route(update_mask: nil, tcp_route: nil)
2260
+ # Pass arguments to `update_tcp_route` via keyword arguments. Note that at
2261
+ # least one keyword argument is required. To specify no parameters, or to keep all
2262
+ # the default parameter values, pass an empty Hash as a request object (see above).
2263
+ #
2264
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2265
+ # Optional. Field mask is used to specify the fields to be overwritten in the
2266
+ # TcpRoute resource by the update.
2267
+ # The fields specified in the update_mask are relative to the resource, not
2268
+ # the full request. A field will be overwritten if it is in the mask. If the
2269
+ # user does not provide a mask then all fields will be overwritten.
2270
+ # @param tcp_route [::Google::Cloud::NetworkServices::V1::TcpRoute, ::Hash]
2271
+ # Required. Updated TcpRoute resource.
2272
+ # @yield [result, operation] Access the result along with the TransportOperation object
2273
+ # @yieldparam result [::Gapic::Operation]
2274
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2275
+ #
2276
+ # @return [::Gapic::Operation]
2277
+ #
2278
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2279
+ #
2280
+ # @example Basic example
2281
+ # require "google/cloud/network_services/v1"
2282
+ #
2283
+ # # Create a client object. The client can be reused for multiple calls.
2284
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2285
+ #
2286
+ # # Create a request. To set request fields, pass in keyword arguments.
2287
+ # request = Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest.new
2288
+ #
2289
+ # # Call the update_tcp_route method.
2290
+ # result = client.update_tcp_route request
2291
+ #
2292
+ # # The returned object is of type Gapic::Operation. You can use it to
2293
+ # # check the status of an operation, cancel it, or wait for results.
2294
+ # # Here is how to wait for a response.
2295
+ # result.wait_until_done! timeout: 60
2296
+ # if result.response?
2297
+ # p result.response
2298
+ # else
2299
+ # puts "No response received."
2300
+ # end
2301
+ #
2302
+ def update_tcp_route request, options = nil
2303
+ raise ::ArgumentError, "request must be provided" if request.nil?
2304
+
2305
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest
2306
+
2307
+ # Converts hash and nil to an options object
2308
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2309
+
2310
+ # Customize the options with defaults
2311
+ call_metadata = @config.rpcs.update_tcp_route.metadata.to_h
2312
+
2313
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2314
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2315
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2316
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2317
+ transports_version_send: [:rest]
2318
+
2319
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2320
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2321
+
2322
+ options.apply_defaults timeout: @config.rpcs.update_tcp_route.timeout,
2323
+ metadata: call_metadata,
2324
+ retry_policy: @config.rpcs.update_tcp_route.retry_policy
2325
+
2326
+ options.apply_defaults timeout: @config.timeout,
2327
+ metadata: @config.metadata,
2328
+ retry_policy: @config.retry_policy
2329
+
2330
+ @network_services_stub.update_tcp_route request, options do |result, operation|
2331
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2332
+ yield result, operation if block_given?
2333
+ return result
2334
+ end
2335
+ rescue ::Gapic::Rest::Error => e
2336
+ raise ::Google::Cloud::Error.from_error(e)
2337
+ end
2338
+
2339
+ ##
2340
+ # Deletes a single TcpRoute.
2341
+ #
2342
+ # @overload delete_tcp_route(request, options = nil)
2343
+ # Pass arguments to `delete_tcp_route` via a request object, either of type
2344
+ # {::Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest} or an equivalent Hash.
2345
+ #
2346
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest, ::Hash]
2347
+ # A request object representing the call parameters. Required. To specify no
2348
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2349
+ # @param options [::Gapic::CallOptions, ::Hash]
2350
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2351
+ #
2352
+ # @overload delete_tcp_route(name: nil)
2353
+ # Pass arguments to `delete_tcp_route` via keyword arguments. Note that at
2354
+ # least one keyword argument is required. To specify no parameters, or to keep all
2355
+ # the default parameter values, pass an empty Hash as a request object (see above).
2356
+ #
2357
+ # @param name [::String]
2358
+ # Required. A name of the TcpRoute to delete. Must be in the format
2359
+ # `projects/*/locations/global/tcpRoutes/*`.
2360
+ # @yield [result, operation] Access the result along with the TransportOperation object
2361
+ # @yieldparam result [::Gapic::Operation]
2362
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2363
+ #
2364
+ # @return [::Gapic::Operation]
2365
+ #
2366
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2367
+ #
2368
+ # @example Basic example
2369
+ # require "google/cloud/network_services/v1"
2370
+ #
2371
+ # # Create a client object. The client can be reused for multiple calls.
2372
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2373
+ #
2374
+ # # Create a request. To set request fields, pass in keyword arguments.
2375
+ # request = Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest.new
2376
+ #
2377
+ # # Call the delete_tcp_route method.
2378
+ # result = client.delete_tcp_route request
2379
+ #
2380
+ # # The returned object is of type Gapic::Operation. You can use it to
2381
+ # # check the status of an operation, cancel it, or wait for results.
2382
+ # # Here is how to wait for a response.
2383
+ # result.wait_until_done! timeout: 60
2384
+ # if result.response?
2385
+ # p result.response
2386
+ # else
2387
+ # puts "No response received."
2388
+ # end
2389
+ #
2390
+ def delete_tcp_route request, options = nil
2391
+ raise ::ArgumentError, "request must be provided" if request.nil?
2392
+
2393
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest
2394
+
2395
+ # Converts hash and nil to an options object
2396
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2397
+
2398
+ # Customize the options with defaults
2399
+ call_metadata = @config.rpcs.delete_tcp_route.metadata.to_h
2400
+
2401
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2402
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2403
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2404
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2405
+ transports_version_send: [:rest]
2406
+
2407
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2408
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2409
+
2410
+ options.apply_defaults timeout: @config.rpcs.delete_tcp_route.timeout,
2411
+ metadata: call_metadata,
2412
+ retry_policy: @config.rpcs.delete_tcp_route.retry_policy
2413
+
2414
+ options.apply_defaults timeout: @config.timeout,
2415
+ metadata: @config.metadata,
2416
+ retry_policy: @config.retry_policy
2417
+
2418
+ @network_services_stub.delete_tcp_route request, options do |result, operation|
2419
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2420
+ yield result, operation if block_given?
2421
+ return result
2422
+ end
2423
+ rescue ::Gapic::Rest::Error => e
2424
+ raise ::Google::Cloud::Error.from_error(e)
2425
+ end
2426
+
2427
+ ##
2428
+ # Lists TlsRoute in a given project and location.
2429
+ #
2430
+ # @overload list_tls_routes(request, options = nil)
2431
+ # Pass arguments to `list_tls_routes` via a request object, either of type
2432
+ # {::Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest} or an equivalent Hash.
2433
+ #
2434
+ # @param request [::Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest, ::Hash]
2435
+ # A request object representing the call parameters. Required. To specify no
2436
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2437
+ # @param options [::Gapic::CallOptions, ::Hash]
2438
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2439
+ #
2440
+ # @overload list_tls_routes(parent: nil, page_size: nil, page_token: nil)
2441
+ # Pass arguments to `list_tls_routes` via keyword arguments. Note that at
2442
+ # least one keyword argument is required. To specify no parameters, or to keep all
2443
+ # the default parameter values, pass an empty Hash as a request object (see above).
2444
+ #
2445
+ # @param parent [::String]
2446
+ # Required. The project and location from which the TlsRoutes should be
2447
+ # listed, specified in the format `projects/*/locations/global`.
2448
+ # @param page_size [::Integer]
2449
+ # Maximum number of TlsRoutes to return per call.
2450
+ # @param page_token [::String]
2451
+ # The value returned by the last `ListTlsRoutesResponse`
2452
+ # Indicates that this is a continuation of a prior `ListTlsRoutes` call,
2453
+ # and that the system should return the next page of data.
2454
+ # @yield [result, operation] Access the result along with the TransportOperation object
2455
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TlsRoute>]
2456
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2457
+ #
2458
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TlsRoute>]
2459
+ #
2460
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2461
+ #
2462
+ # @example Basic example
2463
+ # require "google/cloud/network_services/v1"
2464
+ #
2465
+ # # Create a client object. The client can be reused for multiple calls.
2466
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2467
+ #
2468
+ # # Create a request. To set request fields, pass in keyword arguments.
2469
+ # request = Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest.new
2470
+ #
2471
+ # # Call the list_tls_routes method.
2472
+ # result = client.list_tls_routes request
2473
+ #
2474
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2475
+ # # over elements, and API calls will be issued to fetch pages as needed.
2476
+ # result.each do |item|
2477
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::TlsRoute.
2478
+ # p item
2479
+ # end
2480
+ #
2481
+ def list_tls_routes request, options = nil
2482
+ raise ::ArgumentError, "request must be provided" if request.nil?
2483
+
2484
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest
2485
+
2486
+ # Converts hash and nil to an options object
2487
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2488
+
2489
+ # Customize the options with defaults
2490
+ call_metadata = @config.rpcs.list_tls_routes.metadata.to_h
2491
+
2492
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2493
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2494
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2495
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2496
+ transports_version_send: [:rest]
2497
+
2498
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2499
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2500
+
2501
+ options.apply_defaults timeout: @config.rpcs.list_tls_routes.timeout,
2502
+ metadata: call_metadata,
2503
+ retry_policy: @config.rpcs.list_tls_routes.retry_policy
2504
+
2505
+ options.apply_defaults timeout: @config.timeout,
2506
+ metadata: @config.metadata,
2507
+ retry_policy: @config.retry_policy
2508
+
2509
+ @network_services_stub.list_tls_routes request, options do |result, operation|
2510
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_tls_routes, "tls_routes", request, result, options
2511
+ yield result, operation if block_given?
2512
+ return result
2513
+ end
2514
+ rescue ::Gapic::Rest::Error => e
2515
+ raise ::Google::Cloud::Error.from_error(e)
2516
+ end
2517
+
2518
+ ##
2519
+ # Gets details of a single TlsRoute.
2520
+ #
2521
+ # @overload get_tls_route(request, options = nil)
2522
+ # Pass arguments to `get_tls_route` via a request object, either of type
2523
+ # {::Google::Cloud::NetworkServices::V1::GetTlsRouteRequest} or an equivalent Hash.
2524
+ #
2525
+ # @param request [::Google::Cloud::NetworkServices::V1::GetTlsRouteRequest, ::Hash]
2526
+ # A request object representing the call parameters. Required. To specify no
2527
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2528
+ # @param options [::Gapic::CallOptions, ::Hash]
2529
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2530
+ #
2531
+ # @overload get_tls_route(name: nil)
2532
+ # Pass arguments to `get_tls_route` via keyword arguments. Note that at
2533
+ # least one keyword argument is required. To specify no parameters, or to keep all
2534
+ # the default parameter values, pass an empty Hash as a request object (see above).
2535
+ #
2536
+ # @param name [::String]
2537
+ # Required. A name of the TlsRoute to get. Must be in the format
2538
+ # `projects/*/locations/global/tlsRoutes/*`.
2539
+ # @yield [result, operation] Access the result along with the TransportOperation object
2540
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::TlsRoute]
2541
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2542
+ #
2543
+ # @return [::Google::Cloud::NetworkServices::V1::TlsRoute]
2544
+ #
2545
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2546
+ #
2547
+ # @example Basic example
2548
+ # require "google/cloud/network_services/v1"
2549
+ #
2550
+ # # Create a client object. The client can be reused for multiple calls.
2551
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2552
+ #
2553
+ # # Create a request. To set request fields, pass in keyword arguments.
2554
+ # request = Google::Cloud::NetworkServices::V1::GetTlsRouteRequest.new
2555
+ #
2556
+ # # Call the get_tls_route method.
2557
+ # result = client.get_tls_route request
2558
+ #
2559
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::TlsRoute.
2560
+ # p result
2561
+ #
2562
+ def get_tls_route request, options = nil
2563
+ raise ::ArgumentError, "request must be provided" if request.nil?
2564
+
2565
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetTlsRouteRequest
2566
+
2567
+ # Converts hash and nil to an options object
2568
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2569
+
2570
+ # Customize the options with defaults
2571
+ call_metadata = @config.rpcs.get_tls_route.metadata.to_h
2572
+
2573
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2574
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2575
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2576
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2577
+ transports_version_send: [:rest]
2578
+
2579
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2580
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2581
+
2582
+ options.apply_defaults timeout: @config.rpcs.get_tls_route.timeout,
2583
+ metadata: call_metadata,
2584
+ retry_policy: @config.rpcs.get_tls_route.retry_policy
2585
+
2586
+ options.apply_defaults timeout: @config.timeout,
2587
+ metadata: @config.metadata,
2588
+ retry_policy: @config.retry_policy
2589
+
2590
+ @network_services_stub.get_tls_route request, options do |result, operation|
2591
+ yield result, operation if block_given?
2592
+ return result
2593
+ end
2594
+ rescue ::Gapic::Rest::Error => e
2595
+ raise ::Google::Cloud::Error.from_error(e)
2596
+ end
2597
+
2598
+ ##
2599
+ # Creates a new TlsRoute in a given project and location.
2600
+ #
2601
+ # @overload create_tls_route(request, options = nil)
2602
+ # Pass arguments to `create_tls_route` via a request object, either of type
2603
+ # {::Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest} or an equivalent Hash.
2604
+ #
2605
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest, ::Hash]
2606
+ # A request object representing the call parameters. Required. To specify no
2607
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2608
+ # @param options [::Gapic::CallOptions, ::Hash]
2609
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2610
+ #
2611
+ # @overload create_tls_route(parent: nil, tls_route_id: nil, tls_route: nil)
2612
+ # Pass arguments to `create_tls_route` via keyword arguments. Note that at
2613
+ # least one keyword argument is required. To specify no parameters, or to keep all
2614
+ # the default parameter values, pass an empty Hash as a request object (see above).
2615
+ #
2616
+ # @param parent [::String]
2617
+ # Required. The parent resource of the TlsRoute. Must be in the
2618
+ # format `projects/*/locations/global`.
2619
+ # @param tls_route_id [::String]
2620
+ # Required. Short name of the TlsRoute resource to be created.
2621
+ # @param tls_route [::Google::Cloud::NetworkServices::V1::TlsRoute, ::Hash]
2622
+ # Required. TlsRoute resource to be created.
2623
+ # @yield [result, operation] Access the result along with the TransportOperation object
2624
+ # @yieldparam result [::Gapic::Operation]
2625
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2626
+ #
2627
+ # @return [::Gapic::Operation]
2628
+ #
2629
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2630
+ #
2631
+ # @example Basic example
2632
+ # require "google/cloud/network_services/v1"
2633
+ #
2634
+ # # Create a client object. The client can be reused for multiple calls.
2635
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2636
+ #
2637
+ # # Create a request. To set request fields, pass in keyword arguments.
2638
+ # request = Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest.new
2639
+ #
2640
+ # # Call the create_tls_route method.
2641
+ # result = client.create_tls_route request
2642
+ #
2643
+ # # The returned object is of type Gapic::Operation. You can use it to
2644
+ # # check the status of an operation, cancel it, or wait for results.
2645
+ # # Here is how to wait for a response.
2646
+ # result.wait_until_done! timeout: 60
2647
+ # if result.response?
2648
+ # p result.response
2649
+ # else
2650
+ # puts "No response received."
2651
+ # end
2652
+ #
2653
+ def create_tls_route request, options = nil
2654
+ raise ::ArgumentError, "request must be provided" if request.nil?
2655
+
2656
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest
2657
+
2658
+ # Converts hash and nil to an options object
2659
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2660
+
2661
+ # Customize the options with defaults
2662
+ call_metadata = @config.rpcs.create_tls_route.metadata.to_h
2663
+
2664
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2665
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2666
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2667
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2668
+ transports_version_send: [:rest]
2669
+
2670
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2671
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2672
+
2673
+ options.apply_defaults timeout: @config.rpcs.create_tls_route.timeout,
2674
+ metadata: call_metadata,
2675
+ retry_policy: @config.rpcs.create_tls_route.retry_policy
2676
+
2677
+ options.apply_defaults timeout: @config.timeout,
2678
+ metadata: @config.metadata,
2679
+ retry_policy: @config.retry_policy
2680
+
2681
+ @network_services_stub.create_tls_route request, options do |result, operation|
2682
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2683
+ yield result, operation if block_given?
2684
+ return result
2685
+ end
2686
+ rescue ::Gapic::Rest::Error => e
2687
+ raise ::Google::Cloud::Error.from_error(e)
2688
+ end
2689
+
2690
+ ##
2691
+ # Updates the parameters of a single TlsRoute.
2692
+ #
2693
+ # @overload update_tls_route(request, options = nil)
2694
+ # Pass arguments to `update_tls_route` via a request object, either of type
2695
+ # {::Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest} or an equivalent Hash.
2696
+ #
2697
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest, ::Hash]
2698
+ # A request object representing the call parameters. Required. To specify no
2699
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2700
+ # @param options [::Gapic::CallOptions, ::Hash]
2701
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2702
+ #
2703
+ # @overload update_tls_route(update_mask: nil, tls_route: nil)
2704
+ # Pass arguments to `update_tls_route` via keyword arguments. Note that at
2705
+ # least one keyword argument is required. To specify no parameters, or to keep all
2706
+ # the default parameter values, pass an empty Hash as a request object (see above).
2707
+ #
2708
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2709
+ # Optional. Field mask is used to specify the fields to be overwritten in the
2710
+ # TlsRoute resource by the update.
2711
+ # The fields specified in the update_mask are relative to the resource, not
2712
+ # the full request. A field will be overwritten if it is in the mask. If the
2713
+ # user does not provide a mask then all fields will be overwritten.
2714
+ # @param tls_route [::Google::Cloud::NetworkServices::V1::TlsRoute, ::Hash]
2715
+ # Required. Updated TlsRoute resource.
2716
+ # @yield [result, operation] Access the result along with the TransportOperation object
2717
+ # @yieldparam result [::Gapic::Operation]
2718
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2719
+ #
2720
+ # @return [::Gapic::Operation]
2721
+ #
2722
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2723
+ #
2724
+ # @example Basic example
2725
+ # require "google/cloud/network_services/v1"
2726
+ #
2727
+ # # Create a client object. The client can be reused for multiple calls.
2728
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2729
+ #
2730
+ # # Create a request. To set request fields, pass in keyword arguments.
2731
+ # request = Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest.new
2732
+ #
2733
+ # # Call the update_tls_route method.
2734
+ # result = client.update_tls_route request
2735
+ #
2736
+ # # The returned object is of type Gapic::Operation. You can use it to
2737
+ # # check the status of an operation, cancel it, or wait for results.
2738
+ # # Here is how to wait for a response.
2739
+ # result.wait_until_done! timeout: 60
2740
+ # if result.response?
2741
+ # p result.response
2742
+ # else
2743
+ # puts "No response received."
2744
+ # end
2745
+ #
2746
+ def update_tls_route request, options = nil
2747
+ raise ::ArgumentError, "request must be provided" if request.nil?
2748
+
2749
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest
2750
+
2751
+ # Converts hash and nil to an options object
2752
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2753
+
2754
+ # Customize the options with defaults
2755
+ call_metadata = @config.rpcs.update_tls_route.metadata.to_h
2756
+
2757
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2758
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2759
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2760
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2761
+ transports_version_send: [:rest]
2762
+
2763
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2764
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2765
+
2766
+ options.apply_defaults timeout: @config.rpcs.update_tls_route.timeout,
2767
+ metadata: call_metadata,
2768
+ retry_policy: @config.rpcs.update_tls_route.retry_policy
2769
+
2770
+ options.apply_defaults timeout: @config.timeout,
2771
+ metadata: @config.metadata,
2772
+ retry_policy: @config.retry_policy
2773
+
2774
+ @network_services_stub.update_tls_route request, options do |result, operation|
2775
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2776
+ yield result, operation if block_given?
2777
+ return result
2778
+ end
2779
+ rescue ::Gapic::Rest::Error => e
2780
+ raise ::Google::Cloud::Error.from_error(e)
2781
+ end
2782
+
2783
+ ##
2784
+ # Deletes a single TlsRoute.
2785
+ #
2786
+ # @overload delete_tls_route(request, options = nil)
2787
+ # Pass arguments to `delete_tls_route` via a request object, either of type
2788
+ # {::Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest} or an equivalent Hash.
2789
+ #
2790
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest, ::Hash]
2791
+ # A request object representing the call parameters. Required. To specify no
2792
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2793
+ # @param options [::Gapic::CallOptions, ::Hash]
2794
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2795
+ #
2796
+ # @overload delete_tls_route(name: nil)
2797
+ # Pass arguments to `delete_tls_route` via keyword arguments. Note that at
2798
+ # least one keyword argument is required. To specify no parameters, or to keep all
2799
+ # the default parameter values, pass an empty Hash as a request object (see above).
2800
+ #
2801
+ # @param name [::String]
2802
+ # Required. A name of the TlsRoute to delete. Must be in the format
2803
+ # `projects/*/locations/global/tlsRoutes/*`.
2804
+ # @yield [result, operation] Access the result along with the TransportOperation object
2805
+ # @yieldparam result [::Gapic::Operation]
2806
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2807
+ #
2808
+ # @return [::Gapic::Operation]
2809
+ #
2810
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2811
+ #
2812
+ # @example Basic example
2813
+ # require "google/cloud/network_services/v1"
2814
+ #
2815
+ # # Create a client object. The client can be reused for multiple calls.
2816
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2817
+ #
2818
+ # # Create a request. To set request fields, pass in keyword arguments.
2819
+ # request = Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest.new
2820
+ #
2821
+ # # Call the delete_tls_route method.
2822
+ # result = client.delete_tls_route request
2823
+ #
2824
+ # # The returned object is of type Gapic::Operation. You can use it to
2825
+ # # check the status of an operation, cancel it, or wait for results.
2826
+ # # Here is how to wait for a response.
2827
+ # result.wait_until_done! timeout: 60
2828
+ # if result.response?
2829
+ # p result.response
2830
+ # else
2831
+ # puts "No response received."
2832
+ # end
2833
+ #
2834
+ def delete_tls_route request, options = nil
2835
+ raise ::ArgumentError, "request must be provided" if request.nil?
2836
+
2837
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest
2838
+
2839
+ # Converts hash and nil to an options object
2840
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2841
+
2842
+ # Customize the options with defaults
2843
+ call_metadata = @config.rpcs.delete_tls_route.metadata.to_h
2844
+
2845
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2846
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2847
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2848
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2849
+ transports_version_send: [:rest]
2850
+
2851
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2852
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2853
+
2854
+ options.apply_defaults timeout: @config.rpcs.delete_tls_route.timeout,
2855
+ metadata: call_metadata,
2856
+ retry_policy: @config.rpcs.delete_tls_route.retry_policy
2857
+
2858
+ options.apply_defaults timeout: @config.timeout,
2859
+ metadata: @config.metadata,
2860
+ retry_policy: @config.retry_policy
2861
+
2862
+ @network_services_stub.delete_tls_route request, options do |result, operation|
2863
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2864
+ yield result, operation if block_given?
2865
+ return result
2866
+ end
2867
+ rescue ::Gapic::Rest::Error => e
2868
+ raise ::Google::Cloud::Error.from_error(e)
2869
+ end
2870
+
2871
+ ##
2872
+ # Lists ServiceBinding in a given project and location.
2873
+ #
2874
+ # @overload list_service_bindings(request, options = nil)
2875
+ # Pass arguments to `list_service_bindings` via a request object, either of type
2876
+ # {::Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest} or an equivalent Hash.
2877
+ #
2878
+ # @param request [::Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest, ::Hash]
2879
+ # A request object representing the call parameters. Required. To specify no
2880
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2881
+ # @param options [::Gapic::CallOptions, ::Hash]
2882
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2883
+ #
2884
+ # @overload list_service_bindings(parent: nil, page_size: nil, page_token: nil)
2885
+ # Pass arguments to `list_service_bindings` via keyword arguments. Note that at
2886
+ # least one keyword argument is required. To specify no parameters, or to keep all
2887
+ # the default parameter values, pass an empty Hash as a request object (see above).
2888
+ #
2889
+ # @param parent [::String]
2890
+ # Required. The project and location from which the ServiceBindings should be
2891
+ # listed, specified in the format `projects/*/locations/global`.
2892
+ # @param page_size [::Integer]
2893
+ # Maximum number of ServiceBindings to return per call.
2894
+ # @param page_token [::String]
2895
+ # The value returned by the last `ListServiceBindingsResponse`
2896
+ # Indicates that this is a continuation of a prior `ListRouters` call,
2897
+ # and that the system should return the next page of data.
2898
+ # @yield [result, operation] Access the result along with the TransportOperation object
2899
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::ServiceBinding>]
2900
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2901
+ #
2902
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::ServiceBinding>]
2903
+ #
2904
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2905
+ #
2906
+ # @example Basic example
2907
+ # require "google/cloud/network_services/v1"
2908
+ #
2909
+ # # Create a client object. The client can be reused for multiple calls.
2910
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2911
+ #
2912
+ # # Create a request. To set request fields, pass in keyword arguments.
2913
+ # request = Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest.new
2914
+ #
2915
+ # # Call the list_service_bindings method.
2916
+ # result = client.list_service_bindings request
2917
+ #
2918
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2919
+ # # over elements, and API calls will be issued to fetch pages as needed.
2920
+ # result.each do |item|
2921
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::ServiceBinding.
2922
+ # p item
2923
+ # end
2924
+ #
2925
+ def list_service_bindings request, options = nil
2926
+ raise ::ArgumentError, "request must be provided" if request.nil?
2927
+
2928
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest
2929
+
2930
+ # Converts hash and nil to an options object
2931
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2932
+
2933
+ # Customize the options with defaults
2934
+ call_metadata = @config.rpcs.list_service_bindings.metadata.to_h
2935
+
2936
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2937
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2938
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2939
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
2940
+ transports_version_send: [:rest]
2941
+
2942
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2943
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2944
+
2945
+ options.apply_defaults timeout: @config.rpcs.list_service_bindings.timeout,
2946
+ metadata: call_metadata,
2947
+ retry_policy: @config.rpcs.list_service_bindings.retry_policy
2948
+
2949
+ options.apply_defaults timeout: @config.timeout,
2950
+ metadata: @config.metadata,
2951
+ retry_policy: @config.retry_policy
2952
+
2953
+ @network_services_stub.list_service_bindings request, options do |result, operation|
2954
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_service_bindings, "service_bindings", request, result, options
2955
+ yield result, operation if block_given?
2956
+ return result
2957
+ end
2958
+ rescue ::Gapic::Rest::Error => e
2959
+ raise ::Google::Cloud::Error.from_error(e)
2960
+ end
2961
+
2962
+ ##
2963
+ # Gets details of a single ServiceBinding.
2964
+ #
2965
+ # @overload get_service_binding(request, options = nil)
2966
+ # Pass arguments to `get_service_binding` via a request object, either of type
2967
+ # {::Google::Cloud::NetworkServices::V1::GetServiceBindingRequest} or an equivalent Hash.
2968
+ #
2969
+ # @param request [::Google::Cloud::NetworkServices::V1::GetServiceBindingRequest, ::Hash]
2970
+ # A request object representing the call parameters. Required. To specify no
2971
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2972
+ # @param options [::Gapic::CallOptions, ::Hash]
2973
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2974
+ #
2975
+ # @overload get_service_binding(name: nil)
2976
+ # Pass arguments to `get_service_binding` via keyword arguments. Note that at
2977
+ # least one keyword argument is required. To specify no parameters, or to keep all
2978
+ # the default parameter values, pass an empty Hash as a request object (see above).
2979
+ #
2980
+ # @param name [::String]
2981
+ # Required. A name of the ServiceBinding to get. Must be in the format
2982
+ # `projects/*/locations/global/serviceBindings/*`.
2983
+ # @yield [result, operation] Access the result along with the TransportOperation object
2984
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::ServiceBinding]
2985
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2986
+ #
2987
+ # @return [::Google::Cloud::NetworkServices::V1::ServiceBinding]
2988
+ #
2989
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2990
+ #
2991
+ # @example Basic example
2992
+ # require "google/cloud/network_services/v1"
2993
+ #
2994
+ # # Create a client object. The client can be reused for multiple calls.
2995
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
2996
+ #
2997
+ # # Create a request. To set request fields, pass in keyword arguments.
2998
+ # request = Google::Cloud::NetworkServices::V1::GetServiceBindingRequest.new
2999
+ #
3000
+ # # Call the get_service_binding method.
3001
+ # result = client.get_service_binding request
3002
+ #
3003
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::ServiceBinding.
3004
+ # p result
3005
+ #
3006
+ def get_service_binding request, options = nil
3007
+ raise ::ArgumentError, "request must be provided" if request.nil?
3008
+
3009
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetServiceBindingRequest
3010
+
3011
+ # Converts hash and nil to an options object
3012
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3013
+
3014
+ # Customize the options with defaults
3015
+ call_metadata = @config.rpcs.get_service_binding.metadata.to_h
3016
+
3017
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3018
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3019
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3020
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3021
+ transports_version_send: [:rest]
3022
+
3023
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3024
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3025
+
3026
+ options.apply_defaults timeout: @config.rpcs.get_service_binding.timeout,
3027
+ metadata: call_metadata,
3028
+ retry_policy: @config.rpcs.get_service_binding.retry_policy
3029
+
3030
+ options.apply_defaults timeout: @config.timeout,
3031
+ metadata: @config.metadata,
3032
+ retry_policy: @config.retry_policy
3033
+
3034
+ @network_services_stub.get_service_binding request, options do |result, operation|
3035
+ yield result, operation if block_given?
3036
+ return result
3037
+ end
3038
+ rescue ::Gapic::Rest::Error => e
3039
+ raise ::Google::Cloud::Error.from_error(e)
3040
+ end
3041
+
3042
+ ##
3043
+ # Creates a new ServiceBinding in a given project and location.
3044
+ #
3045
+ # @overload create_service_binding(request, options = nil)
3046
+ # Pass arguments to `create_service_binding` via a request object, either of type
3047
+ # {::Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest} or an equivalent Hash.
3048
+ #
3049
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest, ::Hash]
3050
+ # A request object representing the call parameters. Required. To specify no
3051
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3052
+ # @param options [::Gapic::CallOptions, ::Hash]
3053
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3054
+ #
3055
+ # @overload create_service_binding(parent: nil, service_binding_id: nil, service_binding: nil)
3056
+ # Pass arguments to `create_service_binding` via keyword arguments. Note that at
3057
+ # least one keyword argument is required. To specify no parameters, or to keep all
3058
+ # the default parameter values, pass an empty Hash as a request object (see above).
3059
+ #
3060
+ # @param parent [::String]
3061
+ # Required. The parent resource of the ServiceBinding. Must be in the
3062
+ # format `projects/*/locations/global`.
3063
+ # @param service_binding_id [::String]
3064
+ # Required. Short name of the ServiceBinding resource to be created.
3065
+ # @param service_binding [::Google::Cloud::NetworkServices::V1::ServiceBinding, ::Hash]
3066
+ # Required. ServiceBinding resource to be created.
3067
+ # @yield [result, operation] Access the result along with the TransportOperation object
3068
+ # @yieldparam result [::Gapic::Operation]
3069
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3070
+ #
3071
+ # @return [::Gapic::Operation]
3072
+ #
3073
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3074
+ #
3075
+ # @example Basic example
3076
+ # require "google/cloud/network_services/v1"
3077
+ #
3078
+ # # Create a client object. The client can be reused for multiple calls.
3079
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
3080
+ #
3081
+ # # Create a request. To set request fields, pass in keyword arguments.
3082
+ # request = Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest.new
3083
+ #
3084
+ # # Call the create_service_binding method.
3085
+ # result = client.create_service_binding request
3086
+ #
3087
+ # # The returned object is of type Gapic::Operation. You can use it to
3088
+ # # check the status of an operation, cancel it, or wait for results.
3089
+ # # Here is how to wait for a response.
3090
+ # result.wait_until_done! timeout: 60
3091
+ # if result.response?
3092
+ # p result.response
3093
+ # else
3094
+ # puts "No response received."
3095
+ # end
3096
+ #
3097
+ def create_service_binding request, options = nil
3098
+ raise ::ArgumentError, "request must be provided" if request.nil?
3099
+
3100
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest
3101
+
3102
+ # Converts hash and nil to an options object
3103
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3104
+
3105
+ # Customize the options with defaults
3106
+ call_metadata = @config.rpcs.create_service_binding.metadata.to_h
3107
+
3108
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3109
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3110
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3111
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3112
+ transports_version_send: [:rest]
3113
+
3114
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3115
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3116
+
3117
+ options.apply_defaults timeout: @config.rpcs.create_service_binding.timeout,
3118
+ metadata: call_metadata,
3119
+ retry_policy: @config.rpcs.create_service_binding.retry_policy
3120
+
3121
+ options.apply_defaults timeout: @config.timeout,
3122
+ metadata: @config.metadata,
3123
+ retry_policy: @config.retry_policy
3124
+
3125
+ @network_services_stub.create_service_binding request, options do |result, operation|
3126
+ result = ::Gapic::Operation.new result, @operations_client, options: options
3127
+ yield result, operation if block_given?
3128
+ return result
3129
+ end
3130
+ rescue ::Gapic::Rest::Error => e
3131
+ raise ::Google::Cloud::Error.from_error(e)
3132
+ end
3133
+
3134
+ ##
3135
+ # Deletes a single ServiceBinding.
3136
+ #
3137
+ # @overload delete_service_binding(request, options = nil)
3138
+ # Pass arguments to `delete_service_binding` via a request object, either of type
3139
+ # {::Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest} or an equivalent Hash.
3140
+ #
3141
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest, ::Hash]
3142
+ # A request object representing the call parameters. Required. To specify no
3143
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3144
+ # @param options [::Gapic::CallOptions, ::Hash]
3145
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3146
+ #
3147
+ # @overload delete_service_binding(name: nil)
3148
+ # Pass arguments to `delete_service_binding` via keyword arguments. Note that at
3149
+ # least one keyword argument is required. To specify no parameters, or to keep all
3150
+ # the default parameter values, pass an empty Hash as a request object (see above).
3151
+ #
3152
+ # @param name [::String]
3153
+ # Required. A name of the ServiceBinding to delete. Must be in the format
3154
+ # `projects/*/locations/global/serviceBindings/*`.
3155
+ # @yield [result, operation] Access the result along with the TransportOperation object
3156
+ # @yieldparam result [::Gapic::Operation]
3157
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3158
+ #
3159
+ # @return [::Gapic::Operation]
3160
+ #
3161
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3162
+ #
3163
+ # @example Basic example
3164
+ # require "google/cloud/network_services/v1"
3165
+ #
3166
+ # # Create a client object. The client can be reused for multiple calls.
3167
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
3168
+ #
3169
+ # # Create a request. To set request fields, pass in keyword arguments.
3170
+ # request = Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest.new
3171
+ #
3172
+ # # Call the delete_service_binding method.
3173
+ # result = client.delete_service_binding request
3174
+ #
3175
+ # # The returned object is of type Gapic::Operation. You can use it to
3176
+ # # check the status of an operation, cancel it, or wait for results.
3177
+ # # Here is how to wait for a response.
3178
+ # result.wait_until_done! timeout: 60
3179
+ # if result.response?
3180
+ # p result.response
3181
+ # else
3182
+ # puts "No response received."
3183
+ # end
3184
+ #
3185
+ def delete_service_binding request, options = nil
3186
+ raise ::ArgumentError, "request must be provided" if request.nil?
3187
+
3188
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest
3189
+
3190
+ # Converts hash and nil to an options object
3191
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3192
+
3193
+ # Customize the options with defaults
3194
+ call_metadata = @config.rpcs.delete_service_binding.metadata.to_h
3195
+
3196
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3197
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3198
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3199
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3200
+ transports_version_send: [:rest]
3201
+
3202
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3203
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3204
+
3205
+ options.apply_defaults timeout: @config.rpcs.delete_service_binding.timeout,
3206
+ metadata: call_metadata,
3207
+ retry_policy: @config.rpcs.delete_service_binding.retry_policy
3208
+
3209
+ options.apply_defaults timeout: @config.timeout,
3210
+ metadata: @config.metadata,
3211
+ retry_policy: @config.retry_policy
3212
+
3213
+ @network_services_stub.delete_service_binding request, options do |result, operation|
3214
+ result = ::Gapic::Operation.new result, @operations_client, options: options
3215
+ yield result, operation if block_given?
3216
+ return result
3217
+ end
3218
+ rescue ::Gapic::Rest::Error => e
3219
+ raise ::Google::Cloud::Error.from_error(e)
3220
+ end
3221
+
3222
+ ##
3223
+ # Lists Meshes in a given project and location.
3224
+ #
3225
+ # @overload list_meshes(request, options = nil)
3226
+ # Pass arguments to `list_meshes` via a request object, either of type
3227
+ # {::Google::Cloud::NetworkServices::V1::ListMeshesRequest} or an equivalent Hash.
3228
+ #
3229
+ # @param request [::Google::Cloud::NetworkServices::V1::ListMeshesRequest, ::Hash]
3230
+ # A request object representing the call parameters. Required. To specify no
3231
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3232
+ # @param options [::Gapic::CallOptions, ::Hash]
3233
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3234
+ #
3235
+ # @overload list_meshes(parent: nil, page_size: nil, page_token: nil)
3236
+ # Pass arguments to `list_meshes` via keyword arguments. Note that at
3237
+ # least one keyword argument is required. To specify no parameters, or to keep all
3238
+ # the default parameter values, pass an empty Hash as a request object (see above).
3239
+ #
3240
+ # @param parent [::String]
3241
+ # Required. The project and location from which the Meshes should be
3242
+ # listed, specified in the format `projects/*/locations/global`.
3243
+ # @param page_size [::Integer]
3244
+ # Maximum number of Meshes to return per call.
3245
+ # @param page_token [::String]
3246
+ # The value returned by the last `ListMeshesResponse`
3247
+ # Indicates that this is a continuation of a prior `ListMeshes` call,
3248
+ # and that the system should return the next page of data.
3249
+ # @yield [result, operation] Access the result along with the TransportOperation object
3250
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Mesh>]
3251
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3252
+ #
3253
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Mesh>]
3254
+ #
3255
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3256
+ #
3257
+ # @example Basic example
3258
+ # require "google/cloud/network_services/v1"
3259
+ #
3260
+ # # Create a client object. The client can be reused for multiple calls.
3261
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
3262
+ #
3263
+ # # Create a request. To set request fields, pass in keyword arguments.
3264
+ # request = Google::Cloud::NetworkServices::V1::ListMeshesRequest.new
3265
+ #
3266
+ # # Call the list_meshes method.
3267
+ # result = client.list_meshes request
3268
+ #
3269
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3270
+ # # over elements, and API calls will be issued to fetch pages as needed.
3271
+ # result.each do |item|
3272
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::Mesh.
3273
+ # p item
3274
+ # end
3275
+ #
3276
+ def list_meshes request, options = nil
3277
+ raise ::ArgumentError, "request must be provided" if request.nil?
3278
+
3279
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListMeshesRequest
3280
+
3281
+ # Converts hash and nil to an options object
3282
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3283
+
3284
+ # Customize the options with defaults
3285
+ call_metadata = @config.rpcs.list_meshes.metadata.to_h
3286
+
3287
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3288
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3289
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3290
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3291
+ transports_version_send: [:rest]
3292
+
3293
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3294
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3295
+
3296
+ options.apply_defaults timeout: @config.rpcs.list_meshes.timeout,
3297
+ metadata: call_metadata,
3298
+ retry_policy: @config.rpcs.list_meshes.retry_policy
3299
+
3300
+ options.apply_defaults timeout: @config.timeout,
3301
+ metadata: @config.metadata,
3302
+ retry_policy: @config.retry_policy
3303
+
3304
+ @network_services_stub.list_meshes request, options do |result, operation|
3305
+ result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_meshes, "meshes", request, result, options
3306
+ yield result, operation if block_given?
3307
+ return result
3308
+ end
3309
+ rescue ::Gapic::Rest::Error => e
3310
+ raise ::Google::Cloud::Error.from_error(e)
3311
+ end
3312
+
3313
+ ##
3314
+ # Gets details of a single Mesh.
3315
+ #
3316
+ # @overload get_mesh(request, options = nil)
3317
+ # Pass arguments to `get_mesh` via a request object, either of type
3318
+ # {::Google::Cloud::NetworkServices::V1::GetMeshRequest} or an equivalent Hash.
3319
+ #
3320
+ # @param request [::Google::Cloud::NetworkServices::V1::GetMeshRequest, ::Hash]
3321
+ # A request object representing the call parameters. Required. To specify no
3322
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3323
+ # @param options [::Gapic::CallOptions, ::Hash]
3324
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3325
+ #
3326
+ # @overload get_mesh(name: nil)
3327
+ # Pass arguments to `get_mesh` via keyword arguments. Note that at
3328
+ # least one keyword argument is required. To specify no parameters, or to keep all
3329
+ # the default parameter values, pass an empty Hash as a request object (see above).
3330
+ #
3331
+ # @param name [::String]
3332
+ # Required. A name of the Mesh to get. Must be in the format
3333
+ # `projects/*/locations/global/meshes/*`.
3334
+ # @yield [result, operation] Access the result along with the TransportOperation object
3335
+ # @yieldparam result [::Google::Cloud::NetworkServices::V1::Mesh]
3336
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3337
+ #
3338
+ # @return [::Google::Cloud::NetworkServices::V1::Mesh]
3339
+ #
3340
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3341
+ #
3342
+ # @example Basic example
3343
+ # require "google/cloud/network_services/v1"
3344
+ #
3345
+ # # Create a client object. The client can be reused for multiple calls.
3346
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
3347
+ #
3348
+ # # Create a request. To set request fields, pass in keyword arguments.
3349
+ # request = Google::Cloud::NetworkServices::V1::GetMeshRequest.new
3350
+ #
3351
+ # # Call the get_mesh method.
3352
+ # result = client.get_mesh request
3353
+ #
3354
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::Mesh.
3355
+ # p result
3356
+ #
3357
+ def get_mesh request, options = nil
3358
+ raise ::ArgumentError, "request must be provided" if request.nil?
3359
+
3360
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetMeshRequest
3361
+
3362
+ # Converts hash and nil to an options object
3363
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3364
+
3365
+ # Customize the options with defaults
3366
+ call_metadata = @config.rpcs.get_mesh.metadata.to_h
3367
+
3368
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3369
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3370
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3371
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3372
+ transports_version_send: [:rest]
3373
+
3374
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3375
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3376
+
3377
+ options.apply_defaults timeout: @config.rpcs.get_mesh.timeout,
3378
+ metadata: call_metadata,
3379
+ retry_policy: @config.rpcs.get_mesh.retry_policy
3380
+
3381
+ options.apply_defaults timeout: @config.timeout,
3382
+ metadata: @config.metadata,
3383
+ retry_policy: @config.retry_policy
3384
+
3385
+ @network_services_stub.get_mesh request, options do |result, operation|
3386
+ yield result, operation if block_given?
3387
+ return result
3388
+ end
3389
+ rescue ::Gapic::Rest::Error => e
3390
+ raise ::Google::Cloud::Error.from_error(e)
3391
+ end
3392
+
3393
+ ##
3394
+ # Creates a new Mesh in a given project and location.
3395
+ #
3396
+ # @overload create_mesh(request, options = nil)
3397
+ # Pass arguments to `create_mesh` via a request object, either of type
3398
+ # {::Google::Cloud::NetworkServices::V1::CreateMeshRequest} or an equivalent Hash.
3399
+ #
3400
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateMeshRequest, ::Hash]
3401
+ # A request object representing the call parameters. Required. To specify no
3402
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3403
+ # @param options [::Gapic::CallOptions, ::Hash]
3404
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3405
+ #
3406
+ # @overload create_mesh(parent: nil, mesh_id: nil, mesh: nil)
3407
+ # Pass arguments to `create_mesh` via keyword arguments. Note that at
3408
+ # least one keyword argument is required. To specify no parameters, or to keep all
3409
+ # the default parameter values, pass an empty Hash as a request object (see above).
3410
+ #
3411
+ # @param parent [::String]
3412
+ # Required. The parent resource of the Mesh. Must be in the
3413
+ # format `projects/*/locations/global`.
3414
+ # @param mesh_id [::String]
3415
+ # Required. Short name of the Mesh resource to be created.
3416
+ # @param mesh [::Google::Cloud::NetworkServices::V1::Mesh, ::Hash]
3417
+ # Required. Mesh resource to be created.
3418
+ # @yield [result, operation] Access the result along with the TransportOperation object
3419
+ # @yieldparam result [::Gapic::Operation]
3420
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3421
+ #
3422
+ # @return [::Gapic::Operation]
3423
+ #
3424
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3425
+ #
3426
+ # @example Basic example
3427
+ # require "google/cloud/network_services/v1"
3428
+ #
3429
+ # # Create a client object. The client can be reused for multiple calls.
3430
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
3431
+ #
3432
+ # # Create a request. To set request fields, pass in keyword arguments.
3433
+ # request = Google::Cloud::NetworkServices::V1::CreateMeshRequest.new
3434
+ #
3435
+ # # Call the create_mesh method.
3436
+ # result = client.create_mesh request
3437
+ #
3438
+ # # The returned object is of type Gapic::Operation. You can use it to
3439
+ # # check the status of an operation, cancel it, or wait for results.
3440
+ # # Here is how to wait for a response.
3441
+ # result.wait_until_done! timeout: 60
3442
+ # if result.response?
3443
+ # p result.response
3444
+ # else
3445
+ # puts "No response received."
3446
+ # end
3447
+ #
3448
+ def create_mesh request, options = nil
3449
+ raise ::ArgumentError, "request must be provided" if request.nil?
3450
+
3451
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateMeshRequest
3452
+
3453
+ # Converts hash and nil to an options object
3454
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3455
+
3456
+ # Customize the options with defaults
3457
+ call_metadata = @config.rpcs.create_mesh.metadata.to_h
3458
+
3459
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3460
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3461
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3462
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3463
+ transports_version_send: [:rest]
3464
+
3465
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3466
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3467
+
3468
+ options.apply_defaults timeout: @config.rpcs.create_mesh.timeout,
3469
+ metadata: call_metadata,
3470
+ retry_policy: @config.rpcs.create_mesh.retry_policy
3471
+
3472
+ options.apply_defaults timeout: @config.timeout,
3473
+ metadata: @config.metadata,
3474
+ retry_policy: @config.retry_policy
3475
+
3476
+ @network_services_stub.create_mesh request, options do |result, operation|
3477
+ result = ::Gapic::Operation.new result, @operations_client, options: options
3478
+ yield result, operation if block_given?
3479
+ return result
3480
+ end
3481
+ rescue ::Gapic::Rest::Error => e
3482
+ raise ::Google::Cloud::Error.from_error(e)
3483
+ end
3484
+
3485
+ ##
3486
+ # Updates the parameters of a single Mesh.
3487
+ #
3488
+ # @overload update_mesh(request, options = nil)
3489
+ # Pass arguments to `update_mesh` via a request object, either of type
3490
+ # {::Google::Cloud::NetworkServices::V1::UpdateMeshRequest} or an equivalent Hash.
3491
+ #
3492
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateMeshRequest, ::Hash]
3493
+ # A request object representing the call parameters. Required. To specify no
3494
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3495
+ # @param options [::Gapic::CallOptions, ::Hash]
3496
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3497
+ #
3498
+ # @overload update_mesh(update_mask: nil, mesh: nil)
3499
+ # Pass arguments to `update_mesh` via keyword arguments. Note that at
3500
+ # least one keyword argument is required. To specify no parameters, or to keep all
3501
+ # the default parameter values, pass an empty Hash as a request object (see above).
3502
+ #
3503
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3504
+ # Optional. Field mask is used to specify the fields to be overwritten in the
3505
+ # Mesh resource by the update.
3506
+ # The fields specified in the update_mask are relative to the resource, not
3507
+ # the full request. A field will be overwritten if it is in the mask. If the
3508
+ # user does not provide a mask then all fields will be overwritten.
3509
+ # @param mesh [::Google::Cloud::NetworkServices::V1::Mesh, ::Hash]
3510
+ # Required. Updated Mesh resource.
3511
+ # @yield [result, operation] Access the result along with the TransportOperation object
3512
+ # @yieldparam result [::Gapic::Operation]
3513
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3514
+ #
3515
+ # @return [::Gapic::Operation]
3516
+ #
3517
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3518
+ #
3519
+ # @example Basic example
3520
+ # require "google/cloud/network_services/v1"
3521
+ #
3522
+ # # Create a client object. The client can be reused for multiple calls.
3523
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
3524
+ #
3525
+ # # Create a request. To set request fields, pass in keyword arguments.
3526
+ # request = Google::Cloud::NetworkServices::V1::UpdateMeshRequest.new
3527
+ #
3528
+ # # Call the update_mesh method.
3529
+ # result = client.update_mesh request
3530
+ #
3531
+ # # The returned object is of type Gapic::Operation. You can use it to
3532
+ # # check the status of an operation, cancel it, or wait for results.
3533
+ # # Here is how to wait for a response.
3534
+ # result.wait_until_done! timeout: 60
3535
+ # if result.response?
3536
+ # p result.response
3537
+ # else
3538
+ # puts "No response received."
3539
+ # end
3540
+ #
3541
+ def update_mesh request, options = nil
3542
+ raise ::ArgumentError, "request must be provided" if request.nil?
3543
+
3544
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateMeshRequest
3545
+
3546
+ # Converts hash and nil to an options object
3547
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3548
+
3549
+ # Customize the options with defaults
3550
+ call_metadata = @config.rpcs.update_mesh.metadata.to_h
3551
+
3552
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3553
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3554
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3555
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3556
+ transports_version_send: [:rest]
3557
+
3558
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3559
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3560
+
3561
+ options.apply_defaults timeout: @config.rpcs.update_mesh.timeout,
3562
+ metadata: call_metadata,
3563
+ retry_policy: @config.rpcs.update_mesh.retry_policy
3564
+
3565
+ options.apply_defaults timeout: @config.timeout,
3566
+ metadata: @config.metadata,
3567
+ retry_policy: @config.retry_policy
3568
+
3569
+ @network_services_stub.update_mesh request, options do |result, operation|
3570
+ result = ::Gapic::Operation.new result, @operations_client, options: options
3571
+ yield result, operation if block_given?
3572
+ return result
3573
+ end
3574
+ rescue ::Gapic::Rest::Error => e
3575
+ raise ::Google::Cloud::Error.from_error(e)
3576
+ end
3577
+
3578
+ ##
3579
+ # Deletes a single Mesh.
3580
+ #
3581
+ # @overload delete_mesh(request, options = nil)
3582
+ # Pass arguments to `delete_mesh` via a request object, either of type
3583
+ # {::Google::Cloud::NetworkServices::V1::DeleteMeshRequest} or an equivalent Hash.
3584
+ #
3585
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteMeshRequest, ::Hash]
3586
+ # A request object representing the call parameters. Required. To specify no
3587
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3588
+ # @param options [::Gapic::CallOptions, ::Hash]
3589
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3590
+ #
3591
+ # @overload delete_mesh(name: nil)
3592
+ # Pass arguments to `delete_mesh` via keyword arguments. Note that at
3593
+ # least one keyword argument is required. To specify no parameters, or to keep all
3594
+ # the default parameter values, pass an empty Hash as a request object (see above).
3595
+ #
3596
+ # @param name [::String]
3597
+ # Required. A name of the Mesh to delete. Must be in the format
3598
+ # `projects/*/locations/global/meshes/*`.
3599
+ # @yield [result, operation] Access the result along with the TransportOperation object
3600
+ # @yieldparam result [::Gapic::Operation]
3601
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3602
+ #
3603
+ # @return [::Gapic::Operation]
3604
+ #
3605
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3606
+ #
3607
+ # @example Basic example
3608
+ # require "google/cloud/network_services/v1"
3609
+ #
3610
+ # # Create a client object. The client can be reused for multiple calls.
3611
+ # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new
3612
+ #
3613
+ # # Create a request. To set request fields, pass in keyword arguments.
3614
+ # request = Google::Cloud::NetworkServices::V1::DeleteMeshRequest.new
3615
+ #
3616
+ # # Call the delete_mesh method.
3617
+ # result = client.delete_mesh request
3618
+ #
3619
+ # # The returned object is of type Gapic::Operation. You can use it to
3620
+ # # check the status of an operation, cancel it, or wait for results.
3621
+ # # Here is how to wait for a response.
3622
+ # result.wait_until_done! timeout: 60
3623
+ # if result.response?
3624
+ # p result.response
3625
+ # else
3626
+ # puts "No response received."
3627
+ # end
3628
+ #
3629
+ def delete_mesh request, options = nil
3630
+ raise ::ArgumentError, "request must be provided" if request.nil?
3631
+
3632
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteMeshRequest
3633
+
3634
+ # Converts hash and nil to an options object
3635
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3636
+
3637
+ # Customize the options with defaults
3638
+ call_metadata = @config.rpcs.delete_mesh.metadata.to_h
3639
+
3640
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3641
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3642
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3643
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION,
3644
+ transports_version_send: [:rest]
3645
+
3646
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3647
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3648
+
3649
+ options.apply_defaults timeout: @config.rpcs.delete_mesh.timeout,
3650
+ metadata: call_metadata,
3651
+ retry_policy: @config.rpcs.delete_mesh.retry_policy
3652
+
3653
+ options.apply_defaults timeout: @config.timeout,
3654
+ metadata: @config.metadata,
3655
+ retry_policy: @config.retry_policy
3656
+
3657
+ @network_services_stub.delete_mesh request, options do |result, operation|
3658
+ result = ::Gapic::Operation.new result, @operations_client, options: options
3659
+ yield result, operation if block_given?
3660
+ return result
3661
+ end
3662
+ rescue ::Gapic::Rest::Error => e
3663
+ raise ::Google::Cloud::Error.from_error(e)
3664
+ end
3665
+
3666
+ ##
3667
+ # Configuration class for the NetworkServices REST API.
3668
+ #
3669
+ # This class represents the configuration for NetworkServices REST,
3670
+ # providing control over timeouts, retry behavior, logging, transport
3671
+ # parameters, and other low-level controls. Certain parameters can also be
3672
+ # applied individually to specific RPCs. See
3673
+ # {::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client::Configuration::Rpcs}
3674
+ # for a list of RPCs that can be configured independently.
3675
+ #
3676
+ # Configuration can be applied globally to all clients, or to a single client
3677
+ # on construction.
3678
+ #
3679
+ # @example
3680
+ #
3681
+ # # Modify the global config, setting the timeout for
3682
+ # # list_endpoint_policies to 20 seconds,
3683
+ # # and all remaining timeouts to 10 seconds.
3684
+ # ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.configure do |config|
3685
+ # config.timeout = 10.0
3686
+ # config.rpcs.list_endpoint_policies.timeout = 20.0
3687
+ # end
3688
+ #
3689
+ # # Apply the above configuration only to a new client.
3690
+ # client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new do |config|
3691
+ # config.timeout = 10.0
3692
+ # config.rpcs.list_endpoint_policies.timeout = 20.0
3693
+ # end
3694
+ #
3695
+ # @!attribute [rw] endpoint
3696
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3697
+ # nil, indicating to use the default endpoint in the current universe domain.
3698
+ # @return [::String,nil]
3699
+ # @!attribute [rw] credentials
3700
+ # Credentials to send with calls. You may provide any of the following types:
3701
+ # * (`String`) The path to a service account key file in JSON format
3702
+ # * (`Hash`) A service account key as a Hash
3703
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3704
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3705
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3706
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3707
+ # * (`nil`) indicating no credentials
3708
+ # @return [::Object]
3709
+ # @!attribute [rw] scope
3710
+ # The OAuth scopes
3711
+ # @return [::Array<::String>]
3712
+ # @!attribute [rw] lib_name
3713
+ # The library name as recorded in instrumentation and logging
3714
+ # @return [::String]
3715
+ # @!attribute [rw] lib_version
3716
+ # The library version as recorded in instrumentation and logging
3717
+ # @return [::String]
3718
+ # @!attribute [rw] timeout
3719
+ # The call timeout in seconds.
3720
+ # @return [::Numeric]
3721
+ # @!attribute [rw] metadata
3722
+ # Additional headers to be sent with the call.
3723
+ # @return [::Hash{::Symbol=>::String}]
3724
+ # @!attribute [rw] retry_policy
3725
+ # The retry policy. The value is a hash with the following keys:
3726
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3727
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3728
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3729
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3730
+ # trigger a retry.
3731
+ # @return [::Hash]
3732
+ # @!attribute [rw] quota_project
3733
+ # A separate project against which to charge quota.
3734
+ # @return [::String]
3735
+ # @!attribute [rw] universe_domain
3736
+ # The universe domain within which to make requests. This determines the
3737
+ # default endpoint URL. The default value of nil uses the environment
3738
+ # universe (usually the default "googleapis.com" universe).
3739
+ # @return [::String,nil]
3740
+ #
3741
+ class Configuration
3742
+ extend ::Gapic::Config
3743
+
3744
+ # @private
3745
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
3746
+ DEFAULT_ENDPOINT = "networkservices.googleapis.com"
3747
+
3748
+ config_attr :endpoint, nil, ::String, nil
3749
+ config_attr :credentials, nil do |value|
3750
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3751
+ allowed.any? { |klass| klass === value }
3752
+ end
3753
+ config_attr :scope, nil, ::String, ::Array, nil
3754
+ config_attr :lib_name, nil, ::String, nil
3755
+ config_attr :lib_version, nil, ::String, nil
3756
+ config_attr :timeout, nil, ::Numeric, nil
3757
+ config_attr :metadata, nil, ::Hash, nil
3758
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3759
+ config_attr :quota_project, nil, ::String, nil
3760
+ config_attr :universe_domain, nil, ::String, nil
3761
+
3762
+ # @private
3763
+ # Overrides for http bindings for the RPCs of this service
3764
+ # are only used when this service is used as mixin, and only
3765
+ # by the host service.
3766
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
3767
+ config_attr :bindings_override, {}, ::Hash, nil
3768
+
3769
+ # @private
3770
+ def initialize parent_config = nil
3771
+ @parent_config = parent_config unless parent_config.nil?
3772
+
3773
+ yield self if block_given?
3774
+ end
3775
+
3776
+ ##
3777
+ # Configurations for individual RPCs
3778
+ # @return [Rpcs]
3779
+ #
3780
+ def rpcs
3781
+ @rpcs ||= begin
3782
+ parent_rpcs = nil
3783
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3784
+ Rpcs.new parent_rpcs
3785
+ end
3786
+ end
3787
+
3788
+ ##
3789
+ # Configuration RPC class for the NetworkServices API.
3790
+ #
3791
+ # Includes fields providing the configuration for each RPC in this service.
3792
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3793
+ # the following configuration fields:
3794
+ #
3795
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3796
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
3797
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3798
+ # include the following keys:
3799
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3800
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3801
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3802
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3803
+ # trigger a retry.
3804
+ #
3805
+ class Rpcs
3806
+ ##
3807
+ # RPC-specific configuration for `list_endpoint_policies`
3808
+ # @return [::Gapic::Config::Method]
3809
+ #
3810
+ attr_reader :list_endpoint_policies
3811
+ ##
3812
+ # RPC-specific configuration for `get_endpoint_policy`
3813
+ # @return [::Gapic::Config::Method]
3814
+ #
3815
+ attr_reader :get_endpoint_policy
3816
+ ##
3817
+ # RPC-specific configuration for `create_endpoint_policy`
3818
+ # @return [::Gapic::Config::Method]
3819
+ #
3820
+ attr_reader :create_endpoint_policy
3821
+ ##
3822
+ # RPC-specific configuration for `update_endpoint_policy`
3823
+ # @return [::Gapic::Config::Method]
3824
+ #
3825
+ attr_reader :update_endpoint_policy
3826
+ ##
3827
+ # RPC-specific configuration for `delete_endpoint_policy`
3828
+ # @return [::Gapic::Config::Method]
3829
+ #
3830
+ attr_reader :delete_endpoint_policy
3831
+ ##
3832
+ # RPC-specific configuration for `list_gateways`
3833
+ # @return [::Gapic::Config::Method]
3834
+ #
3835
+ attr_reader :list_gateways
3836
+ ##
3837
+ # RPC-specific configuration for `get_gateway`
3838
+ # @return [::Gapic::Config::Method]
3839
+ #
3840
+ attr_reader :get_gateway
3841
+ ##
3842
+ # RPC-specific configuration for `create_gateway`
3843
+ # @return [::Gapic::Config::Method]
3844
+ #
3845
+ attr_reader :create_gateway
3846
+ ##
3847
+ # RPC-specific configuration for `update_gateway`
3848
+ # @return [::Gapic::Config::Method]
3849
+ #
3850
+ attr_reader :update_gateway
3851
+ ##
3852
+ # RPC-specific configuration for `delete_gateway`
3853
+ # @return [::Gapic::Config::Method]
3854
+ #
3855
+ attr_reader :delete_gateway
3856
+ ##
3857
+ # RPC-specific configuration for `list_grpc_routes`
3858
+ # @return [::Gapic::Config::Method]
3859
+ #
3860
+ attr_reader :list_grpc_routes
3861
+ ##
3862
+ # RPC-specific configuration for `get_grpc_route`
3863
+ # @return [::Gapic::Config::Method]
3864
+ #
3865
+ attr_reader :get_grpc_route
3866
+ ##
3867
+ # RPC-specific configuration for `create_grpc_route`
3868
+ # @return [::Gapic::Config::Method]
3869
+ #
3870
+ attr_reader :create_grpc_route
3871
+ ##
3872
+ # RPC-specific configuration for `update_grpc_route`
3873
+ # @return [::Gapic::Config::Method]
3874
+ #
3875
+ attr_reader :update_grpc_route
3876
+ ##
3877
+ # RPC-specific configuration for `delete_grpc_route`
3878
+ # @return [::Gapic::Config::Method]
3879
+ #
3880
+ attr_reader :delete_grpc_route
3881
+ ##
3882
+ # RPC-specific configuration for `list_http_routes`
3883
+ # @return [::Gapic::Config::Method]
3884
+ #
3885
+ attr_reader :list_http_routes
3886
+ ##
3887
+ # RPC-specific configuration for `get_http_route`
3888
+ # @return [::Gapic::Config::Method]
3889
+ #
3890
+ attr_reader :get_http_route
3891
+ ##
3892
+ # RPC-specific configuration for `create_http_route`
3893
+ # @return [::Gapic::Config::Method]
3894
+ #
3895
+ attr_reader :create_http_route
3896
+ ##
3897
+ # RPC-specific configuration for `update_http_route`
3898
+ # @return [::Gapic::Config::Method]
3899
+ #
3900
+ attr_reader :update_http_route
3901
+ ##
3902
+ # RPC-specific configuration for `delete_http_route`
3903
+ # @return [::Gapic::Config::Method]
3904
+ #
3905
+ attr_reader :delete_http_route
3906
+ ##
3907
+ # RPC-specific configuration for `list_tcp_routes`
3908
+ # @return [::Gapic::Config::Method]
3909
+ #
3910
+ attr_reader :list_tcp_routes
3911
+ ##
3912
+ # RPC-specific configuration for `get_tcp_route`
3913
+ # @return [::Gapic::Config::Method]
3914
+ #
3915
+ attr_reader :get_tcp_route
3916
+ ##
3917
+ # RPC-specific configuration for `create_tcp_route`
3918
+ # @return [::Gapic::Config::Method]
3919
+ #
3920
+ attr_reader :create_tcp_route
3921
+ ##
3922
+ # RPC-specific configuration for `update_tcp_route`
3923
+ # @return [::Gapic::Config::Method]
3924
+ #
3925
+ attr_reader :update_tcp_route
3926
+ ##
3927
+ # RPC-specific configuration for `delete_tcp_route`
3928
+ # @return [::Gapic::Config::Method]
3929
+ #
3930
+ attr_reader :delete_tcp_route
3931
+ ##
3932
+ # RPC-specific configuration for `list_tls_routes`
3933
+ # @return [::Gapic::Config::Method]
3934
+ #
3935
+ attr_reader :list_tls_routes
3936
+ ##
3937
+ # RPC-specific configuration for `get_tls_route`
3938
+ # @return [::Gapic::Config::Method]
3939
+ #
3940
+ attr_reader :get_tls_route
3941
+ ##
3942
+ # RPC-specific configuration for `create_tls_route`
3943
+ # @return [::Gapic::Config::Method]
3944
+ #
3945
+ attr_reader :create_tls_route
3946
+ ##
3947
+ # RPC-specific configuration for `update_tls_route`
3948
+ # @return [::Gapic::Config::Method]
3949
+ #
3950
+ attr_reader :update_tls_route
3951
+ ##
3952
+ # RPC-specific configuration for `delete_tls_route`
3953
+ # @return [::Gapic::Config::Method]
3954
+ #
3955
+ attr_reader :delete_tls_route
3956
+ ##
3957
+ # RPC-specific configuration for `list_service_bindings`
3958
+ # @return [::Gapic::Config::Method]
3959
+ #
3960
+ attr_reader :list_service_bindings
3961
+ ##
3962
+ # RPC-specific configuration for `get_service_binding`
3963
+ # @return [::Gapic::Config::Method]
3964
+ #
3965
+ attr_reader :get_service_binding
3966
+ ##
3967
+ # RPC-specific configuration for `create_service_binding`
3968
+ # @return [::Gapic::Config::Method]
3969
+ #
3970
+ attr_reader :create_service_binding
3971
+ ##
3972
+ # RPC-specific configuration for `delete_service_binding`
3973
+ # @return [::Gapic::Config::Method]
3974
+ #
3975
+ attr_reader :delete_service_binding
3976
+ ##
3977
+ # RPC-specific configuration for `list_meshes`
3978
+ # @return [::Gapic::Config::Method]
3979
+ #
3980
+ attr_reader :list_meshes
3981
+ ##
3982
+ # RPC-specific configuration for `get_mesh`
3983
+ # @return [::Gapic::Config::Method]
3984
+ #
3985
+ attr_reader :get_mesh
3986
+ ##
3987
+ # RPC-specific configuration for `create_mesh`
3988
+ # @return [::Gapic::Config::Method]
3989
+ #
3990
+ attr_reader :create_mesh
3991
+ ##
3992
+ # RPC-specific configuration for `update_mesh`
3993
+ # @return [::Gapic::Config::Method]
3994
+ #
3995
+ attr_reader :update_mesh
3996
+ ##
3997
+ # RPC-specific configuration for `delete_mesh`
3998
+ # @return [::Gapic::Config::Method]
3999
+ #
4000
+ attr_reader :delete_mesh
4001
+
4002
+ # @private
4003
+ def initialize parent_rpcs = nil
4004
+ list_endpoint_policies_config = parent_rpcs.list_endpoint_policies if parent_rpcs.respond_to? :list_endpoint_policies
4005
+ @list_endpoint_policies = ::Gapic::Config::Method.new list_endpoint_policies_config
4006
+ get_endpoint_policy_config = parent_rpcs.get_endpoint_policy if parent_rpcs.respond_to? :get_endpoint_policy
4007
+ @get_endpoint_policy = ::Gapic::Config::Method.new get_endpoint_policy_config
4008
+ create_endpoint_policy_config = parent_rpcs.create_endpoint_policy if parent_rpcs.respond_to? :create_endpoint_policy
4009
+ @create_endpoint_policy = ::Gapic::Config::Method.new create_endpoint_policy_config
4010
+ update_endpoint_policy_config = parent_rpcs.update_endpoint_policy if parent_rpcs.respond_to? :update_endpoint_policy
4011
+ @update_endpoint_policy = ::Gapic::Config::Method.new update_endpoint_policy_config
4012
+ delete_endpoint_policy_config = parent_rpcs.delete_endpoint_policy if parent_rpcs.respond_to? :delete_endpoint_policy
4013
+ @delete_endpoint_policy = ::Gapic::Config::Method.new delete_endpoint_policy_config
4014
+ list_gateways_config = parent_rpcs.list_gateways if parent_rpcs.respond_to? :list_gateways
4015
+ @list_gateways = ::Gapic::Config::Method.new list_gateways_config
4016
+ get_gateway_config = parent_rpcs.get_gateway if parent_rpcs.respond_to? :get_gateway
4017
+ @get_gateway = ::Gapic::Config::Method.new get_gateway_config
4018
+ create_gateway_config = parent_rpcs.create_gateway if parent_rpcs.respond_to? :create_gateway
4019
+ @create_gateway = ::Gapic::Config::Method.new create_gateway_config
4020
+ update_gateway_config = parent_rpcs.update_gateway if parent_rpcs.respond_to? :update_gateway
4021
+ @update_gateway = ::Gapic::Config::Method.new update_gateway_config
4022
+ delete_gateway_config = parent_rpcs.delete_gateway if parent_rpcs.respond_to? :delete_gateway
4023
+ @delete_gateway = ::Gapic::Config::Method.new delete_gateway_config
4024
+ list_grpc_routes_config = parent_rpcs.list_grpc_routes if parent_rpcs.respond_to? :list_grpc_routes
4025
+ @list_grpc_routes = ::Gapic::Config::Method.new list_grpc_routes_config
4026
+ get_grpc_route_config = parent_rpcs.get_grpc_route if parent_rpcs.respond_to? :get_grpc_route
4027
+ @get_grpc_route = ::Gapic::Config::Method.new get_grpc_route_config
4028
+ create_grpc_route_config = parent_rpcs.create_grpc_route if parent_rpcs.respond_to? :create_grpc_route
4029
+ @create_grpc_route = ::Gapic::Config::Method.new create_grpc_route_config
4030
+ update_grpc_route_config = parent_rpcs.update_grpc_route if parent_rpcs.respond_to? :update_grpc_route
4031
+ @update_grpc_route = ::Gapic::Config::Method.new update_grpc_route_config
4032
+ delete_grpc_route_config = parent_rpcs.delete_grpc_route if parent_rpcs.respond_to? :delete_grpc_route
4033
+ @delete_grpc_route = ::Gapic::Config::Method.new delete_grpc_route_config
4034
+ list_http_routes_config = parent_rpcs.list_http_routes if parent_rpcs.respond_to? :list_http_routes
4035
+ @list_http_routes = ::Gapic::Config::Method.new list_http_routes_config
4036
+ get_http_route_config = parent_rpcs.get_http_route if parent_rpcs.respond_to? :get_http_route
4037
+ @get_http_route = ::Gapic::Config::Method.new get_http_route_config
4038
+ create_http_route_config = parent_rpcs.create_http_route if parent_rpcs.respond_to? :create_http_route
4039
+ @create_http_route = ::Gapic::Config::Method.new create_http_route_config
4040
+ update_http_route_config = parent_rpcs.update_http_route if parent_rpcs.respond_to? :update_http_route
4041
+ @update_http_route = ::Gapic::Config::Method.new update_http_route_config
4042
+ delete_http_route_config = parent_rpcs.delete_http_route if parent_rpcs.respond_to? :delete_http_route
4043
+ @delete_http_route = ::Gapic::Config::Method.new delete_http_route_config
4044
+ list_tcp_routes_config = parent_rpcs.list_tcp_routes if parent_rpcs.respond_to? :list_tcp_routes
4045
+ @list_tcp_routes = ::Gapic::Config::Method.new list_tcp_routes_config
4046
+ get_tcp_route_config = parent_rpcs.get_tcp_route if parent_rpcs.respond_to? :get_tcp_route
4047
+ @get_tcp_route = ::Gapic::Config::Method.new get_tcp_route_config
4048
+ create_tcp_route_config = parent_rpcs.create_tcp_route if parent_rpcs.respond_to? :create_tcp_route
4049
+ @create_tcp_route = ::Gapic::Config::Method.new create_tcp_route_config
4050
+ update_tcp_route_config = parent_rpcs.update_tcp_route if parent_rpcs.respond_to? :update_tcp_route
4051
+ @update_tcp_route = ::Gapic::Config::Method.new update_tcp_route_config
4052
+ delete_tcp_route_config = parent_rpcs.delete_tcp_route if parent_rpcs.respond_to? :delete_tcp_route
4053
+ @delete_tcp_route = ::Gapic::Config::Method.new delete_tcp_route_config
4054
+ list_tls_routes_config = parent_rpcs.list_tls_routes if parent_rpcs.respond_to? :list_tls_routes
4055
+ @list_tls_routes = ::Gapic::Config::Method.new list_tls_routes_config
4056
+ get_tls_route_config = parent_rpcs.get_tls_route if parent_rpcs.respond_to? :get_tls_route
4057
+ @get_tls_route = ::Gapic::Config::Method.new get_tls_route_config
4058
+ create_tls_route_config = parent_rpcs.create_tls_route if parent_rpcs.respond_to? :create_tls_route
4059
+ @create_tls_route = ::Gapic::Config::Method.new create_tls_route_config
4060
+ update_tls_route_config = parent_rpcs.update_tls_route if parent_rpcs.respond_to? :update_tls_route
4061
+ @update_tls_route = ::Gapic::Config::Method.new update_tls_route_config
4062
+ delete_tls_route_config = parent_rpcs.delete_tls_route if parent_rpcs.respond_to? :delete_tls_route
4063
+ @delete_tls_route = ::Gapic::Config::Method.new delete_tls_route_config
4064
+ list_service_bindings_config = parent_rpcs.list_service_bindings if parent_rpcs.respond_to? :list_service_bindings
4065
+ @list_service_bindings = ::Gapic::Config::Method.new list_service_bindings_config
4066
+ get_service_binding_config = parent_rpcs.get_service_binding if parent_rpcs.respond_to? :get_service_binding
4067
+ @get_service_binding = ::Gapic::Config::Method.new get_service_binding_config
4068
+ create_service_binding_config = parent_rpcs.create_service_binding if parent_rpcs.respond_to? :create_service_binding
4069
+ @create_service_binding = ::Gapic::Config::Method.new create_service_binding_config
4070
+ delete_service_binding_config = parent_rpcs.delete_service_binding if parent_rpcs.respond_to? :delete_service_binding
4071
+ @delete_service_binding = ::Gapic::Config::Method.new delete_service_binding_config
4072
+ list_meshes_config = parent_rpcs.list_meshes if parent_rpcs.respond_to? :list_meshes
4073
+ @list_meshes = ::Gapic::Config::Method.new list_meshes_config
4074
+ get_mesh_config = parent_rpcs.get_mesh if parent_rpcs.respond_to? :get_mesh
4075
+ @get_mesh = ::Gapic::Config::Method.new get_mesh_config
4076
+ create_mesh_config = parent_rpcs.create_mesh if parent_rpcs.respond_to? :create_mesh
4077
+ @create_mesh = ::Gapic::Config::Method.new create_mesh_config
4078
+ update_mesh_config = parent_rpcs.update_mesh if parent_rpcs.respond_to? :update_mesh
4079
+ @update_mesh = ::Gapic::Config::Method.new update_mesh_config
4080
+ delete_mesh_config = parent_rpcs.delete_mesh if parent_rpcs.respond_to? :delete_mesh
4081
+ @delete_mesh = ::Gapic::Config::Method.new delete_mesh_config
4082
+
4083
+ yield self if block_given?
4084
+ end
4085
+ end
4086
+ end
4087
+ end
4088
+ end
4089
+ end
4090
+ end
4091
+ end
4092
+ end
4093
+ end