google-cloud-api_gateway-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/api_gateway/v1"
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/api_gateway/v1/api_gateway_service"
20
+ require "google/cloud/api_gateway/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module ApiGateway
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/api_gateway/v1"
29
+ # client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new
30
+ #
31
+ module V1
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
38
+ require "google/cloud/api_gateway/v1/_helpers" if ::File.file? helper_path
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/api_gateway/v1/version"
24
+
25
+ require "google/cloud/api_gateway/v1/api_gateway_service/credentials"
26
+ require "google/cloud/api_gateway/v1/api_gateway_service/paths"
27
+ require "google/cloud/api_gateway/v1/api_gateway_service/operations"
28
+ require "google/cloud/api_gateway/v1/api_gateway_service/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module ApiGateway
33
+ module V1
34
+ ##
35
+ # The API Gateway Service is the interface for managing API Gateways.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/api_gateway/v1/api_gateway_service"
40
+ # client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new
41
+ #
42
+ module ApiGatewayService
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ helper_path = ::File.join __dir__, "api_gateway_service", "helpers.rb"
50
+ require "google/cloud/api_gateway/v1/api_gateway_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,1565 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/apigateway/v1/apigateway_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module ApiGateway
25
+ module V1
26
+ module ApiGatewayService
27
+ ##
28
+ # Client for the ApiGatewayService service.
29
+ #
30
+ # The API Gateway Service is the interface for managing API Gateways.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :api_gateway_service_stub
37
+
38
+ ##
39
+ # Configure the ApiGatewayService Client class.
40
+ #
41
+ # See {::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all ApiGatewayService clients:
47
+ #
48
+ # ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "ApiGateway", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.create_gateway.timeout = 60.0
69
+ default_config.rpcs.create_gateway.retry_policy = {
70
+ initial_delay: 1.0,
71
+ max_delay: 60.0,
72
+ multiplier: 2,
73
+ retry_codes: [2, 14]
74
+ }
75
+
76
+ default_config.rpcs.update_gateway.timeout = 60.0
77
+ default_config.rpcs.update_gateway.retry_policy = {
78
+ initial_delay: 1.0,
79
+ max_delay: 60.0,
80
+ multiplier: 2,
81
+ retry_codes: [2, 14]
82
+ }
83
+
84
+ default_config.rpcs.delete_gateway.timeout = 60.0
85
+ default_config.rpcs.delete_gateway.retry_policy = {
86
+ initial_delay: 1.0,
87
+ max_delay: 60.0,
88
+ multiplier: 2,
89
+ retry_codes: [2, 14]
90
+ }
91
+
92
+ default_config.rpcs.create_api.timeout = 60.0
93
+ default_config.rpcs.create_api.retry_policy = {
94
+ initial_delay: 1.0,
95
+ max_delay: 60.0,
96
+ multiplier: 2,
97
+ retry_codes: [2, 14]
98
+ }
99
+
100
+ default_config.rpcs.update_api.timeout = 60.0
101
+ default_config.rpcs.update_api.retry_policy = {
102
+ initial_delay: 1.0,
103
+ max_delay: 60.0,
104
+ multiplier: 2,
105
+ retry_codes: [2, 14]
106
+ }
107
+
108
+ default_config.rpcs.delete_api.timeout = 60.0
109
+ default_config.rpcs.delete_api.retry_policy = {
110
+ initial_delay: 1.0,
111
+ max_delay: 60.0,
112
+ multiplier: 2,
113
+ retry_codes: [2, 14]
114
+ }
115
+
116
+ default_config.rpcs.create_api_config.timeout = 60.0
117
+ default_config.rpcs.create_api_config.retry_policy = {
118
+ initial_delay: 1.0,
119
+ max_delay: 60.0,
120
+ multiplier: 2,
121
+ retry_codes: [2, 14]
122
+ }
123
+
124
+ default_config.rpcs.update_api_config.timeout = 60.0
125
+ default_config.rpcs.update_api_config.retry_policy = {
126
+ initial_delay: 1.0,
127
+ max_delay: 60.0,
128
+ multiplier: 2,
129
+ retry_codes: [2, 14]
130
+ }
131
+
132
+ default_config.rpcs.delete_api_config.timeout = 60.0
133
+ default_config.rpcs.delete_api_config.retry_policy = {
134
+ initial_delay: 1.0,
135
+ max_delay: 60.0,
136
+ multiplier: 2,
137
+ retry_codes: [2, 14]
138
+ }
139
+
140
+ default_config
141
+ end
142
+ yield @configure if block_given?
143
+ @configure
144
+ end
145
+
146
+ ##
147
+ # Configure the ApiGatewayService Client instance.
148
+ #
149
+ # The configuration is set to the derived mode, meaning that values can be changed,
150
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
151
+ # should be made on {Client.configure}.
152
+ #
153
+ # See {::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client::Configuration}
154
+ # for a description of the configuration fields.
155
+ #
156
+ # @yield [config] Configure the Client client.
157
+ # @yieldparam config [Client::Configuration]
158
+ #
159
+ # @return [Client::Configuration]
160
+ #
161
+ def configure
162
+ yield @config if block_given?
163
+ @config
164
+ end
165
+
166
+ ##
167
+ # Create a new ApiGatewayService client object.
168
+ #
169
+ # ## Examples
170
+ #
171
+ # To create a new ApiGatewayService client with the default
172
+ # configuration:
173
+ #
174
+ # client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new
175
+ #
176
+ # To create a new ApiGatewayService client with a custom
177
+ # configuration:
178
+ #
179
+ # client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config|
180
+ # config.timeout = 10.0
181
+ # end
182
+ #
183
+ # @yield [config] Configure the ApiGatewayService client.
184
+ # @yieldparam config [Client::Configuration]
185
+ #
186
+ def initialize
187
+ # These require statements are intentionally placed here to initialize
188
+ # the gRPC module only when it's required.
189
+ # See https://github.com/googleapis/toolkit/issues/446
190
+ require "gapic/grpc"
191
+ require "google/cloud/apigateway/v1/apigateway_service_services_pb"
192
+
193
+ # Create the configuration object
194
+ @config = Configuration.new Client.configure
195
+
196
+ # Yield the configuration if needed
197
+ yield @config if block_given?
198
+
199
+ # Create credentials
200
+ credentials = @config.credentials
201
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
202
+ # but only if the default endpoint does not have a region prefix.
203
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
204
+ @config.endpoint == Client.configure.endpoint &&
205
+ !@config.endpoint.split(".").first.include?("-")
206
+ credentials ||= Credentials.default scope: @config.scope,
207
+ enable_self_signed_jwt: enable_self_signed_jwt
208
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
209
+ credentials = Credentials.new credentials, scope: @config.scope
210
+ end
211
+ @quota_project_id = @config.quota_project
212
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
213
+
214
+ @operations_client = Operations.new do |config|
215
+ config.credentials = credentials
216
+ config.endpoint = @config.endpoint
217
+ end
218
+
219
+ @api_gateway_service_stub = ::Gapic::ServiceStub.new(
220
+ ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Stub,
221
+ credentials: credentials,
222
+ endpoint: @config.endpoint,
223
+ channel_args: @config.channel_args,
224
+ interceptors: @config.interceptors
225
+ )
226
+ end
227
+
228
+ ##
229
+ # Get the associated client for long-running operations.
230
+ #
231
+ # @return [::Google::Cloud::ApiGateway::V1::ApiGatewayService::Operations]
232
+ #
233
+ attr_reader :operations_client
234
+
235
+ # Service calls
236
+
237
+ ##
238
+ # Lists Gateways in a given project and location.
239
+ #
240
+ # @overload list_gateways(request, options = nil)
241
+ # Pass arguments to `list_gateways` via a request object, either of type
242
+ # {::Google::Cloud::ApiGateway::V1::ListGatewaysRequest} or an equivalent Hash.
243
+ #
244
+ # @param request [::Google::Cloud::ApiGateway::V1::ListGatewaysRequest, ::Hash]
245
+ # A request object representing the call parameters. Required. To specify no
246
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
247
+ # @param options [::Gapic::CallOptions, ::Hash]
248
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
249
+ #
250
+ # @overload list_gateways(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
251
+ # Pass arguments to `list_gateways` via keyword arguments. Note that at
252
+ # least one keyword argument is required. To specify no parameters, or to keep all
253
+ # the default parameter values, pass an empty Hash as a request object (see above).
254
+ #
255
+ # @param parent [::String]
256
+ # Required. Parent resource of the Gateway, of the form:
257
+ # `projects/*/locations/*`
258
+ # @param page_size [::Integer]
259
+ # Page size.
260
+ # @param page_token [::String]
261
+ # Page token.
262
+ # @param filter [::String]
263
+ # Filter.
264
+ # @param order_by [::String]
265
+ # Order by parameters.
266
+ #
267
+ # @yield [response, operation] Access the result along with the RPC operation
268
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiGateway::V1::Gateway>]
269
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
270
+ #
271
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiGateway::V1::Gateway>]
272
+ #
273
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
274
+ #
275
+ def list_gateways request, options = nil
276
+ raise ::ArgumentError, "request must be provided" if request.nil?
277
+
278
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::ListGatewaysRequest
279
+
280
+ # Converts hash and nil to an options object
281
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
282
+
283
+ # Customize the options with defaults
284
+ metadata = @config.rpcs.list_gateways.metadata.to_h
285
+
286
+ # Set x-goog-api-client and x-goog-user-project headers
287
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
288
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
289
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
290
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
291
+
292
+ header_params = {
293
+ "parent" => request.parent
294
+ }
295
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
296
+ metadata[:"x-goog-request-params"] ||= request_params_header
297
+
298
+ options.apply_defaults timeout: @config.rpcs.list_gateways.timeout,
299
+ metadata: metadata,
300
+ retry_policy: @config.rpcs.list_gateways.retry_policy
301
+ options.apply_defaults metadata: @config.metadata,
302
+ retry_policy: @config.retry_policy
303
+
304
+ @api_gateway_service_stub.call_rpc :list_gateways, request, options: options do |response, operation|
305
+ response = ::Gapic::PagedEnumerable.new @api_gateway_service_stub, :list_gateways, request, response, operation, options
306
+ yield response, operation if block_given?
307
+ return response
308
+ end
309
+ rescue ::GRPC::BadStatus => e
310
+ raise ::Google::Cloud::Error.from_error(e)
311
+ end
312
+
313
+ ##
314
+ # Gets details of a single Gateway.
315
+ #
316
+ # @overload get_gateway(request, options = nil)
317
+ # Pass arguments to `get_gateway` via a request object, either of type
318
+ # {::Google::Cloud::ApiGateway::V1::GetGatewayRequest} or an equivalent Hash.
319
+ #
320
+ # @param request [::Google::Cloud::ApiGateway::V1::GetGatewayRequest, ::Hash]
321
+ # A request object representing the call parameters. Required. To specify no
322
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
323
+ # @param options [::Gapic::CallOptions, ::Hash]
324
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
325
+ #
326
+ # @overload get_gateway(name: nil)
327
+ # Pass arguments to `get_gateway` via keyword arguments. Note that at
328
+ # least one keyword argument is required. To specify no parameters, or to keep all
329
+ # the default parameter values, pass an empty Hash as a request object (see above).
330
+ #
331
+ # @param name [::String]
332
+ # Required. Resource name of the form:
333
+ # `projects/*/locations/*/gateways/*`
334
+ #
335
+ # @yield [response, operation] Access the result along with the RPC operation
336
+ # @yieldparam response [::Google::Cloud::ApiGateway::V1::Gateway]
337
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
338
+ #
339
+ # @return [::Google::Cloud::ApiGateway::V1::Gateway]
340
+ #
341
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
342
+ #
343
+ def get_gateway request, options = nil
344
+ raise ::ArgumentError, "request must be provided" if request.nil?
345
+
346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::GetGatewayRequest
347
+
348
+ # Converts hash and nil to an options object
349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
350
+
351
+ # Customize the options with defaults
352
+ metadata = @config.rpcs.get_gateway.metadata.to_h
353
+
354
+ # Set x-goog-api-client and x-goog-user-project headers
355
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
357
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
358
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
+
360
+ header_params = {
361
+ "name" => request.name
362
+ }
363
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
364
+ metadata[:"x-goog-request-params"] ||= request_params_header
365
+
366
+ options.apply_defaults timeout: @config.rpcs.get_gateway.timeout,
367
+ metadata: metadata,
368
+ retry_policy: @config.rpcs.get_gateway.retry_policy
369
+ options.apply_defaults metadata: @config.metadata,
370
+ retry_policy: @config.retry_policy
371
+
372
+ @api_gateway_service_stub.call_rpc :get_gateway, request, options: options do |response, operation|
373
+ yield response, operation if block_given?
374
+ return response
375
+ end
376
+ rescue ::GRPC::BadStatus => e
377
+ raise ::Google::Cloud::Error.from_error(e)
378
+ end
379
+
380
+ ##
381
+ # Creates a new Gateway in a given project and location.
382
+ #
383
+ # @overload create_gateway(request, options = nil)
384
+ # Pass arguments to `create_gateway` via a request object, either of type
385
+ # {::Google::Cloud::ApiGateway::V1::CreateGatewayRequest} or an equivalent Hash.
386
+ #
387
+ # @param request [::Google::Cloud::ApiGateway::V1::CreateGatewayRequest, ::Hash]
388
+ # A request object representing the call parameters. Required. To specify no
389
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
390
+ # @param options [::Gapic::CallOptions, ::Hash]
391
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
392
+ #
393
+ # @overload create_gateway(parent: nil, gateway_id: nil, gateway: nil)
394
+ # Pass arguments to `create_gateway` via keyword arguments. Note that at
395
+ # least one keyword argument is required. To specify no parameters, or to keep all
396
+ # the default parameter values, pass an empty Hash as a request object (see above).
397
+ #
398
+ # @param parent [::String]
399
+ # Required. Parent resource of the Gateway, of the form:
400
+ # `projects/*/locations/*`
401
+ # @param gateway_id [::String]
402
+ # Required. Identifier to assign to the Gateway. Must be unique within scope of
403
+ # the parent resource.
404
+ # @param gateway [::Google::Cloud::ApiGateway::V1::Gateway, ::Hash]
405
+ # Required. Gateway resource.
406
+ #
407
+ # @yield [response, operation] Access the result along with the RPC operation
408
+ # @yieldparam response [::Gapic::Operation]
409
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
410
+ #
411
+ # @return [::Gapic::Operation]
412
+ #
413
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
414
+ #
415
+ def create_gateway request, options = nil
416
+ raise ::ArgumentError, "request must be provided" if request.nil?
417
+
418
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::CreateGatewayRequest
419
+
420
+ # Converts hash and nil to an options object
421
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
422
+
423
+ # Customize the options with defaults
424
+ metadata = @config.rpcs.create_gateway.metadata.to_h
425
+
426
+ # Set x-goog-api-client and x-goog-user-project headers
427
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
428
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
429
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
430
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
431
+
432
+ header_params = {
433
+ "parent" => request.parent
434
+ }
435
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
436
+ metadata[:"x-goog-request-params"] ||= request_params_header
437
+
438
+ options.apply_defaults timeout: @config.rpcs.create_gateway.timeout,
439
+ metadata: metadata,
440
+ retry_policy: @config.rpcs.create_gateway.retry_policy
441
+ options.apply_defaults metadata: @config.metadata,
442
+ retry_policy: @config.retry_policy
443
+
444
+ @api_gateway_service_stub.call_rpc :create_gateway, request, options: options do |response, operation|
445
+ response = ::Gapic::Operation.new response, @operations_client, options: options
446
+ yield response, operation if block_given?
447
+ return response
448
+ end
449
+ rescue ::GRPC::BadStatus => e
450
+ raise ::Google::Cloud::Error.from_error(e)
451
+ end
452
+
453
+ ##
454
+ # Updates the parameters of a single Gateway.
455
+ #
456
+ # @overload update_gateway(request, options = nil)
457
+ # Pass arguments to `update_gateway` via a request object, either of type
458
+ # {::Google::Cloud::ApiGateway::V1::UpdateGatewayRequest} or an equivalent Hash.
459
+ #
460
+ # @param request [::Google::Cloud::ApiGateway::V1::UpdateGatewayRequest, ::Hash]
461
+ # A request object representing the call parameters. Required. To specify no
462
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
463
+ # @param options [::Gapic::CallOptions, ::Hash]
464
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
465
+ #
466
+ # @overload update_gateway(update_mask: nil, gateway: nil)
467
+ # Pass arguments to `update_gateway` via keyword arguments. Note that at
468
+ # least one keyword argument is required. To specify no parameters, or to keep all
469
+ # the default parameter values, pass an empty Hash as a request object (see above).
470
+ #
471
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
472
+ # Field mask is used to specify the fields to be overwritten in the
473
+ # Gateway resource by the update.
474
+ # The fields specified in the update_mask are relative to the resource, not
475
+ # the full request. A field will be overwritten if it is in the mask. If the
476
+ # user does not provide a mask then all fields will be overwritten.
477
+ # @param gateway [::Google::Cloud::ApiGateway::V1::Gateway, ::Hash]
478
+ # Required. Gateway resource.
479
+ #
480
+ # @yield [response, operation] Access the result along with the RPC operation
481
+ # @yieldparam response [::Gapic::Operation]
482
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
483
+ #
484
+ # @return [::Gapic::Operation]
485
+ #
486
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
487
+ #
488
+ def update_gateway request, options = nil
489
+ raise ::ArgumentError, "request must be provided" if request.nil?
490
+
491
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::UpdateGatewayRequest
492
+
493
+ # Converts hash and nil to an options object
494
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
495
+
496
+ # Customize the options with defaults
497
+ metadata = @config.rpcs.update_gateway.metadata.to_h
498
+
499
+ # Set x-goog-api-client and x-goog-user-project headers
500
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
501
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
502
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
503
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
504
+
505
+ header_params = {
506
+ "gateway.name" => request.gateway.name
507
+ }
508
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
509
+ metadata[:"x-goog-request-params"] ||= request_params_header
510
+
511
+ options.apply_defaults timeout: @config.rpcs.update_gateway.timeout,
512
+ metadata: metadata,
513
+ retry_policy: @config.rpcs.update_gateway.retry_policy
514
+ options.apply_defaults metadata: @config.metadata,
515
+ retry_policy: @config.retry_policy
516
+
517
+ @api_gateway_service_stub.call_rpc :update_gateway, request, options: options do |response, operation|
518
+ response = ::Gapic::Operation.new response, @operations_client, options: options
519
+ yield response, operation if block_given?
520
+ return response
521
+ end
522
+ rescue ::GRPC::BadStatus => e
523
+ raise ::Google::Cloud::Error.from_error(e)
524
+ end
525
+
526
+ ##
527
+ # Deletes a single Gateway.
528
+ #
529
+ # @overload delete_gateway(request, options = nil)
530
+ # Pass arguments to `delete_gateway` via a request object, either of type
531
+ # {::Google::Cloud::ApiGateway::V1::DeleteGatewayRequest} or an equivalent Hash.
532
+ #
533
+ # @param request [::Google::Cloud::ApiGateway::V1::DeleteGatewayRequest, ::Hash]
534
+ # A request object representing the call parameters. Required. To specify no
535
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
536
+ # @param options [::Gapic::CallOptions, ::Hash]
537
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
538
+ #
539
+ # @overload delete_gateway(name: nil)
540
+ # Pass arguments to `delete_gateway` via keyword arguments. Note that at
541
+ # least one keyword argument is required. To specify no parameters, or to keep all
542
+ # the default parameter values, pass an empty Hash as a request object (see above).
543
+ #
544
+ # @param name [::String]
545
+ # Required. Resource name of the form:
546
+ # `projects/*/locations/*/gateways/*`
547
+ #
548
+ # @yield [response, operation] Access the result along with the RPC operation
549
+ # @yieldparam response [::Gapic::Operation]
550
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
551
+ #
552
+ # @return [::Gapic::Operation]
553
+ #
554
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
555
+ #
556
+ def delete_gateway request, options = nil
557
+ raise ::ArgumentError, "request must be provided" if request.nil?
558
+
559
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::DeleteGatewayRequest
560
+
561
+ # Converts hash and nil to an options object
562
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
+
564
+ # Customize the options with defaults
565
+ metadata = @config.rpcs.delete_gateway.metadata.to_h
566
+
567
+ # Set x-goog-api-client and x-goog-user-project headers
568
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
569
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
570
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
571
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
572
+
573
+ header_params = {
574
+ "name" => request.name
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.delete_gateway.timeout,
580
+ metadata: metadata,
581
+ retry_policy: @config.rpcs.delete_gateway.retry_policy
582
+ options.apply_defaults metadata: @config.metadata,
583
+ retry_policy: @config.retry_policy
584
+
585
+ @api_gateway_service_stub.call_rpc :delete_gateway, request, options: options do |response, operation|
586
+ response = ::Gapic::Operation.new response, @operations_client, options: options
587
+ yield response, operation if block_given?
588
+ return response
589
+ end
590
+ rescue ::GRPC::BadStatus => e
591
+ raise ::Google::Cloud::Error.from_error(e)
592
+ end
593
+
594
+ ##
595
+ # Lists Apis in a given project and location.
596
+ #
597
+ # @overload list_apis(request, options = nil)
598
+ # Pass arguments to `list_apis` via a request object, either of type
599
+ # {::Google::Cloud::ApiGateway::V1::ListApisRequest} or an equivalent Hash.
600
+ #
601
+ # @param request [::Google::Cloud::ApiGateway::V1::ListApisRequest, ::Hash]
602
+ # A request object representing the call parameters. Required. To specify no
603
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
604
+ # @param options [::Gapic::CallOptions, ::Hash]
605
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
606
+ #
607
+ # @overload list_apis(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
608
+ # Pass arguments to `list_apis` via keyword arguments. Note that at
609
+ # least one keyword argument is required. To specify no parameters, or to keep all
610
+ # the default parameter values, pass an empty Hash as a request object (see above).
611
+ #
612
+ # @param parent [::String]
613
+ # Required. Parent resource of the API, of the form:
614
+ # `projects/*/locations/global`
615
+ # @param page_size [::Integer]
616
+ # Page size.
617
+ # @param page_token [::String]
618
+ # Page token.
619
+ # @param filter [::String]
620
+ # Filter.
621
+ # @param order_by [::String]
622
+ # Order by parameters.
623
+ #
624
+ # @yield [response, operation] Access the result along with the RPC operation
625
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiGateway::V1::Api>]
626
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
627
+ #
628
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiGateway::V1::Api>]
629
+ #
630
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
631
+ #
632
+ def list_apis request, options = nil
633
+ raise ::ArgumentError, "request must be provided" if request.nil?
634
+
635
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::ListApisRequest
636
+
637
+ # Converts hash and nil to an options object
638
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
639
+
640
+ # Customize the options with defaults
641
+ metadata = @config.rpcs.list_apis.metadata.to_h
642
+
643
+ # Set x-goog-api-client and x-goog-user-project headers
644
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
645
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
646
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
647
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
648
+
649
+ header_params = {
650
+ "parent" => request.parent
651
+ }
652
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
653
+ metadata[:"x-goog-request-params"] ||= request_params_header
654
+
655
+ options.apply_defaults timeout: @config.rpcs.list_apis.timeout,
656
+ metadata: metadata,
657
+ retry_policy: @config.rpcs.list_apis.retry_policy
658
+ options.apply_defaults metadata: @config.metadata,
659
+ retry_policy: @config.retry_policy
660
+
661
+ @api_gateway_service_stub.call_rpc :list_apis, request, options: options do |response, operation|
662
+ response = ::Gapic::PagedEnumerable.new @api_gateway_service_stub, :list_apis, request, response, operation, options
663
+ yield response, operation if block_given?
664
+ return response
665
+ end
666
+ rescue ::GRPC::BadStatus => e
667
+ raise ::Google::Cloud::Error.from_error(e)
668
+ end
669
+
670
+ ##
671
+ # Gets details of a single Api.
672
+ #
673
+ # @overload get_api(request, options = nil)
674
+ # Pass arguments to `get_api` via a request object, either of type
675
+ # {::Google::Cloud::ApiGateway::V1::GetApiRequest} or an equivalent Hash.
676
+ #
677
+ # @param request [::Google::Cloud::ApiGateway::V1::GetApiRequest, ::Hash]
678
+ # A request object representing the call parameters. Required. To specify no
679
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
680
+ # @param options [::Gapic::CallOptions, ::Hash]
681
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
682
+ #
683
+ # @overload get_api(name: nil)
684
+ # Pass arguments to `get_api` via keyword arguments. Note that at
685
+ # least one keyword argument is required. To specify no parameters, or to keep all
686
+ # the default parameter values, pass an empty Hash as a request object (see above).
687
+ #
688
+ # @param name [::String]
689
+ # Required. Resource name of the form:
690
+ # `projects/*/locations/global/apis/*`
691
+ #
692
+ # @yield [response, operation] Access the result along with the RPC operation
693
+ # @yieldparam response [::Google::Cloud::ApiGateway::V1::Api]
694
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
695
+ #
696
+ # @return [::Google::Cloud::ApiGateway::V1::Api]
697
+ #
698
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
699
+ #
700
+ def get_api request, options = nil
701
+ raise ::ArgumentError, "request must be provided" if request.nil?
702
+
703
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::GetApiRequest
704
+
705
+ # Converts hash and nil to an options object
706
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
707
+
708
+ # Customize the options with defaults
709
+ metadata = @config.rpcs.get_api.metadata.to_h
710
+
711
+ # Set x-goog-api-client and x-goog-user-project headers
712
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
713
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
714
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
715
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
716
+
717
+ header_params = {
718
+ "name" => request.name
719
+ }
720
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
721
+ metadata[:"x-goog-request-params"] ||= request_params_header
722
+
723
+ options.apply_defaults timeout: @config.rpcs.get_api.timeout,
724
+ metadata: metadata,
725
+ retry_policy: @config.rpcs.get_api.retry_policy
726
+ options.apply_defaults metadata: @config.metadata,
727
+ retry_policy: @config.retry_policy
728
+
729
+ @api_gateway_service_stub.call_rpc :get_api, request, options: options do |response, operation|
730
+ yield response, operation if block_given?
731
+ return response
732
+ end
733
+ rescue ::GRPC::BadStatus => e
734
+ raise ::Google::Cloud::Error.from_error(e)
735
+ end
736
+
737
+ ##
738
+ # Creates a new Api in a given project and location.
739
+ #
740
+ # @overload create_api(request, options = nil)
741
+ # Pass arguments to `create_api` via a request object, either of type
742
+ # {::Google::Cloud::ApiGateway::V1::CreateApiRequest} or an equivalent Hash.
743
+ #
744
+ # @param request [::Google::Cloud::ApiGateway::V1::CreateApiRequest, ::Hash]
745
+ # A request object representing the call parameters. Required. To specify no
746
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
747
+ # @param options [::Gapic::CallOptions, ::Hash]
748
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
749
+ #
750
+ # @overload create_api(parent: nil, api_id: nil, api: nil)
751
+ # Pass arguments to `create_api` via keyword arguments. Note that at
752
+ # least one keyword argument is required. To specify no parameters, or to keep all
753
+ # the default parameter values, pass an empty Hash as a request object (see above).
754
+ #
755
+ # @param parent [::String]
756
+ # Required. Parent resource of the API, of the form:
757
+ # `projects/*/locations/global`
758
+ # @param api_id [::String]
759
+ # Required. Identifier to assign to the API. Must be unique within scope of
760
+ # the parent resource.
761
+ # @param api [::Google::Cloud::ApiGateway::V1::Api, ::Hash]
762
+ # Required. API resource.
763
+ #
764
+ # @yield [response, operation] Access the result along with the RPC operation
765
+ # @yieldparam response [::Gapic::Operation]
766
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
767
+ #
768
+ # @return [::Gapic::Operation]
769
+ #
770
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
771
+ #
772
+ def create_api request, options = nil
773
+ raise ::ArgumentError, "request must be provided" if request.nil?
774
+
775
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::CreateApiRequest
776
+
777
+ # Converts hash and nil to an options object
778
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
779
+
780
+ # Customize the options with defaults
781
+ metadata = @config.rpcs.create_api.metadata.to_h
782
+
783
+ # Set x-goog-api-client and x-goog-user-project headers
784
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
785
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
786
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
787
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
788
+
789
+ header_params = {
790
+ "parent" => request.parent
791
+ }
792
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
793
+ metadata[:"x-goog-request-params"] ||= request_params_header
794
+
795
+ options.apply_defaults timeout: @config.rpcs.create_api.timeout,
796
+ metadata: metadata,
797
+ retry_policy: @config.rpcs.create_api.retry_policy
798
+ options.apply_defaults metadata: @config.metadata,
799
+ retry_policy: @config.retry_policy
800
+
801
+ @api_gateway_service_stub.call_rpc :create_api, request, options: options do |response, operation|
802
+ response = ::Gapic::Operation.new response, @operations_client, options: options
803
+ yield response, operation if block_given?
804
+ return response
805
+ end
806
+ rescue ::GRPC::BadStatus => e
807
+ raise ::Google::Cloud::Error.from_error(e)
808
+ end
809
+
810
+ ##
811
+ # Updates the parameters of a single Api.
812
+ #
813
+ # @overload update_api(request, options = nil)
814
+ # Pass arguments to `update_api` via a request object, either of type
815
+ # {::Google::Cloud::ApiGateway::V1::UpdateApiRequest} or an equivalent Hash.
816
+ #
817
+ # @param request [::Google::Cloud::ApiGateway::V1::UpdateApiRequest, ::Hash]
818
+ # A request object representing the call parameters. Required. To specify no
819
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
820
+ # @param options [::Gapic::CallOptions, ::Hash]
821
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
822
+ #
823
+ # @overload update_api(update_mask: nil, api: nil)
824
+ # Pass arguments to `update_api` via keyword arguments. Note that at
825
+ # least one keyword argument is required. To specify no parameters, or to keep all
826
+ # the default parameter values, pass an empty Hash as a request object (see above).
827
+ #
828
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
829
+ # Field mask is used to specify the fields to be overwritten in the
830
+ # Api resource by the update.
831
+ # The fields specified in the update_mask are relative to the resource, not
832
+ # the full request. A field will be overwritten if it is in the mask. If the
833
+ # user does not provide a mask then all fields will be overwritten.
834
+ # @param api [::Google::Cloud::ApiGateway::V1::Api, ::Hash]
835
+ # Required. API resource.
836
+ #
837
+ # @yield [response, operation] Access the result along with the RPC operation
838
+ # @yieldparam response [::Gapic::Operation]
839
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
840
+ #
841
+ # @return [::Gapic::Operation]
842
+ #
843
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
844
+ #
845
+ def update_api request, options = nil
846
+ raise ::ArgumentError, "request must be provided" if request.nil?
847
+
848
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::UpdateApiRequest
849
+
850
+ # Converts hash and nil to an options object
851
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
852
+
853
+ # Customize the options with defaults
854
+ metadata = @config.rpcs.update_api.metadata.to_h
855
+
856
+ # Set x-goog-api-client and x-goog-user-project headers
857
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
858
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
859
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
860
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
861
+
862
+ header_params = {
863
+ "api.name" => request.api.name
864
+ }
865
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
866
+ metadata[:"x-goog-request-params"] ||= request_params_header
867
+
868
+ options.apply_defaults timeout: @config.rpcs.update_api.timeout,
869
+ metadata: metadata,
870
+ retry_policy: @config.rpcs.update_api.retry_policy
871
+ options.apply_defaults metadata: @config.metadata,
872
+ retry_policy: @config.retry_policy
873
+
874
+ @api_gateway_service_stub.call_rpc :update_api, request, options: options do |response, operation|
875
+ response = ::Gapic::Operation.new response, @operations_client, options: options
876
+ yield response, operation if block_given?
877
+ return response
878
+ end
879
+ rescue ::GRPC::BadStatus => e
880
+ raise ::Google::Cloud::Error.from_error(e)
881
+ end
882
+
883
+ ##
884
+ # Deletes a single Api.
885
+ #
886
+ # @overload delete_api(request, options = nil)
887
+ # Pass arguments to `delete_api` via a request object, either of type
888
+ # {::Google::Cloud::ApiGateway::V1::DeleteApiRequest} or an equivalent Hash.
889
+ #
890
+ # @param request [::Google::Cloud::ApiGateway::V1::DeleteApiRequest, ::Hash]
891
+ # A request object representing the call parameters. Required. To specify no
892
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
893
+ # @param options [::Gapic::CallOptions, ::Hash]
894
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
895
+ #
896
+ # @overload delete_api(name: nil)
897
+ # Pass arguments to `delete_api` via keyword arguments. Note that at
898
+ # least one keyword argument is required. To specify no parameters, or to keep all
899
+ # the default parameter values, pass an empty Hash as a request object (see above).
900
+ #
901
+ # @param name [::String]
902
+ # Required. Resource name of the form:
903
+ # `projects/*/locations/global/apis/*`
904
+ #
905
+ # @yield [response, operation] Access the result along with the RPC operation
906
+ # @yieldparam response [::Gapic::Operation]
907
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
908
+ #
909
+ # @return [::Gapic::Operation]
910
+ #
911
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
912
+ #
913
+ def delete_api request, options = nil
914
+ raise ::ArgumentError, "request must be provided" if request.nil?
915
+
916
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::DeleteApiRequest
917
+
918
+ # Converts hash and nil to an options object
919
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
920
+
921
+ # Customize the options with defaults
922
+ metadata = @config.rpcs.delete_api.metadata.to_h
923
+
924
+ # Set x-goog-api-client and x-goog-user-project headers
925
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
926
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
927
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
928
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
929
+
930
+ header_params = {
931
+ "name" => request.name
932
+ }
933
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
934
+ metadata[:"x-goog-request-params"] ||= request_params_header
935
+
936
+ options.apply_defaults timeout: @config.rpcs.delete_api.timeout,
937
+ metadata: metadata,
938
+ retry_policy: @config.rpcs.delete_api.retry_policy
939
+ options.apply_defaults metadata: @config.metadata,
940
+ retry_policy: @config.retry_policy
941
+
942
+ @api_gateway_service_stub.call_rpc :delete_api, request, options: options do |response, operation|
943
+ response = ::Gapic::Operation.new response, @operations_client, options: options
944
+ yield response, operation if block_given?
945
+ return response
946
+ end
947
+ rescue ::GRPC::BadStatus => e
948
+ raise ::Google::Cloud::Error.from_error(e)
949
+ end
950
+
951
+ ##
952
+ # Lists ApiConfigs in a given project and location.
953
+ #
954
+ # @overload list_api_configs(request, options = nil)
955
+ # Pass arguments to `list_api_configs` via a request object, either of type
956
+ # {::Google::Cloud::ApiGateway::V1::ListApiConfigsRequest} or an equivalent Hash.
957
+ #
958
+ # @param request [::Google::Cloud::ApiGateway::V1::ListApiConfigsRequest, ::Hash]
959
+ # A request object representing the call parameters. Required. To specify no
960
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
961
+ # @param options [::Gapic::CallOptions, ::Hash]
962
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
963
+ #
964
+ # @overload list_api_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
965
+ # Pass arguments to `list_api_configs` via keyword arguments. Note that at
966
+ # least one keyword argument is required. To specify no parameters, or to keep all
967
+ # the default parameter values, pass an empty Hash as a request object (see above).
968
+ #
969
+ # @param parent [::String]
970
+ # Required. Parent resource of the API Config, of the form:
971
+ # `projects/*/locations/global/apis/*`
972
+ # @param page_size [::Integer]
973
+ # Page size.
974
+ # @param page_token [::String]
975
+ # Page token.
976
+ # @param filter [::String]
977
+ # Filter.
978
+ # @param order_by [::String]
979
+ # Order by parameters.
980
+ #
981
+ # @yield [response, operation] Access the result along with the RPC operation
982
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiGateway::V1::ApiConfig>]
983
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
984
+ #
985
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiGateway::V1::ApiConfig>]
986
+ #
987
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
988
+ #
989
+ def list_api_configs request, options = nil
990
+ raise ::ArgumentError, "request must be provided" if request.nil?
991
+
992
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::ListApiConfigsRequest
993
+
994
+ # Converts hash and nil to an options object
995
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
996
+
997
+ # Customize the options with defaults
998
+ metadata = @config.rpcs.list_api_configs.metadata.to_h
999
+
1000
+ # Set x-goog-api-client and x-goog-user-project headers
1001
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1002
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1003
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
1004
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1005
+
1006
+ header_params = {
1007
+ "parent" => request.parent
1008
+ }
1009
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1010
+ metadata[:"x-goog-request-params"] ||= request_params_header
1011
+
1012
+ options.apply_defaults timeout: @config.rpcs.list_api_configs.timeout,
1013
+ metadata: metadata,
1014
+ retry_policy: @config.rpcs.list_api_configs.retry_policy
1015
+ options.apply_defaults metadata: @config.metadata,
1016
+ retry_policy: @config.retry_policy
1017
+
1018
+ @api_gateway_service_stub.call_rpc :list_api_configs, request, options: options do |response, operation|
1019
+ response = ::Gapic::PagedEnumerable.new @api_gateway_service_stub, :list_api_configs, request, response, operation, options
1020
+ yield response, operation if block_given?
1021
+ return response
1022
+ end
1023
+ rescue ::GRPC::BadStatus => e
1024
+ raise ::Google::Cloud::Error.from_error(e)
1025
+ end
1026
+
1027
+ ##
1028
+ # Gets details of a single ApiConfig.
1029
+ #
1030
+ # @overload get_api_config(request, options = nil)
1031
+ # Pass arguments to `get_api_config` via a request object, either of type
1032
+ # {::Google::Cloud::ApiGateway::V1::GetApiConfigRequest} or an equivalent Hash.
1033
+ #
1034
+ # @param request [::Google::Cloud::ApiGateway::V1::GetApiConfigRequest, ::Hash]
1035
+ # A request object representing the call parameters. Required. To specify no
1036
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1037
+ # @param options [::Gapic::CallOptions, ::Hash]
1038
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1039
+ #
1040
+ # @overload get_api_config(name: nil, view: nil)
1041
+ # Pass arguments to `get_api_config` via keyword arguments. Note that at
1042
+ # least one keyword argument is required. To specify no parameters, or to keep all
1043
+ # the default parameter values, pass an empty Hash as a request object (see above).
1044
+ #
1045
+ # @param name [::String]
1046
+ # Required. Resource name of the form:
1047
+ # `projects/*/locations/global/apis/*/configs/*`
1048
+ # @param view [::Google::Cloud::ApiGateway::V1::GetApiConfigRequest::ConfigView]
1049
+ # Specifies which fields of the API Config are returned in the response.
1050
+ # Defaults to `BASIC` view.
1051
+ #
1052
+ # @yield [response, operation] Access the result along with the RPC operation
1053
+ # @yieldparam response [::Google::Cloud::ApiGateway::V1::ApiConfig]
1054
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1055
+ #
1056
+ # @return [::Google::Cloud::ApiGateway::V1::ApiConfig]
1057
+ #
1058
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1059
+ #
1060
+ def get_api_config request, options = nil
1061
+ raise ::ArgumentError, "request must be provided" if request.nil?
1062
+
1063
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::GetApiConfigRequest
1064
+
1065
+ # Converts hash and nil to an options object
1066
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1067
+
1068
+ # Customize the options with defaults
1069
+ metadata = @config.rpcs.get_api_config.metadata.to_h
1070
+
1071
+ # Set x-goog-api-client and x-goog-user-project headers
1072
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1073
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1074
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
1075
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1076
+
1077
+ header_params = {
1078
+ "name" => request.name
1079
+ }
1080
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1081
+ metadata[:"x-goog-request-params"] ||= request_params_header
1082
+
1083
+ options.apply_defaults timeout: @config.rpcs.get_api_config.timeout,
1084
+ metadata: metadata,
1085
+ retry_policy: @config.rpcs.get_api_config.retry_policy
1086
+ options.apply_defaults metadata: @config.metadata,
1087
+ retry_policy: @config.retry_policy
1088
+
1089
+ @api_gateway_service_stub.call_rpc :get_api_config, request, options: options do |response, operation|
1090
+ yield response, operation if block_given?
1091
+ return response
1092
+ end
1093
+ rescue ::GRPC::BadStatus => e
1094
+ raise ::Google::Cloud::Error.from_error(e)
1095
+ end
1096
+
1097
+ ##
1098
+ # Creates a new ApiConfig in a given project and location.
1099
+ #
1100
+ # @overload create_api_config(request, options = nil)
1101
+ # Pass arguments to `create_api_config` via a request object, either of type
1102
+ # {::Google::Cloud::ApiGateway::V1::CreateApiConfigRequest} or an equivalent Hash.
1103
+ #
1104
+ # @param request [::Google::Cloud::ApiGateway::V1::CreateApiConfigRequest, ::Hash]
1105
+ # A request object representing the call parameters. Required. To specify no
1106
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1107
+ # @param options [::Gapic::CallOptions, ::Hash]
1108
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1109
+ #
1110
+ # @overload create_api_config(parent: nil, api_config_id: nil, api_config: nil)
1111
+ # Pass arguments to `create_api_config` via keyword arguments. Note that at
1112
+ # least one keyword argument is required. To specify no parameters, or to keep all
1113
+ # the default parameter values, pass an empty Hash as a request object (see above).
1114
+ #
1115
+ # @param parent [::String]
1116
+ # Required. Parent resource of the API Config, of the form:
1117
+ # `projects/*/locations/global/apis/*`
1118
+ # @param api_config_id [::String]
1119
+ # Required. Identifier to assign to the API Config. Must be unique within scope of
1120
+ # the parent resource.
1121
+ # @param api_config [::Google::Cloud::ApiGateway::V1::ApiConfig, ::Hash]
1122
+ # Required. API resource.
1123
+ #
1124
+ # @yield [response, operation] Access the result along with the RPC operation
1125
+ # @yieldparam response [::Gapic::Operation]
1126
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1127
+ #
1128
+ # @return [::Gapic::Operation]
1129
+ #
1130
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1131
+ #
1132
+ def create_api_config request, options = nil
1133
+ raise ::ArgumentError, "request must be provided" if request.nil?
1134
+
1135
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::CreateApiConfigRequest
1136
+
1137
+ # Converts hash and nil to an options object
1138
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1139
+
1140
+ # Customize the options with defaults
1141
+ metadata = @config.rpcs.create_api_config.metadata.to_h
1142
+
1143
+ # Set x-goog-api-client and x-goog-user-project headers
1144
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1145
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1146
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
1147
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1148
+
1149
+ header_params = {
1150
+ "parent" => request.parent
1151
+ }
1152
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1153
+ metadata[:"x-goog-request-params"] ||= request_params_header
1154
+
1155
+ options.apply_defaults timeout: @config.rpcs.create_api_config.timeout,
1156
+ metadata: metadata,
1157
+ retry_policy: @config.rpcs.create_api_config.retry_policy
1158
+ options.apply_defaults metadata: @config.metadata,
1159
+ retry_policy: @config.retry_policy
1160
+
1161
+ @api_gateway_service_stub.call_rpc :create_api_config, 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
+ # Updates the parameters of a single ApiConfig.
1172
+ #
1173
+ # @overload update_api_config(request, options = nil)
1174
+ # Pass arguments to `update_api_config` via a request object, either of type
1175
+ # {::Google::Cloud::ApiGateway::V1::UpdateApiConfigRequest} or an equivalent Hash.
1176
+ #
1177
+ # @param request [::Google::Cloud::ApiGateway::V1::UpdateApiConfigRequest, ::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 update_api_config(update_mask: nil, api_config: nil)
1184
+ # Pass arguments to `update_api_config` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash]
1189
+ # Field mask is used to specify the fields to be overwritten in the
1190
+ # ApiConfig resource by the update.
1191
+ # The fields specified in the update_mask are relative to the resource, not
1192
+ # the full request. A field will be overwritten if it is in the mask. If the
1193
+ # user does not provide a mask then all fields will be overwritten.
1194
+ # @param api_config [::Google::Cloud::ApiGateway::V1::ApiConfig, ::Hash]
1195
+ # Required. API Config resource.
1196
+ #
1197
+ # @yield [response, operation] Access the result along with the RPC operation
1198
+ # @yieldparam response [::Gapic::Operation]
1199
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1200
+ #
1201
+ # @return [::Gapic::Operation]
1202
+ #
1203
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1204
+ #
1205
+ def update_api_config request, options = nil
1206
+ raise ::ArgumentError, "request must be provided" if request.nil?
1207
+
1208
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::UpdateApiConfigRequest
1209
+
1210
+ # Converts hash and nil to an options object
1211
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1212
+
1213
+ # Customize the options with defaults
1214
+ metadata = @config.rpcs.update_api_config.metadata.to_h
1215
+
1216
+ # Set x-goog-api-client and x-goog-user-project headers
1217
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1218
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1219
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
1220
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1221
+
1222
+ header_params = {
1223
+ "api_config.name" => request.api_config.name
1224
+ }
1225
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1226
+ metadata[:"x-goog-request-params"] ||= request_params_header
1227
+
1228
+ options.apply_defaults timeout: @config.rpcs.update_api_config.timeout,
1229
+ metadata: metadata,
1230
+ retry_policy: @config.rpcs.update_api_config.retry_policy
1231
+ options.apply_defaults metadata: @config.metadata,
1232
+ retry_policy: @config.retry_policy
1233
+
1234
+ @api_gateway_service_stub.call_rpc :update_api_config, request, options: options do |response, operation|
1235
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1236
+ yield response, operation if block_given?
1237
+ return response
1238
+ end
1239
+ rescue ::GRPC::BadStatus => e
1240
+ raise ::Google::Cloud::Error.from_error(e)
1241
+ end
1242
+
1243
+ ##
1244
+ # Deletes a single ApiConfig.
1245
+ #
1246
+ # @overload delete_api_config(request, options = nil)
1247
+ # Pass arguments to `delete_api_config` via a request object, either of type
1248
+ # {::Google::Cloud::ApiGateway::V1::DeleteApiConfigRequest} or an equivalent Hash.
1249
+ #
1250
+ # @param request [::Google::Cloud::ApiGateway::V1::DeleteApiConfigRequest, ::Hash]
1251
+ # A request object representing the call parameters. Required. To specify no
1252
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1253
+ # @param options [::Gapic::CallOptions, ::Hash]
1254
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1255
+ #
1256
+ # @overload delete_api_config(name: nil)
1257
+ # Pass arguments to `delete_api_config` via keyword arguments. Note that at
1258
+ # least one keyword argument is required. To specify no parameters, or to keep all
1259
+ # the default parameter values, pass an empty Hash as a request object (see above).
1260
+ #
1261
+ # @param name [::String]
1262
+ # Required. Resource name of the form:
1263
+ # `projects/*/locations/global/apis/*/configs/*`
1264
+ #
1265
+ # @yield [response, operation] Access the result along with the RPC operation
1266
+ # @yieldparam response [::Gapic::Operation]
1267
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1268
+ #
1269
+ # @return [::Gapic::Operation]
1270
+ #
1271
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1272
+ #
1273
+ def delete_api_config request, options = nil
1274
+ raise ::ArgumentError, "request must be provided" if request.nil?
1275
+
1276
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiGateway::V1::DeleteApiConfigRequest
1277
+
1278
+ # Converts hash and nil to an options object
1279
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1280
+
1281
+ # Customize the options with defaults
1282
+ metadata = @config.rpcs.delete_api_config.metadata.to_h
1283
+
1284
+ # Set x-goog-api-client and x-goog-user-project headers
1285
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1286
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1287
+ gapic_version: ::Google::Cloud::ApiGateway::V1::VERSION
1288
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1289
+
1290
+ header_params = {
1291
+ "name" => request.name
1292
+ }
1293
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1294
+ metadata[:"x-goog-request-params"] ||= request_params_header
1295
+
1296
+ options.apply_defaults timeout: @config.rpcs.delete_api_config.timeout,
1297
+ metadata: metadata,
1298
+ retry_policy: @config.rpcs.delete_api_config.retry_policy
1299
+ options.apply_defaults metadata: @config.metadata,
1300
+ retry_policy: @config.retry_policy
1301
+
1302
+ @api_gateway_service_stub.call_rpc :delete_api_config, request, options: options do |response, operation|
1303
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1304
+ yield response, operation if block_given?
1305
+ return response
1306
+ end
1307
+ rescue ::GRPC::BadStatus => e
1308
+ raise ::Google::Cloud::Error.from_error(e)
1309
+ end
1310
+
1311
+ ##
1312
+ # Configuration class for the ApiGatewayService API.
1313
+ #
1314
+ # This class represents the configuration for ApiGatewayService,
1315
+ # providing control over timeouts, retry behavior, logging, transport
1316
+ # parameters, and other low-level controls. Certain parameters can also be
1317
+ # applied individually to specific RPCs. See
1318
+ # {::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client::Configuration::Rpcs}
1319
+ # for a list of RPCs that can be configured independently.
1320
+ #
1321
+ # Configuration can be applied globally to all clients, or to a single client
1322
+ # on construction.
1323
+ #
1324
+ # # Examples
1325
+ #
1326
+ # To modify the global config, setting the timeout for list_gateways
1327
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
1328
+ #
1329
+ # ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.configure do |config|
1330
+ # config.timeout = 10.0
1331
+ # config.rpcs.list_gateways.timeout = 20.0
1332
+ # end
1333
+ #
1334
+ # To apply the above configuration only to a new client:
1335
+ #
1336
+ # client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config|
1337
+ # config.timeout = 10.0
1338
+ # config.rpcs.list_gateways.timeout = 20.0
1339
+ # end
1340
+ #
1341
+ # @!attribute [rw] endpoint
1342
+ # The hostname or hostname:port of the service endpoint.
1343
+ # Defaults to `"apigateway.googleapis.com"`.
1344
+ # @return [::String]
1345
+ # @!attribute [rw] credentials
1346
+ # Credentials to send with calls. You may provide any of the following types:
1347
+ # * (`String`) The path to a service account key file in JSON format
1348
+ # * (`Hash`) A service account key as a Hash
1349
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1350
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1351
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1352
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1353
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1354
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1355
+ # * (`nil`) indicating no credentials
1356
+ # @return [::Object]
1357
+ # @!attribute [rw] scope
1358
+ # The OAuth scopes
1359
+ # @return [::Array<::String>]
1360
+ # @!attribute [rw] lib_name
1361
+ # The library name as recorded in instrumentation and logging
1362
+ # @return [::String]
1363
+ # @!attribute [rw] lib_version
1364
+ # The library version as recorded in instrumentation and logging
1365
+ # @return [::String]
1366
+ # @!attribute [rw] channel_args
1367
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1368
+ # `GRPC::Core::Channel` object is provided as the credential.
1369
+ # @return [::Hash]
1370
+ # @!attribute [rw] interceptors
1371
+ # An array of interceptors that are run before calls are executed.
1372
+ # @return [::Array<::GRPC::ClientInterceptor>]
1373
+ # @!attribute [rw] timeout
1374
+ # The call timeout in seconds.
1375
+ # @return [::Numeric]
1376
+ # @!attribute [rw] metadata
1377
+ # Additional gRPC headers to be sent with the call.
1378
+ # @return [::Hash{::Symbol=>::String}]
1379
+ # @!attribute [rw] retry_policy
1380
+ # The retry policy. The value is a hash with the following keys:
1381
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1382
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1383
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1384
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1385
+ # trigger a retry.
1386
+ # @return [::Hash]
1387
+ # @!attribute [rw] quota_project
1388
+ # A separate project against which to charge quota.
1389
+ # @return [::String]
1390
+ #
1391
+ class Configuration
1392
+ extend ::Gapic::Config
1393
+
1394
+ config_attr :endpoint, "apigateway.googleapis.com", ::String
1395
+ config_attr :credentials, nil do |value|
1396
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1397
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1398
+ allowed.any? { |klass| klass === value }
1399
+ end
1400
+ config_attr :scope, nil, ::String, ::Array, nil
1401
+ config_attr :lib_name, nil, ::String, nil
1402
+ config_attr :lib_version, nil, ::String, nil
1403
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1404
+ config_attr :interceptors, nil, ::Array, nil
1405
+ config_attr :timeout, nil, ::Numeric, nil
1406
+ config_attr :metadata, nil, ::Hash, nil
1407
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1408
+ config_attr :quota_project, nil, ::String, nil
1409
+
1410
+ # @private
1411
+ def initialize parent_config = nil
1412
+ @parent_config = parent_config unless parent_config.nil?
1413
+
1414
+ yield self if block_given?
1415
+ end
1416
+
1417
+ ##
1418
+ # Configurations for individual RPCs
1419
+ # @return [Rpcs]
1420
+ #
1421
+ def rpcs
1422
+ @rpcs ||= begin
1423
+ parent_rpcs = nil
1424
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1425
+ Rpcs.new parent_rpcs
1426
+ end
1427
+ end
1428
+
1429
+ ##
1430
+ # Configuration RPC class for the ApiGatewayService API.
1431
+ #
1432
+ # Includes fields providing the configuration for each RPC in this service.
1433
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1434
+ # the following configuration fields:
1435
+ #
1436
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1437
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1438
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1439
+ # include the following keys:
1440
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1441
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1442
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1443
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1444
+ # trigger a retry.
1445
+ #
1446
+ class Rpcs
1447
+ ##
1448
+ # RPC-specific configuration for `list_gateways`
1449
+ # @return [::Gapic::Config::Method]
1450
+ #
1451
+ attr_reader :list_gateways
1452
+ ##
1453
+ # RPC-specific configuration for `get_gateway`
1454
+ # @return [::Gapic::Config::Method]
1455
+ #
1456
+ attr_reader :get_gateway
1457
+ ##
1458
+ # RPC-specific configuration for `create_gateway`
1459
+ # @return [::Gapic::Config::Method]
1460
+ #
1461
+ attr_reader :create_gateway
1462
+ ##
1463
+ # RPC-specific configuration for `update_gateway`
1464
+ # @return [::Gapic::Config::Method]
1465
+ #
1466
+ attr_reader :update_gateway
1467
+ ##
1468
+ # RPC-specific configuration for `delete_gateway`
1469
+ # @return [::Gapic::Config::Method]
1470
+ #
1471
+ attr_reader :delete_gateway
1472
+ ##
1473
+ # RPC-specific configuration for `list_apis`
1474
+ # @return [::Gapic::Config::Method]
1475
+ #
1476
+ attr_reader :list_apis
1477
+ ##
1478
+ # RPC-specific configuration for `get_api`
1479
+ # @return [::Gapic::Config::Method]
1480
+ #
1481
+ attr_reader :get_api
1482
+ ##
1483
+ # RPC-specific configuration for `create_api`
1484
+ # @return [::Gapic::Config::Method]
1485
+ #
1486
+ attr_reader :create_api
1487
+ ##
1488
+ # RPC-specific configuration for `update_api`
1489
+ # @return [::Gapic::Config::Method]
1490
+ #
1491
+ attr_reader :update_api
1492
+ ##
1493
+ # RPC-specific configuration for `delete_api`
1494
+ # @return [::Gapic::Config::Method]
1495
+ #
1496
+ attr_reader :delete_api
1497
+ ##
1498
+ # RPC-specific configuration for `list_api_configs`
1499
+ # @return [::Gapic::Config::Method]
1500
+ #
1501
+ attr_reader :list_api_configs
1502
+ ##
1503
+ # RPC-specific configuration for `get_api_config`
1504
+ # @return [::Gapic::Config::Method]
1505
+ #
1506
+ attr_reader :get_api_config
1507
+ ##
1508
+ # RPC-specific configuration for `create_api_config`
1509
+ # @return [::Gapic::Config::Method]
1510
+ #
1511
+ attr_reader :create_api_config
1512
+ ##
1513
+ # RPC-specific configuration for `update_api_config`
1514
+ # @return [::Gapic::Config::Method]
1515
+ #
1516
+ attr_reader :update_api_config
1517
+ ##
1518
+ # RPC-specific configuration for `delete_api_config`
1519
+ # @return [::Gapic::Config::Method]
1520
+ #
1521
+ attr_reader :delete_api_config
1522
+
1523
+ # @private
1524
+ def initialize parent_rpcs = nil
1525
+ list_gateways_config = parent_rpcs.list_gateways if parent_rpcs.respond_to? :list_gateways
1526
+ @list_gateways = ::Gapic::Config::Method.new list_gateways_config
1527
+ get_gateway_config = parent_rpcs.get_gateway if parent_rpcs.respond_to? :get_gateway
1528
+ @get_gateway = ::Gapic::Config::Method.new get_gateway_config
1529
+ create_gateway_config = parent_rpcs.create_gateway if parent_rpcs.respond_to? :create_gateway
1530
+ @create_gateway = ::Gapic::Config::Method.new create_gateway_config
1531
+ update_gateway_config = parent_rpcs.update_gateway if parent_rpcs.respond_to? :update_gateway
1532
+ @update_gateway = ::Gapic::Config::Method.new update_gateway_config
1533
+ delete_gateway_config = parent_rpcs.delete_gateway if parent_rpcs.respond_to? :delete_gateway
1534
+ @delete_gateway = ::Gapic::Config::Method.new delete_gateway_config
1535
+ list_apis_config = parent_rpcs.list_apis if parent_rpcs.respond_to? :list_apis
1536
+ @list_apis = ::Gapic::Config::Method.new list_apis_config
1537
+ get_api_config = parent_rpcs.get_api if parent_rpcs.respond_to? :get_api
1538
+ @get_api = ::Gapic::Config::Method.new get_api_config
1539
+ create_api_config = parent_rpcs.create_api if parent_rpcs.respond_to? :create_api
1540
+ @create_api = ::Gapic::Config::Method.new create_api_config
1541
+ update_api_config = parent_rpcs.update_api if parent_rpcs.respond_to? :update_api
1542
+ @update_api = ::Gapic::Config::Method.new update_api_config
1543
+ delete_api_config = parent_rpcs.delete_api if parent_rpcs.respond_to? :delete_api
1544
+ @delete_api = ::Gapic::Config::Method.new delete_api_config
1545
+ list_api_configs_config = parent_rpcs.list_api_configs if parent_rpcs.respond_to? :list_api_configs
1546
+ @list_api_configs = ::Gapic::Config::Method.new list_api_configs_config
1547
+ get_api_config_config = parent_rpcs.get_api_config if parent_rpcs.respond_to? :get_api_config
1548
+ @get_api_config = ::Gapic::Config::Method.new get_api_config_config
1549
+ create_api_config_config = parent_rpcs.create_api_config if parent_rpcs.respond_to? :create_api_config
1550
+ @create_api_config = ::Gapic::Config::Method.new create_api_config_config
1551
+ update_api_config_config = parent_rpcs.update_api_config if parent_rpcs.respond_to? :update_api_config
1552
+ @update_api_config = ::Gapic::Config::Method.new update_api_config_config
1553
+ delete_api_config_config = parent_rpcs.delete_api_config if parent_rpcs.respond_to? :delete_api_config
1554
+ @delete_api_config = ::Gapic::Config::Method.new delete_api_config_config
1555
+
1556
+ yield self if block_given?
1557
+ end
1558
+ end
1559
+ end
1560
+ end
1561
+ end
1562
+ end
1563
+ end
1564
+ end
1565
+ end