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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) 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 +1505 -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 +1416 -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 +77 -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 +590 -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/struct.rb +96 -0
  63. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  64. data/proto_docs/google/rpc/status.rb +48 -0
  65. data/proto_docs/google/type/expr.rb +75 -0
  66. metadata +145 -10
@@ -0,0 +1,1505 @@
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/dep_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 DepService
29
+ ##
30
+ # Client for the DepService service.
31
+ #
32
+ # Service describing handlers for resources.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "networkservices.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :dep_service_stub
45
+
46
+ ##
47
+ # Configure the DepService Client class.
48
+ #
49
+ # See {::Google::Cloud::NetworkServices::V1::DepService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all DepService clients
55
+ # ::Google::Cloud::NetworkServices::V1::DepService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "NetworkServices", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.timeout = 60.0
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the DepService Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::NetworkServices::V1::DepService::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @dep_service_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new DepService client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::NetworkServices::V1::DepService::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::NetworkServices::V1::DepService::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the DepService client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ def initialize
129
+ # These require statements are intentionally placed here to initialize
130
+ # the gRPC module only when it's required.
131
+ # See https://github.com/googleapis/toolkit/issues/446
132
+ require "gapic/grpc"
133
+ require "google/cloud/networkservices/v1/dep_services_pb"
134
+
135
+ # Create the configuration object
136
+ @config = Configuration.new Client.configure
137
+
138
+ # Yield the configuration if needed
139
+ yield @config if block_given?
140
+
141
+ # Create credentials
142
+ credentials = @config.credentials
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
+ # but only if the default endpoint does not have a region prefix.
145
+ enable_self_signed_jwt = @config.endpoint.nil? ||
146
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
+ !@config.endpoint.split(".").first.include?("-"))
148
+ credentials ||= Credentials.default scope: @config.scope,
149
+ enable_self_signed_jwt: enable_self_signed_jwt
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
+ credentials = Credentials.new credentials, scope: @config.scope
152
+ end
153
+ @quota_project_id = @config.quota_project
154
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
155
+
156
+ @operations_client = Operations.new do |config|
157
+ config.credentials = credentials
158
+ config.quota_project = @quota_project_id
159
+ config.endpoint = @config.endpoint
160
+ config.universe_domain = @config.universe_domain
161
+ end
162
+
163
+ @dep_service_stub = ::Gapic::ServiceStub.new(
164
+ ::Google::Cloud::NetworkServices::V1::DepService::Stub,
165
+ credentials: credentials,
166
+ endpoint: @config.endpoint,
167
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
168
+ universe_domain: @config.universe_domain,
169
+ channel_args: @config.channel_args,
170
+ interceptors: @config.interceptors,
171
+ channel_pool_config: @config.channel_pool
172
+ )
173
+
174
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
175
+ config.credentials = credentials
176
+ config.quota_project = @quota_project_id
177
+ config.endpoint = @dep_service_stub.endpoint
178
+ config.universe_domain = @dep_service_stub.universe_domain
179
+ end
180
+
181
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
182
+ config.credentials = credentials
183
+ config.quota_project = @quota_project_id
184
+ config.endpoint = @dep_service_stub.endpoint
185
+ config.universe_domain = @dep_service_stub.universe_domain
186
+ end
187
+ end
188
+
189
+ ##
190
+ # Get the associated client for long-running operations.
191
+ #
192
+ # @return [::Google::Cloud::NetworkServices::V1::DepService::Operations]
193
+ #
194
+ attr_reader :operations_client
195
+
196
+ ##
197
+ # Get the associated client for mix-in of the Locations.
198
+ #
199
+ # @return [Google::Cloud::Location::Locations::Client]
200
+ #
201
+ attr_reader :location_client
202
+
203
+ ##
204
+ # Get the associated client for mix-in of the IAMPolicy.
205
+ #
206
+ # @return [Google::Iam::V1::IAMPolicy::Client]
207
+ #
208
+ attr_reader :iam_policy_client
209
+
210
+ # Service calls
211
+
212
+ ##
213
+ # Lists `LbTrafficExtension` resources in a given project and location.
214
+ #
215
+ # @overload list_lb_traffic_extensions(request, options = nil)
216
+ # Pass arguments to `list_lb_traffic_extensions` via a request object, either of type
217
+ # {::Google::Cloud::NetworkServices::V1::ListLbTrafficExtensionsRequest} or an equivalent Hash.
218
+ #
219
+ # @param request [::Google::Cloud::NetworkServices::V1::ListLbTrafficExtensionsRequest, ::Hash]
220
+ # A request object representing the call parameters. Required. To specify no
221
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
222
+ # @param options [::Gapic::CallOptions, ::Hash]
223
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
224
+ #
225
+ # @overload list_lb_traffic_extensions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
226
+ # Pass arguments to `list_lb_traffic_extensions` via keyword arguments. Note that at
227
+ # least one keyword argument is required. To specify no parameters, or to keep all
228
+ # the default parameter values, pass an empty Hash as a request object (see above).
229
+ #
230
+ # @param parent [::String]
231
+ # Required. The project and location from which the `LbTrafficExtension`
232
+ # resources are listed, specified in the following format:
233
+ # `projects/{project}/locations/{location}`.
234
+ # @param page_size [::Integer]
235
+ # Optional. Requested page size. The server might return fewer items than
236
+ # requested. If unspecified, the server picks an appropriate default.
237
+ # @param page_token [::String]
238
+ # Optional. A token identifying a page of results that the server returns.
239
+ # @param filter [::String]
240
+ # Optional. Filtering results.
241
+ # @param order_by [::String]
242
+ # Optional. Hint for how to order the results.
243
+ #
244
+ # @yield [response, operation] Access the result along with the RPC operation
245
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1::LbTrafficExtension>]
246
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
247
+ #
248
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1::LbTrafficExtension>]
249
+ #
250
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
251
+ #
252
+ # @example Basic example
253
+ # require "google/cloud/network_services/v1"
254
+ #
255
+ # # Create a client object. The client can be reused for multiple calls.
256
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
257
+ #
258
+ # # Create a request. To set request fields, pass in keyword arguments.
259
+ # request = Google::Cloud::NetworkServices::V1::ListLbTrafficExtensionsRequest.new
260
+ #
261
+ # # Call the list_lb_traffic_extensions method.
262
+ # result = client.list_lb_traffic_extensions request
263
+ #
264
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
265
+ # # over elements, and API calls will be issued to fetch pages as needed.
266
+ # result.each do |item|
267
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::LbTrafficExtension.
268
+ # p item
269
+ # end
270
+ #
271
+ def list_lb_traffic_extensions request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListLbTrafficExtensionsRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ metadata = @config.rpcs.list_lb_traffic_extensions.metadata.to_h
281
+
282
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
283
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
286
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
287
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
+
289
+ header_params = {}
290
+ if request.parent
291
+ header_params["parent"] = request.parent
292
+ end
293
+
294
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
295
+ metadata[:"x-goog-request-params"] ||= request_params_header
296
+
297
+ options.apply_defaults timeout: @config.rpcs.list_lb_traffic_extensions.timeout,
298
+ metadata: metadata,
299
+ retry_policy: @config.rpcs.list_lb_traffic_extensions.retry_policy
300
+
301
+ options.apply_defaults timeout: @config.timeout,
302
+ metadata: @config.metadata,
303
+ retry_policy: @config.retry_policy
304
+
305
+ @dep_service_stub.call_rpc :list_lb_traffic_extensions, request, options: options do |response, operation|
306
+ response = ::Gapic::PagedEnumerable.new @dep_service_stub, :list_lb_traffic_extensions, request, response, operation, options
307
+ yield response, operation if block_given?
308
+ return response
309
+ end
310
+ rescue ::GRPC::BadStatus => e
311
+ raise ::Google::Cloud::Error.from_error(e)
312
+ end
313
+
314
+ ##
315
+ # Gets details of the specified `LbTrafficExtension` resource.
316
+ #
317
+ # @overload get_lb_traffic_extension(request, options = nil)
318
+ # Pass arguments to `get_lb_traffic_extension` via a request object, either of type
319
+ # {::Google::Cloud::NetworkServices::V1::GetLbTrafficExtensionRequest} or an equivalent Hash.
320
+ #
321
+ # @param request [::Google::Cloud::NetworkServices::V1::GetLbTrafficExtensionRequest, ::Hash]
322
+ # A request object representing the call parameters. Required. To specify no
323
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
324
+ # @param options [::Gapic::CallOptions, ::Hash]
325
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
326
+ #
327
+ # @overload get_lb_traffic_extension(name: nil)
328
+ # Pass arguments to `get_lb_traffic_extension` via keyword arguments. Note that at
329
+ # least one keyword argument is required. To specify no parameters, or to keep all
330
+ # the default parameter values, pass an empty Hash as a request object (see above).
331
+ #
332
+ # @param name [::String]
333
+ # Required. A name of the `LbTrafficExtension` resource to get. Must be in
334
+ # the format
335
+ # `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`.
336
+ #
337
+ # @yield [response, operation] Access the result along with the RPC operation
338
+ # @yieldparam response [::Google::Cloud::NetworkServices::V1::LbTrafficExtension]
339
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
340
+ #
341
+ # @return [::Google::Cloud::NetworkServices::V1::LbTrafficExtension]
342
+ #
343
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
344
+ #
345
+ # @example Basic example
346
+ # require "google/cloud/network_services/v1"
347
+ #
348
+ # # Create a client object. The client can be reused for multiple calls.
349
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
350
+ #
351
+ # # Create a request. To set request fields, pass in keyword arguments.
352
+ # request = Google::Cloud::NetworkServices::V1::GetLbTrafficExtensionRequest.new
353
+ #
354
+ # # Call the get_lb_traffic_extension method.
355
+ # result = client.get_lb_traffic_extension request
356
+ #
357
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::LbTrafficExtension.
358
+ # p result
359
+ #
360
+ def get_lb_traffic_extension request, options = nil
361
+ raise ::ArgumentError, "request must be provided" if request.nil?
362
+
363
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetLbTrafficExtensionRequest
364
+
365
+ # Converts hash and nil to an options object
366
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
367
+
368
+ # Customize the options with defaults
369
+ metadata = @config.rpcs.get_lb_traffic_extension.metadata.to_h
370
+
371
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
372
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
373
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
374
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
375
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
376
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
377
+
378
+ header_params = {}
379
+ if request.name
380
+ header_params["name"] = request.name
381
+ end
382
+
383
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
384
+ metadata[:"x-goog-request-params"] ||= request_params_header
385
+
386
+ options.apply_defaults timeout: @config.rpcs.get_lb_traffic_extension.timeout,
387
+ metadata: metadata,
388
+ retry_policy: @config.rpcs.get_lb_traffic_extension.retry_policy
389
+
390
+ options.apply_defaults timeout: @config.timeout,
391
+ metadata: @config.metadata,
392
+ retry_policy: @config.retry_policy
393
+
394
+ @dep_service_stub.call_rpc :get_lb_traffic_extension, request, options: options do |response, operation|
395
+ yield response, operation if block_given?
396
+ return response
397
+ end
398
+ rescue ::GRPC::BadStatus => e
399
+ raise ::Google::Cloud::Error.from_error(e)
400
+ end
401
+
402
+ ##
403
+ # Creates a new `LbTrafficExtension` resource in a given project and
404
+ # location.
405
+ #
406
+ # @overload create_lb_traffic_extension(request, options = nil)
407
+ # Pass arguments to `create_lb_traffic_extension` via a request object, either of type
408
+ # {::Google::Cloud::NetworkServices::V1::CreateLbTrafficExtensionRequest} or an equivalent Hash.
409
+ #
410
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateLbTrafficExtensionRequest, ::Hash]
411
+ # A request object representing the call parameters. Required. To specify no
412
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
413
+ # @param options [::Gapic::CallOptions, ::Hash]
414
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
415
+ #
416
+ # @overload create_lb_traffic_extension(parent: nil, lb_traffic_extension_id: nil, lb_traffic_extension: nil, request_id: nil)
417
+ # Pass arguments to `create_lb_traffic_extension` via keyword arguments. Note that at
418
+ # least one keyword argument is required. To specify no parameters, or to keep all
419
+ # the default parameter values, pass an empty Hash as a request object (see above).
420
+ #
421
+ # @param parent [::String]
422
+ # Required. The parent resource of the `LbTrafficExtension` resource. Must be
423
+ # in the format `projects/{project}/locations/{location}`.
424
+ # @param lb_traffic_extension_id [::String]
425
+ # Required. User-provided ID of the `LbTrafficExtension` resource to be
426
+ # created.
427
+ # @param lb_traffic_extension [::Google::Cloud::NetworkServices::V1::LbTrafficExtension, ::Hash]
428
+ # Required. `LbTrafficExtension` resource to be created.
429
+ # @param request_id [::String]
430
+ # Optional. An optional request ID to identify requests. Specify a unique
431
+ # request ID so that if you must retry your request, the server can ignore
432
+ # the request if it has already been completed. The server guarantees
433
+ # that for at least 60 minutes since the first request.
434
+ #
435
+ # For example, consider a situation where you make an initial request and the
436
+ # request times out. If you make the request again with the same request
437
+ # ID, the server can check if original operation with the same request ID
438
+ # was received, and if so, ignores the second request. This prevents
439
+ # clients from accidentally creating duplicate commitments.
440
+ #
441
+ # The request ID must be a valid UUID with the exception that zero UUID is
442
+ # not supported (00000000-0000-0000-0000-000000000000).
443
+ #
444
+ # @yield [response, operation] Access the result along with the RPC operation
445
+ # @yieldparam response [::Gapic::Operation]
446
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
447
+ #
448
+ # @return [::Gapic::Operation]
449
+ #
450
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
451
+ #
452
+ # @example Basic example
453
+ # require "google/cloud/network_services/v1"
454
+ #
455
+ # # Create a client object. The client can be reused for multiple calls.
456
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
457
+ #
458
+ # # Create a request. To set request fields, pass in keyword arguments.
459
+ # request = Google::Cloud::NetworkServices::V1::CreateLbTrafficExtensionRequest.new
460
+ #
461
+ # # Call the create_lb_traffic_extension method.
462
+ # result = client.create_lb_traffic_extension request
463
+ #
464
+ # # The returned object is of type Gapic::Operation. You can use it to
465
+ # # check the status of an operation, cancel it, or wait for results.
466
+ # # Here is how to wait for a response.
467
+ # result.wait_until_done! timeout: 60
468
+ # if result.response?
469
+ # p result.response
470
+ # else
471
+ # puts "No response received."
472
+ # end
473
+ #
474
+ def create_lb_traffic_extension request, options = nil
475
+ raise ::ArgumentError, "request must be provided" if request.nil?
476
+
477
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateLbTrafficExtensionRequest
478
+
479
+ # Converts hash and nil to an options object
480
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
481
+
482
+ # Customize the options with defaults
483
+ metadata = @config.rpcs.create_lb_traffic_extension.metadata.to_h
484
+
485
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
486
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
487
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
488
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
489
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
490
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
491
+
492
+ header_params = {}
493
+ if request.parent
494
+ header_params["parent"] = request.parent
495
+ end
496
+
497
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
498
+ metadata[:"x-goog-request-params"] ||= request_params_header
499
+
500
+ options.apply_defaults timeout: @config.rpcs.create_lb_traffic_extension.timeout,
501
+ metadata: metadata,
502
+ retry_policy: @config.rpcs.create_lb_traffic_extension.retry_policy
503
+
504
+ options.apply_defaults timeout: @config.timeout,
505
+ metadata: @config.metadata,
506
+ retry_policy: @config.retry_policy
507
+
508
+ @dep_service_stub.call_rpc :create_lb_traffic_extension, request, options: options do |response, operation|
509
+ response = ::Gapic::Operation.new response, @operations_client, options: options
510
+ yield response, operation if block_given?
511
+ return response
512
+ end
513
+ rescue ::GRPC::BadStatus => e
514
+ raise ::Google::Cloud::Error.from_error(e)
515
+ end
516
+
517
+ ##
518
+ # Updates the parameters of the specified `LbTrafficExtension` resource.
519
+ #
520
+ # @overload update_lb_traffic_extension(request, options = nil)
521
+ # Pass arguments to `update_lb_traffic_extension` via a request object, either of type
522
+ # {::Google::Cloud::NetworkServices::V1::UpdateLbTrafficExtensionRequest} or an equivalent Hash.
523
+ #
524
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateLbTrafficExtensionRequest, ::Hash]
525
+ # A request object representing the call parameters. Required. To specify no
526
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
527
+ # @param options [::Gapic::CallOptions, ::Hash]
528
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
529
+ #
530
+ # @overload update_lb_traffic_extension(update_mask: nil, lb_traffic_extension: nil, request_id: nil)
531
+ # Pass arguments to `update_lb_traffic_extension` via keyword arguments. Note that at
532
+ # least one keyword argument is required. To specify no parameters, or to keep all
533
+ # the default parameter values, pass an empty Hash as a request object (see above).
534
+ #
535
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
536
+ # Optional. Used to specify the fields to be overwritten in the
537
+ # `LbTrafficExtension` resource by the update.
538
+ # The fields specified in the update_mask are relative to the resource, not
539
+ # the full request. A field is overwritten if it is in the mask. If the
540
+ # user does not specify a mask, then all fields are overwritten.
541
+ # @param lb_traffic_extension [::Google::Cloud::NetworkServices::V1::LbTrafficExtension, ::Hash]
542
+ # Required. `LbTrafficExtension` resource being updated.
543
+ # @param request_id [::String]
544
+ # Optional. An optional request ID to identify requests. Specify a unique
545
+ # request ID so that if you must retry your request, the server can ignore
546
+ # the request if it has already been completed. The server guarantees
547
+ # that for at least 60 minutes since the first request.
548
+ #
549
+ # For example, consider a situation where you make an initial request and the
550
+ # request times out. If you make the request again with the same request
551
+ # ID, the server can check if original operation with the same request ID
552
+ # was received, and if so, ignores the second request. This prevents
553
+ # clients from accidentally creating duplicate commitments.
554
+ #
555
+ # The request ID must be a valid UUID with the exception that zero UUID is
556
+ # not supported (00000000-0000-0000-0000-000000000000).
557
+ #
558
+ # @yield [response, operation] Access the result along with the RPC operation
559
+ # @yieldparam response [::Gapic::Operation]
560
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
561
+ #
562
+ # @return [::Gapic::Operation]
563
+ #
564
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
565
+ #
566
+ # @example Basic example
567
+ # require "google/cloud/network_services/v1"
568
+ #
569
+ # # Create a client object. The client can be reused for multiple calls.
570
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
571
+ #
572
+ # # Create a request. To set request fields, pass in keyword arguments.
573
+ # request = Google::Cloud::NetworkServices::V1::UpdateLbTrafficExtensionRequest.new
574
+ #
575
+ # # Call the update_lb_traffic_extension method.
576
+ # result = client.update_lb_traffic_extension request
577
+ #
578
+ # # The returned object is of type Gapic::Operation. You can use it to
579
+ # # check the status of an operation, cancel it, or wait for results.
580
+ # # Here is how to wait for a response.
581
+ # result.wait_until_done! timeout: 60
582
+ # if result.response?
583
+ # p result.response
584
+ # else
585
+ # puts "No response received."
586
+ # end
587
+ #
588
+ def update_lb_traffic_extension request, options = nil
589
+ raise ::ArgumentError, "request must be provided" if request.nil?
590
+
591
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateLbTrafficExtensionRequest
592
+
593
+ # Converts hash and nil to an options object
594
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
595
+
596
+ # Customize the options with defaults
597
+ metadata = @config.rpcs.update_lb_traffic_extension.metadata.to_h
598
+
599
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
600
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
601
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
602
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
603
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
604
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
605
+
606
+ header_params = {}
607
+ if request.lb_traffic_extension&.name
608
+ header_params["lb_traffic_extension.name"] = request.lb_traffic_extension.name
609
+ end
610
+
611
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
612
+ metadata[:"x-goog-request-params"] ||= request_params_header
613
+
614
+ options.apply_defaults timeout: @config.rpcs.update_lb_traffic_extension.timeout,
615
+ metadata: metadata,
616
+ retry_policy: @config.rpcs.update_lb_traffic_extension.retry_policy
617
+
618
+ options.apply_defaults timeout: @config.timeout,
619
+ metadata: @config.metadata,
620
+ retry_policy: @config.retry_policy
621
+
622
+ @dep_service_stub.call_rpc :update_lb_traffic_extension, request, options: options do |response, operation|
623
+ response = ::Gapic::Operation.new response, @operations_client, options: options
624
+ yield response, operation if block_given?
625
+ return response
626
+ end
627
+ rescue ::GRPC::BadStatus => e
628
+ raise ::Google::Cloud::Error.from_error(e)
629
+ end
630
+
631
+ ##
632
+ # Deletes the specified `LbTrafficExtension` resource.
633
+ #
634
+ # @overload delete_lb_traffic_extension(request, options = nil)
635
+ # Pass arguments to `delete_lb_traffic_extension` via a request object, either of type
636
+ # {::Google::Cloud::NetworkServices::V1::DeleteLbTrafficExtensionRequest} or an equivalent Hash.
637
+ #
638
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteLbTrafficExtensionRequest, ::Hash]
639
+ # A request object representing the call parameters. Required. To specify no
640
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
641
+ # @param options [::Gapic::CallOptions, ::Hash]
642
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
643
+ #
644
+ # @overload delete_lb_traffic_extension(name: nil, request_id: nil)
645
+ # Pass arguments to `delete_lb_traffic_extension` via keyword arguments. Note that at
646
+ # least one keyword argument is required. To specify no parameters, or to keep all
647
+ # the default parameter values, pass an empty Hash as a request object (see above).
648
+ #
649
+ # @param name [::String]
650
+ # Required. The name of the `LbTrafficExtension` resource to delete. Must be
651
+ # in the format
652
+ # `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`.
653
+ # @param request_id [::String]
654
+ # Optional. An optional request ID to identify requests. Specify a unique
655
+ # request ID so that if you must retry your request, the server can ignore
656
+ # the request if it has already been completed. The server guarantees
657
+ # that for at least 60 minutes after the first request.
658
+ #
659
+ # For example, consider a situation where you make an initial request and the
660
+ # request times out. If you make the request again with the same request
661
+ # ID, the server can check if original operation with the same request ID
662
+ # was received, and if so, ignores the second request. This prevents
663
+ # clients from accidentally creating duplicate commitments.
664
+ #
665
+ # The request ID must be a valid UUID with the exception that zero UUID is
666
+ # not supported (00000000-0000-0000-0000-000000000000).
667
+ #
668
+ # @yield [response, operation] Access the result along with the RPC operation
669
+ # @yieldparam response [::Gapic::Operation]
670
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
671
+ #
672
+ # @return [::Gapic::Operation]
673
+ #
674
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
675
+ #
676
+ # @example Basic example
677
+ # require "google/cloud/network_services/v1"
678
+ #
679
+ # # Create a client object. The client can be reused for multiple calls.
680
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
681
+ #
682
+ # # Create a request. To set request fields, pass in keyword arguments.
683
+ # request = Google::Cloud::NetworkServices::V1::DeleteLbTrafficExtensionRequest.new
684
+ #
685
+ # # Call the delete_lb_traffic_extension method.
686
+ # result = client.delete_lb_traffic_extension request
687
+ #
688
+ # # The returned object is of type Gapic::Operation. You can use it to
689
+ # # check the status of an operation, cancel it, or wait for results.
690
+ # # Here is how to wait for a response.
691
+ # result.wait_until_done! timeout: 60
692
+ # if result.response?
693
+ # p result.response
694
+ # else
695
+ # puts "No response received."
696
+ # end
697
+ #
698
+ def delete_lb_traffic_extension request, options = nil
699
+ raise ::ArgumentError, "request must be provided" if request.nil?
700
+
701
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteLbTrafficExtensionRequest
702
+
703
+ # Converts hash and nil to an options object
704
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
705
+
706
+ # Customize the options with defaults
707
+ metadata = @config.rpcs.delete_lb_traffic_extension.metadata.to_h
708
+
709
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
710
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
711
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
712
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
713
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
714
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
715
+
716
+ header_params = {}
717
+ if request.name
718
+ header_params["name"] = request.name
719
+ end
720
+
721
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
722
+ metadata[:"x-goog-request-params"] ||= request_params_header
723
+
724
+ options.apply_defaults timeout: @config.rpcs.delete_lb_traffic_extension.timeout,
725
+ metadata: metadata,
726
+ retry_policy: @config.rpcs.delete_lb_traffic_extension.retry_policy
727
+
728
+ options.apply_defaults timeout: @config.timeout,
729
+ metadata: @config.metadata,
730
+ retry_policy: @config.retry_policy
731
+
732
+ @dep_service_stub.call_rpc :delete_lb_traffic_extension, request, options: options do |response, operation|
733
+ response = ::Gapic::Operation.new response, @operations_client, options: options
734
+ yield response, operation if block_given?
735
+ return response
736
+ end
737
+ rescue ::GRPC::BadStatus => e
738
+ raise ::Google::Cloud::Error.from_error(e)
739
+ end
740
+
741
+ ##
742
+ # Lists `LbRouteExtension` resources in a given project and location.
743
+ #
744
+ # @overload list_lb_route_extensions(request, options = nil)
745
+ # Pass arguments to `list_lb_route_extensions` via a request object, either of type
746
+ # {::Google::Cloud::NetworkServices::V1::ListLbRouteExtensionsRequest} or an equivalent Hash.
747
+ #
748
+ # @param request [::Google::Cloud::NetworkServices::V1::ListLbRouteExtensionsRequest, ::Hash]
749
+ # A request object representing the call parameters. Required. To specify no
750
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
751
+ # @param options [::Gapic::CallOptions, ::Hash]
752
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
753
+ #
754
+ # @overload list_lb_route_extensions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
755
+ # Pass arguments to `list_lb_route_extensions` via keyword arguments. Note that at
756
+ # least one keyword argument is required. To specify no parameters, or to keep all
757
+ # the default parameter values, pass an empty Hash as a request object (see above).
758
+ #
759
+ # @param parent [::String]
760
+ # Required. The project and location from which the `LbRouteExtension`
761
+ # resources are listed, specified in the following format:
762
+ # `projects/{project}/locations/{location}`.
763
+ # @param page_size [::Integer]
764
+ # Optional. Requested page size. The server might return fewer items than
765
+ # requested. If unspecified, the server picks an appropriate default.
766
+ # @param page_token [::String]
767
+ # Optional. A token identifying a page of results that the server returns.
768
+ # @param filter [::String]
769
+ # Optional. Filtering results.
770
+ # @param order_by [::String]
771
+ # Optional. Hint for how to order the results.
772
+ #
773
+ # @yield [response, operation] Access the result along with the RPC operation
774
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1::LbRouteExtension>]
775
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
776
+ #
777
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1::LbRouteExtension>]
778
+ #
779
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
780
+ #
781
+ # @example Basic example
782
+ # require "google/cloud/network_services/v1"
783
+ #
784
+ # # Create a client object. The client can be reused for multiple calls.
785
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
786
+ #
787
+ # # Create a request. To set request fields, pass in keyword arguments.
788
+ # request = Google::Cloud::NetworkServices::V1::ListLbRouteExtensionsRequest.new
789
+ #
790
+ # # Call the list_lb_route_extensions method.
791
+ # result = client.list_lb_route_extensions request
792
+ #
793
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
794
+ # # over elements, and API calls will be issued to fetch pages as needed.
795
+ # result.each do |item|
796
+ # # Each element is of type ::Google::Cloud::NetworkServices::V1::LbRouteExtension.
797
+ # p item
798
+ # end
799
+ #
800
+ def list_lb_route_extensions request, options = nil
801
+ raise ::ArgumentError, "request must be provided" if request.nil?
802
+
803
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListLbRouteExtensionsRequest
804
+
805
+ # Converts hash and nil to an options object
806
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
807
+
808
+ # Customize the options with defaults
809
+ metadata = @config.rpcs.list_lb_route_extensions.metadata.to_h
810
+
811
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
812
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
813
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
814
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
815
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
816
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
817
+
818
+ header_params = {}
819
+ if request.parent
820
+ header_params["parent"] = request.parent
821
+ end
822
+
823
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
824
+ metadata[:"x-goog-request-params"] ||= request_params_header
825
+
826
+ options.apply_defaults timeout: @config.rpcs.list_lb_route_extensions.timeout,
827
+ metadata: metadata,
828
+ retry_policy: @config.rpcs.list_lb_route_extensions.retry_policy
829
+
830
+ options.apply_defaults timeout: @config.timeout,
831
+ metadata: @config.metadata,
832
+ retry_policy: @config.retry_policy
833
+
834
+ @dep_service_stub.call_rpc :list_lb_route_extensions, request, options: options do |response, operation|
835
+ response = ::Gapic::PagedEnumerable.new @dep_service_stub, :list_lb_route_extensions, request, response, operation, options
836
+ yield response, operation if block_given?
837
+ return response
838
+ end
839
+ rescue ::GRPC::BadStatus => e
840
+ raise ::Google::Cloud::Error.from_error(e)
841
+ end
842
+
843
+ ##
844
+ # Gets details of the specified `LbRouteExtension` resource.
845
+ #
846
+ # @overload get_lb_route_extension(request, options = nil)
847
+ # Pass arguments to `get_lb_route_extension` via a request object, either of type
848
+ # {::Google::Cloud::NetworkServices::V1::GetLbRouteExtensionRequest} or an equivalent Hash.
849
+ #
850
+ # @param request [::Google::Cloud::NetworkServices::V1::GetLbRouteExtensionRequest, ::Hash]
851
+ # A request object representing the call parameters. Required. To specify no
852
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
853
+ # @param options [::Gapic::CallOptions, ::Hash]
854
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
855
+ #
856
+ # @overload get_lb_route_extension(name: nil)
857
+ # Pass arguments to `get_lb_route_extension` via keyword arguments. Note that at
858
+ # least one keyword argument is required. To specify no parameters, or to keep all
859
+ # the default parameter values, pass an empty Hash as a request object (see above).
860
+ #
861
+ # @param name [::String]
862
+ # Required. A name of the `LbRouteExtension` resource to get. Must be in the
863
+ # format
864
+ # `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`.
865
+ #
866
+ # @yield [response, operation] Access the result along with the RPC operation
867
+ # @yieldparam response [::Google::Cloud::NetworkServices::V1::LbRouteExtension]
868
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
869
+ #
870
+ # @return [::Google::Cloud::NetworkServices::V1::LbRouteExtension]
871
+ #
872
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
873
+ #
874
+ # @example Basic example
875
+ # require "google/cloud/network_services/v1"
876
+ #
877
+ # # Create a client object. The client can be reused for multiple calls.
878
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
879
+ #
880
+ # # Create a request. To set request fields, pass in keyword arguments.
881
+ # request = Google::Cloud::NetworkServices::V1::GetLbRouteExtensionRequest.new
882
+ #
883
+ # # Call the get_lb_route_extension method.
884
+ # result = client.get_lb_route_extension request
885
+ #
886
+ # # The returned object is of type Google::Cloud::NetworkServices::V1::LbRouteExtension.
887
+ # p result
888
+ #
889
+ def get_lb_route_extension request, options = nil
890
+ raise ::ArgumentError, "request must be provided" if request.nil?
891
+
892
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetLbRouteExtensionRequest
893
+
894
+ # Converts hash and nil to an options object
895
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
896
+
897
+ # Customize the options with defaults
898
+ metadata = @config.rpcs.get_lb_route_extension.metadata.to_h
899
+
900
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
901
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
902
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
903
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
904
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
905
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
906
+
907
+ header_params = {}
908
+ if request.name
909
+ header_params["name"] = request.name
910
+ end
911
+
912
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
913
+ metadata[:"x-goog-request-params"] ||= request_params_header
914
+
915
+ options.apply_defaults timeout: @config.rpcs.get_lb_route_extension.timeout,
916
+ metadata: metadata,
917
+ retry_policy: @config.rpcs.get_lb_route_extension.retry_policy
918
+
919
+ options.apply_defaults timeout: @config.timeout,
920
+ metadata: @config.metadata,
921
+ retry_policy: @config.retry_policy
922
+
923
+ @dep_service_stub.call_rpc :get_lb_route_extension, request, options: options do |response, operation|
924
+ yield response, operation if block_given?
925
+ return response
926
+ end
927
+ rescue ::GRPC::BadStatus => e
928
+ raise ::Google::Cloud::Error.from_error(e)
929
+ end
930
+
931
+ ##
932
+ # Creates a new `LbRouteExtension` resource in a given project and location.
933
+ #
934
+ # @overload create_lb_route_extension(request, options = nil)
935
+ # Pass arguments to `create_lb_route_extension` via a request object, either of type
936
+ # {::Google::Cloud::NetworkServices::V1::CreateLbRouteExtensionRequest} or an equivalent Hash.
937
+ #
938
+ # @param request [::Google::Cloud::NetworkServices::V1::CreateLbRouteExtensionRequest, ::Hash]
939
+ # A request object representing the call parameters. Required. To specify no
940
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
941
+ # @param options [::Gapic::CallOptions, ::Hash]
942
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
943
+ #
944
+ # @overload create_lb_route_extension(parent: nil, lb_route_extension_id: nil, lb_route_extension: nil, request_id: nil)
945
+ # Pass arguments to `create_lb_route_extension` via keyword arguments. Note that at
946
+ # least one keyword argument is required. To specify no parameters, or to keep all
947
+ # the default parameter values, pass an empty Hash as a request object (see above).
948
+ #
949
+ # @param parent [::String]
950
+ # Required. The parent resource of the `LbRouteExtension` resource. Must be
951
+ # in the format `projects/{project}/locations/{location}`.
952
+ # @param lb_route_extension_id [::String]
953
+ # Required. User-provided ID of the `LbRouteExtension` resource to be
954
+ # created.
955
+ # @param lb_route_extension [::Google::Cloud::NetworkServices::V1::LbRouteExtension, ::Hash]
956
+ # Required. `LbRouteExtension` resource to be created.
957
+ # @param request_id [::String]
958
+ # Optional. An optional request ID to identify requests. Specify a unique
959
+ # request ID so that if you must retry your request, the server can ignore
960
+ # the request if it has already been completed. The server guarantees
961
+ # that for at least 60 minutes since the first request.
962
+ #
963
+ # For example, consider a situation where you make an initial request and the
964
+ # request times out. If you make the request again with the same request
965
+ # ID, the server can check if original operation with the same request ID
966
+ # was received, and if so, ignores the second request. This prevents
967
+ # clients from accidentally creating duplicate commitments.
968
+ #
969
+ # The request ID must be a valid UUID with the exception that zero UUID is
970
+ # not supported (00000000-0000-0000-0000-000000000000).
971
+ #
972
+ # @yield [response, operation] Access the result along with the RPC operation
973
+ # @yieldparam response [::Gapic::Operation]
974
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
975
+ #
976
+ # @return [::Gapic::Operation]
977
+ #
978
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
979
+ #
980
+ # @example Basic example
981
+ # require "google/cloud/network_services/v1"
982
+ #
983
+ # # Create a client object. The client can be reused for multiple calls.
984
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
985
+ #
986
+ # # Create a request. To set request fields, pass in keyword arguments.
987
+ # request = Google::Cloud::NetworkServices::V1::CreateLbRouteExtensionRequest.new
988
+ #
989
+ # # Call the create_lb_route_extension method.
990
+ # result = client.create_lb_route_extension request
991
+ #
992
+ # # The returned object is of type Gapic::Operation. You can use it to
993
+ # # check the status of an operation, cancel it, or wait for results.
994
+ # # Here is how to wait for a response.
995
+ # result.wait_until_done! timeout: 60
996
+ # if result.response?
997
+ # p result.response
998
+ # else
999
+ # puts "No response received."
1000
+ # end
1001
+ #
1002
+ def create_lb_route_extension request, options = nil
1003
+ raise ::ArgumentError, "request must be provided" if request.nil?
1004
+
1005
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateLbRouteExtensionRequest
1006
+
1007
+ # Converts hash and nil to an options object
1008
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1009
+
1010
+ # Customize the options with defaults
1011
+ metadata = @config.rpcs.create_lb_route_extension.metadata.to_h
1012
+
1013
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1014
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1015
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1016
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
1017
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1018
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1019
+
1020
+ header_params = {}
1021
+ if request.parent
1022
+ header_params["parent"] = request.parent
1023
+ end
1024
+
1025
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1026
+ metadata[:"x-goog-request-params"] ||= request_params_header
1027
+
1028
+ options.apply_defaults timeout: @config.rpcs.create_lb_route_extension.timeout,
1029
+ metadata: metadata,
1030
+ retry_policy: @config.rpcs.create_lb_route_extension.retry_policy
1031
+
1032
+ options.apply_defaults timeout: @config.timeout,
1033
+ metadata: @config.metadata,
1034
+ retry_policy: @config.retry_policy
1035
+
1036
+ @dep_service_stub.call_rpc :create_lb_route_extension, request, options: options do |response, operation|
1037
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1038
+ yield response, operation if block_given?
1039
+ return response
1040
+ end
1041
+ rescue ::GRPC::BadStatus => e
1042
+ raise ::Google::Cloud::Error.from_error(e)
1043
+ end
1044
+
1045
+ ##
1046
+ # Updates the parameters of the specified `LbRouteExtension` resource.
1047
+ #
1048
+ # @overload update_lb_route_extension(request, options = nil)
1049
+ # Pass arguments to `update_lb_route_extension` via a request object, either of type
1050
+ # {::Google::Cloud::NetworkServices::V1::UpdateLbRouteExtensionRequest} or an equivalent Hash.
1051
+ #
1052
+ # @param request [::Google::Cloud::NetworkServices::V1::UpdateLbRouteExtensionRequest, ::Hash]
1053
+ # A request object representing the call parameters. Required. To specify no
1054
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1055
+ # @param options [::Gapic::CallOptions, ::Hash]
1056
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1057
+ #
1058
+ # @overload update_lb_route_extension(update_mask: nil, lb_route_extension: nil, request_id: nil)
1059
+ # Pass arguments to `update_lb_route_extension` via keyword arguments. Note that at
1060
+ # least one keyword argument is required. To specify no parameters, or to keep all
1061
+ # the default parameter values, pass an empty Hash as a request object (see above).
1062
+ #
1063
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1064
+ # Optional. Used to specify the fields to be overwritten in the
1065
+ # `LbRouteExtension` resource by the update.
1066
+ # The fields specified in the update_mask are relative to the resource, not
1067
+ # the full request. A field is overwritten if it is in the mask. If the
1068
+ # user does not specify a mask, then all fields are overwritten.
1069
+ # @param lb_route_extension [::Google::Cloud::NetworkServices::V1::LbRouteExtension, ::Hash]
1070
+ # Required. `LbRouteExtension` resource being updated.
1071
+ # @param request_id [::String]
1072
+ # Optional. An optional request ID to identify requests. Specify a unique
1073
+ # request ID so that if you must retry your request, the server can ignore
1074
+ # the request if it has already been completed. The server guarantees
1075
+ # that for at least 60 minutes since the first request.
1076
+ #
1077
+ # For example, consider a situation where you make an initial request and the
1078
+ # request times out. If you make the request again with the same request
1079
+ # ID, the server can check if original operation with the same request ID
1080
+ # was received, and if so, ignores the second request. This prevents
1081
+ # clients from accidentally creating duplicate commitments.
1082
+ #
1083
+ # The request ID must be a valid UUID with the exception that zero UUID is
1084
+ # not supported (00000000-0000-0000-0000-000000000000).
1085
+ #
1086
+ # @yield [response, operation] Access the result along with the RPC operation
1087
+ # @yieldparam response [::Gapic::Operation]
1088
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1089
+ #
1090
+ # @return [::Gapic::Operation]
1091
+ #
1092
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1093
+ #
1094
+ # @example Basic example
1095
+ # require "google/cloud/network_services/v1"
1096
+ #
1097
+ # # Create a client object. The client can be reused for multiple calls.
1098
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
1099
+ #
1100
+ # # Create a request. To set request fields, pass in keyword arguments.
1101
+ # request = Google::Cloud::NetworkServices::V1::UpdateLbRouteExtensionRequest.new
1102
+ #
1103
+ # # Call the update_lb_route_extension method.
1104
+ # result = client.update_lb_route_extension request
1105
+ #
1106
+ # # The returned object is of type Gapic::Operation. You can use it to
1107
+ # # check the status of an operation, cancel it, or wait for results.
1108
+ # # Here is how to wait for a response.
1109
+ # result.wait_until_done! timeout: 60
1110
+ # if result.response?
1111
+ # p result.response
1112
+ # else
1113
+ # puts "No response received."
1114
+ # end
1115
+ #
1116
+ def update_lb_route_extension request, options = nil
1117
+ raise ::ArgumentError, "request must be provided" if request.nil?
1118
+
1119
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateLbRouteExtensionRequest
1120
+
1121
+ # Converts hash and nil to an options object
1122
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1123
+
1124
+ # Customize the options with defaults
1125
+ metadata = @config.rpcs.update_lb_route_extension.metadata.to_h
1126
+
1127
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1128
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1129
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1130
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
1131
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1132
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1133
+
1134
+ header_params = {}
1135
+ if request.lb_route_extension&.name
1136
+ header_params["lb_route_extension.name"] = request.lb_route_extension.name
1137
+ end
1138
+
1139
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1140
+ metadata[:"x-goog-request-params"] ||= request_params_header
1141
+
1142
+ options.apply_defaults timeout: @config.rpcs.update_lb_route_extension.timeout,
1143
+ metadata: metadata,
1144
+ retry_policy: @config.rpcs.update_lb_route_extension.retry_policy
1145
+
1146
+ options.apply_defaults timeout: @config.timeout,
1147
+ metadata: @config.metadata,
1148
+ retry_policy: @config.retry_policy
1149
+
1150
+ @dep_service_stub.call_rpc :update_lb_route_extension, request, options: options do |response, operation|
1151
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1152
+ yield response, operation if block_given?
1153
+ return response
1154
+ end
1155
+ rescue ::GRPC::BadStatus => e
1156
+ raise ::Google::Cloud::Error.from_error(e)
1157
+ end
1158
+
1159
+ ##
1160
+ # Deletes the specified `LbRouteExtension` resource.
1161
+ #
1162
+ # @overload delete_lb_route_extension(request, options = nil)
1163
+ # Pass arguments to `delete_lb_route_extension` via a request object, either of type
1164
+ # {::Google::Cloud::NetworkServices::V1::DeleteLbRouteExtensionRequest} or an equivalent Hash.
1165
+ #
1166
+ # @param request [::Google::Cloud::NetworkServices::V1::DeleteLbRouteExtensionRequest, ::Hash]
1167
+ # A request object representing the call parameters. Required. To specify no
1168
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1169
+ # @param options [::Gapic::CallOptions, ::Hash]
1170
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1171
+ #
1172
+ # @overload delete_lb_route_extension(name: nil, request_id: nil)
1173
+ # Pass arguments to `delete_lb_route_extension` via keyword arguments. Note that at
1174
+ # least one keyword argument is required. To specify no parameters, or to keep all
1175
+ # the default parameter values, pass an empty Hash as a request object (see above).
1176
+ #
1177
+ # @param name [::String]
1178
+ # Required. The name of the `LbRouteExtension` resource to delete. Must be in
1179
+ # the format
1180
+ # `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`.
1181
+ # @param request_id [::String]
1182
+ # Optional. An optional request ID to identify requests. Specify a unique
1183
+ # request ID so that if you must retry your request, the server can ignore
1184
+ # the request if it has already been completed. The server guarantees
1185
+ # that for at least 60 minutes after the first request.
1186
+ #
1187
+ # For example, consider a situation where you make an initial request and the
1188
+ # request times out. If you make the request again with the same request
1189
+ # ID, the server can check if original operation with the same request ID
1190
+ # was received, and if so, ignores the second request. This prevents
1191
+ # clients from accidentally creating duplicate commitments.
1192
+ #
1193
+ # The request ID must be a valid UUID with the exception that zero UUID is
1194
+ # not supported (00000000-0000-0000-0000-000000000000).
1195
+ #
1196
+ # @yield [response, operation] Access the result along with the RPC operation
1197
+ # @yieldparam response [::Gapic::Operation]
1198
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1199
+ #
1200
+ # @return [::Gapic::Operation]
1201
+ #
1202
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1203
+ #
1204
+ # @example Basic example
1205
+ # require "google/cloud/network_services/v1"
1206
+ #
1207
+ # # Create a client object. The client can be reused for multiple calls.
1208
+ # client = Google::Cloud::NetworkServices::V1::DepService::Client.new
1209
+ #
1210
+ # # Create a request. To set request fields, pass in keyword arguments.
1211
+ # request = Google::Cloud::NetworkServices::V1::DeleteLbRouteExtensionRequest.new
1212
+ #
1213
+ # # Call the delete_lb_route_extension method.
1214
+ # result = client.delete_lb_route_extension request
1215
+ #
1216
+ # # The returned object is of type Gapic::Operation. You can use it to
1217
+ # # check the status of an operation, cancel it, or wait for results.
1218
+ # # Here is how to wait for a response.
1219
+ # result.wait_until_done! timeout: 60
1220
+ # if result.response?
1221
+ # p result.response
1222
+ # else
1223
+ # puts "No response received."
1224
+ # end
1225
+ #
1226
+ def delete_lb_route_extension request, options = nil
1227
+ raise ::ArgumentError, "request must be provided" if request.nil?
1228
+
1229
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteLbRouteExtensionRequest
1230
+
1231
+ # Converts hash and nil to an options object
1232
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1233
+
1234
+ # Customize the options with defaults
1235
+ metadata = @config.rpcs.delete_lb_route_extension.metadata.to_h
1236
+
1237
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1238
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1239
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1240
+ gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION
1241
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1242
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1243
+
1244
+ header_params = {}
1245
+ if request.name
1246
+ header_params["name"] = request.name
1247
+ end
1248
+
1249
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1250
+ metadata[:"x-goog-request-params"] ||= request_params_header
1251
+
1252
+ options.apply_defaults timeout: @config.rpcs.delete_lb_route_extension.timeout,
1253
+ metadata: metadata,
1254
+ retry_policy: @config.rpcs.delete_lb_route_extension.retry_policy
1255
+
1256
+ options.apply_defaults timeout: @config.timeout,
1257
+ metadata: @config.metadata,
1258
+ retry_policy: @config.retry_policy
1259
+
1260
+ @dep_service_stub.call_rpc :delete_lb_route_extension, request, options: options do |response, operation|
1261
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1262
+ yield response, operation if block_given?
1263
+ return response
1264
+ end
1265
+ rescue ::GRPC::BadStatus => e
1266
+ raise ::Google::Cloud::Error.from_error(e)
1267
+ end
1268
+
1269
+ ##
1270
+ # Configuration class for the DepService API.
1271
+ #
1272
+ # This class represents the configuration for DepService,
1273
+ # providing control over timeouts, retry behavior, logging, transport
1274
+ # parameters, and other low-level controls. Certain parameters can also be
1275
+ # applied individually to specific RPCs. See
1276
+ # {::Google::Cloud::NetworkServices::V1::DepService::Client::Configuration::Rpcs}
1277
+ # for a list of RPCs that can be configured independently.
1278
+ #
1279
+ # Configuration can be applied globally to all clients, or to a single client
1280
+ # on construction.
1281
+ #
1282
+ # @example
1283
+ #
1284
+ # # Modify the global config, setting the timeout for
1285
+ # # list_lb_traffic_extensions to 20 seconds,
1286
+ # # and all remaining timeouts to 10 seconds.
1287
+ # ::Google::Cloud::NetworkServices::V1::DepService::Client.configure do |config|
1288
+ # config.timeout = 10.0
1289
+ # config.rpcs.list_lb_traffic_extensions.timeout = 20.0
1290
+ # end
1291
+ #
1292
+ # # Apply the above configuration only to a new client.
1293
+ # client = ::Google::Cloud::NetworkServices::V1::DepService::Client.new do |config|
1294
+ # config.timeout = 10.0
1295
+ # config.rpcs.list_lb_traffic_extensions.timeout = 20.0
1296
+ # end
1297
+ #
1298
+ # @!attribute [rw] endpoint
1299
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1300
+ # nil, indicating to use the default endpoint in the current universe domain.
1301
+ # @return [::String,nil]
1302
+ # @!attribute [rw] credentials
1303
+ # Credentials to send with calls. You may provide any of the following types:
1304
+ # * (`String`) The path to a service account key file in JSON format
1305
+ # * (`Hash`) A service account key as a Hash
1306
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1307
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1308
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1309
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1310
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1311
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1312
+ # * (`nil`) indicating no credentials
1313
+ # @return [::Object]
1314
+ # @!attribute [rw] scope
1315
+ # The OAuth scopes
1316
+ # @return [::Array<::String>]
1317
+ # @!attribute [rw] lib_name
1318
+ # The library name as recorded in instrumentation and logging
1319
+ # @return [::String]
1320
+ # @!attribute [rw] lib_version
1321
+ # The library version as recorded in instrumentation and logging
1322
+ # @return [::String]
1323
+ # @!attribute [rw] channel_args
1324
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1325
+ # `GRPC::Core::Channel` object is provided as the credential.
1326
+ # @return [::Hash]
1327
+ # @!attribute [rw] interceptors
1328
+ # An array of interceptors that are run before calls are executed.
1329
+ # @return [::Array<::GRPC::ClientInterceptor>]
1330
+ # @!attribute [rw] timeout
1331
+ # The call timeout in seconds.
1332
+ # @return [::Numeric]
1333
+ # @!attribute [rw] metadata
1334
+ # Additional gRPC headers to be sent with the call.
1335
+ # @return [::Hash{::Symbol=>::String}]
1336
+ # @!attribute [rw] retry_policy
1337
+ # The retry policy. The value is a hash with the following keys:
1338
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1339
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1340
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1341
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1342
+ # trigger a retry.
1343
+ # @return [::Hash]
1344
+ # @!attribute [rw] quota_project
1345
+ # A separate project against which to charge quota.
1346
+ # @return [::String]
1347
+ # @!attribute [rw] universe_domain
1348
+ # The universe domain within which to make requests. This determines the
1349
+ # default endpoint URL. The default value of nil uses the environment
1350
+ # universe (usually the default "googleapis.com" universe).
1351
+ # @return [::String,nil]
1352
+ #
1353
+ class Configuration
1354
+ extend ::Gapic::Config
1355
+
1356
+ # @private
1357
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1358
+ DEFAULT_ENDPOINT = "networkservices.googleapis.com"
1359
+
1360
+ config_attr :endpoint, nil, ::String, nil
1361
+ config_attr :credentials, nil do |value|
1362
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1363
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1364
+ allowed.any? { |klass| klass === value }
1365
+ end
1366
+ config_attr :scope, nil, ::String, ::Array, nil
1367
+ config_attr :lib_name, nil, ::String, nil
1368
+ config_attr :lib_version, nil, ::String, nil
1369
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1370
+ config_attr :interceptors, nil, ::Array, nil
1371
+ config_attr :timeout, nil, ::Numeric, nil
1372
+ config_attr :metadata, nil, ::Hash, nil
1373
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1374
+ config_attr :quota_project, nil, ::String, nil
1375
+ config_attr :universe_domain, nil, ::String, nil
1376
+
1377
+ # @private
1378
+ def initialize parent_config = nil
1379
+ @parent_config = parent_config unless parent_config.nil?
1380
+
1381
+ yield self if block_given?
1382
+ end
1383
+
1384
+ ##
1385
+ # Configurations for individual RPCs
1386
+ # @return [Rpcs]
1387
+ #
1388
+ def rpcs
1389
+ @rpcs ||= begin
1390
+ parent_rpcs = nil
1391
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1392
+ Rpcs.new parent_rpcs
1393
+ end
1394
+ end
1395
+
1396
+ ##
1397
+ # Configuration for the channel pool
1398
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1399
+ #
1400
+ def channel_pool
1401
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1402
+ end
1403
+
1404
+ ##
1405
+ # Configuration RPC class for the DepService API.
1406
+ #
1407
+ # Includes fields providing the configuration for each RPC in this service.
1408
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1409
+ # the following configuration fields:
1410
+ #
1411
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1412
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1413
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1414
+ # include the following keys:
1415
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1416
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1417
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1418
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1419
+ # trigger a retry.
1420
+ #
1421
+ class Rpcs
1422
+ ##
1423
+ # RPC-specific configuration for `list_lb_traffic_extensions`
1424
+ # @return [::Gapic::Config::Method]
1425
+ #
1426
+ attr_reader :list_lb_traffic_extensions
1427
+ ##
1428
+ # RPC-specific configuration for `get_lb_traffic_extension`
1429
+ # @return [::Gapic::Config::Method]
1430
+ #
1431
+ attr_reader :get_lb_traffic_extension
1432
+ ##
1433
+ # RPC-specific configuration for `create_lb_traffic_extension`
1434
+ # @return [::Gapic::Config::Method]
1435
+ #
1436
+ attr_reader :create_lb_traffic_extension
1437
+ ##
1438
+ # RPC-specific configuration for `update_lb_traffic_extension`
1439
+ # @return [::Gapic::Config::Method]
1440
+ #
1441
+ attr_reader :update_lb_traffic_extension
1442
+ ##
1443
+ # RPC-specific configuration for `delete_lb_traffic_extension`
1444
+ # @return [::Gapic::Config::Method]
1445
+ #
1446
+ attr_reader :delete_lb_traffic_extension
1447
+ ##
1448
+ # RPC-specific configuration for `list_lb_route_extensions`
1449
+ # @return [::Gapic::Config::Method]
1450
+ #
1451
+ attr_reader :list_lb_route_extensions
1452
+ ##
1453
+ # RPC-specific configuration for `get_lb_route_extension`
1454
+ # @return [::Gapic::Config::Method]
1455
+ #
1456
+ attr_reader :get_lb_route_extension
1457
+ ##
1458
+ # RPC-specific configuration for `create_lb_route_extension`
1459
+ # @return [::Gapic::Config::Method]
1460
+ #
1461
+ attr_reader :create_lb_route_extension
1462
+ ##
1463
+ # RPC-specific configuration for `update_lb_route_extension`
1464
+ # @return [::Gapic::Config::Method]
1465
+ #
1466
+ attr_reader :update_lb_route_extension
1467
+ ##
1468
+ # RPC-specific configuration for `delete_lb_route_extension`
1469
+ # @return [::Gapic::Config::Method]
1470
+ #
1471
+ attr_reader :delete_lb_route_extension
1472
+
1473
+ # @private
1474
+ def initialize parent_rpcs = nil
1475
+ list_lb_traffic_extensions_config = parent_rpcs.list_lb_traffic_extensions if parent_rpcs.respond_to? :list_lb_traffic_extensions
1476
+ @list_lb_traffic_extensions = ::Gapic::Config::Method.new list_lb_traffic_extensions_config
1477
+ get_lb_traffic_extension_config = parent_rpcs.get_lb_traffic_extension if parent_rpcs.respond_to? :get_lb_traffic_extension
1478
+ @get_lb_traffic_extension = ::Gapic::Config::Method.new get_lb_traffic_extension_config
1479
+ create_lb_traffic_extension_config = parent_rpcs.create_lb_traffic_extension if parent_rpcs.respond_to? :create_lb_traffic_extension
1480
+ @create_lb_traffic_extension = ::Gapic::Config::Method.new create_lb_traffic_extension_config
1481
+ update_lb_traffic_extension_config = parent_rpcs.update_lb_traffic_extension if parent_rpcs.respond_to? :update_lb_traffic_extension
1482
+ @update_lb_traffic_extension = ::Gapic::Config::Method.new update_lb_traffic_extension_config
1483
+ delete_lb_traffic_extension_config = parent_rpcs.delete_lb_traffic_extension if parent_rpcs.respond_to? :delete_lb_traffic_extension
1484
+ @delete_lb_traffic_extension = ::Gapic::Config::Method.new delete_lb_traffic_extension_config
1485
+ list_lb_route_extensions_config = parent_rpcs.list_lb_route_extensions if parent_rpcs.respond_to? :list_lb_route_extensions
1486
+ @list_lb_route_extensions = ::Gapic::Config::Method.new list_lb_route_extensions_config
1487
+ get_lb_route_extension_config = parent_rpcs.get_lb_route_extension if parent_rpcs.respond_to? :get_lb_route_extension
1488
+ @get_lb_route_extension = ::Gapic::Config::Method.new get_lb_route_extension_config
1489
+ create_lb_route_extension_config = parent_rpcs.create_lb_route_extension if parent_rpcs.respond_to? :create_lb_route_extension
1490
+ @create_lb_route_extension = ::Gapic::Config::Method.new create_lb_route_extension_config
1491
+ update_lb_route_extension_config = parent_rpcs.update_lb_route_extension if parent_rpcs.respond_to? :update_lb_route_extension
1492
+ @update_lb_route_extension = ::Gapic::Config::Method.new update_lb_route_extension_config
1493
+ delete_lb_route_extension_config = parent_rpcs.delete_lb_route_extension if parent_rpcs.respond_to? :delete_lb_route_extension
1494
+ @delete_lb_route_extension = ::Gapic::Config::Method.new delete_lb_route_extension_config
1495
+
1496
+ yield self if block_given?
1497
+ end
1498
+ end
1499
+ end
1500
+ end
1501
+ end
1502
+ end
1503
+ end
1504
+ end
1505
+ end