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