google-cloud-beyond_corp-app_gateways-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +144 -0
  6. data/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb +804 -0
  7. data/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/credentials.rb +49 -0
  8. data/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/operations.rb +772 -0
  9. data/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/paths.rb +71 -0
  10. data/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service.rb +65 -0
  11. data/lib/google/cloud/beyond_corp/app_gateways/v1/version.rb +30 -0
  12. data/lib/google/cloud/beyond_corp/app_gateways/v1.rb +42 -0
  13. data/lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_pb.rb +107 -0
  14. data/lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_services_pb.rb +66 -0
  15. data/lib/google-cloud-beyond_corp-app_gateways-v1.rb +21 -0
  16. data/proto_docs/README.md +4 -0
  17. data/proto_docs/google/api/field_behavior.rb +71 -0
  18. data/proto_docs/google/api/resource.rb +222 -0
  19. data/proto_docs/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.rb +291 -0
  20. data/proto_docs/google/longrunning/operations.rb +164 -0
  21. data/proto_docs/google/protobuf/any.rb +141 -0
  22. data/proto_docs/google/protobuf/duration.rb +98 -0
  23. data/proto_docs/google/protobuf/empty.rb +34 -0
  24. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  25. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  26. data/proto_docs/google/rpc/status.rb +46 -0
  27. data/proto_docs/google/type/expr.rb +75 -0
  28. metadata +260 -0
@@ -0,0 +1,804 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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/beyondcorp/appgateways/v1/app_gateways_service_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module BeyondCorp
27
+ module AppGateways
28
+ module V1
29
+ module AppGatewaysService
30
+ ##
31
+ # Client for the AppGatewaysService service.
32
+ #
33
+ # ## API Overview
34
+ #
35
+ # The `beyondcorp.googleapis.com` service implements the Google Cloud
36
+ # BeyondCorp API.
37
+ #
38
+ # ## Data Model
39
+ #
40
+ # The AppGatewaysService exposes the following resources:
41
+ #
42
+ # * AppGateways, named as follows:
43
+ # `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`.
44
+ #
45
+ # The AppGatewaysService service provides methods to manage
46
+ # (create/read/update/delete) BeyondCorp AppGateways.
47
+ #
48
+ class Client
49
+ include Paths
50
+
51
+ # @private
52
+ attr_reader :app_gateways_service_stub
53
+
54
+ ##
55
+ # Configure the AppGatewaysService Client class.
56
+ #
57
+ # See {::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client::Configuration}
58
+ # for a description of the configuration fields.
59
+ #
60
+ # @example
61
+ #
62
+ # # Modify the configuration for all AppGatewaysService clients
63
+ # ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.configure do |config|
64
+ # config.timeout = 10.0
65
+ # end
66
+ #
67
+ # @yield [config] Configure the Client client.
68
+ # @yieldparam config [Client::Configuration]
69
+ #
70
+ # @return [Client::Configuration]
71
+ #
72
+ def self.configure
73
+ @configure ||= begin
74
+ namespace = ["Google", "Cloud", "BeyondCorp", "AppGateways", "V1"]
75
+ parent_config = while namespace.any?
76
+ parent_name = namespace.join "::"
77
+ parent_const = const_get parent_name
78
+ break parent_const.configure if parent_const.respond_to? :configure
79
+ namespace.pop
80
+ end
81
+ default_config = Client::Configuration.new parent_config
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the AppGatewaysService Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # Create a new AppGatewaysService client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the AppGatewaysService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/beyondcorp/appgateways/v1/app_gateways_service_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
143
+ !@config.endpoint.split(".").first.include?("-")
144
+ credentials ||= Credentials.default scope: @config.scope,
145
+ enable_self_signed_jwt: enable_self_signed_jwt
146
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
147
+ credentials = Credentials.new credentials, scope: @config.scope
148
+ end
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @operations_client = Operations.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ end
157
+
158
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ end
163
+
164
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
165
+ config.credentials = credentials
166
+ config.quota_project = @quota_project_id
167
+ config.endpoint = @config.endpoint
168
+ end
169
+
170
+ @app_gateways_service_stub = ::Gapic::ServiceStub.new(
171
+ ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Stub,
172
+ credentials: credentials,
173
+ endpoint: @config.endpoint,
174
+ channel_args: @config.channel_args,
175
+ interceptors: @config.interceptors
176
+ )
177
+ end
178
+
179
+ ##
180
+ # Get the associated client for long-running operations.
181
+ #
182
+ # @return [::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Operations]
183
+ #
184
+ attr_reader :operations_client
185
+
186
+ ##
187
+ # Get the associated client for mix-in of the Locations.
188
+ #
189
+ # @return [Google::Cloud::Location::Locations::Client]
190
+ #
191
+ attr_reader :location_client
192
+
193
+ ##
194
+ # Get the associated client for mix-in of the IAMPolicy.
195
+ #
196
+ # @return [Google::Iam::V1::IAMPolicy::Client]
197
+ #
198
+ attr_reader :iam_policy_client
199
+
200
+ # Service calls
201
+
202
+ ##
203
+ # Lists AppGateways in a given project and location.
204
+ #
205
+ # @overload list_app_gateways(request, options = nil)
206
+ # Pass arguments to `list_app_gateways` via a request object, either of type
207
+ # {::Google::Cloud::BeyondCorp::AppGateways::V1::ListAppGatewaysRequest} or an equivalent Hash.
208
+ #
209
+ # @param request [::Google::Cloud::BeyondCorp::AppGateways::V1::ListAppGatewaysRequest, ::Hash]
210
+ # A request object representing the call parameters. Required. To specify no
211
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
212
+ # @param options [::Gapic::CallOptions, ::Hash]
213
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
214
+ #
215
+ # @overload list_app_gateways(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
216
+ # Pass arguments to `list_app_gateways` via keyword arguments. Note that at
217
+ # least one keyword argument is required. To specify no parameters, or to keep all
218
+ # the default parameter values, pass an empty Hash as a request object (see above).
219
+ #
220
+ # @param parent [::String]
221
+ # Required. The resource name of the AppGateway location using the form:
222
+ # `projects/{project_id}/locations/{location_id}`
223
+ # @param page_size [::Integer]
224
+ # Optional. The maximum number of items to return.
225
+ # If not specified, a default value of 50 will be used by the service.
226
+ # Regardless of the page_size value, the response may include a partial list
227
+ # and a caller should only rely on response's
228
+ # [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to
229
+ # determine if there are more instances left to be queried.
230
+ # @param page_token [::String]
231
+ # Optional. The next_page_token value returned from a previous
232
+ # ListAppGatewaysRequest, if any.
233
+ # @param filter [::String]
234
+ # Optional. A filter specifying constraints of a list operation.
235
+ # @param order_by [::String]
236
+ # Optional. Specifies the ordering of results. See
237
+ # [Sorting
238
+ # order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
239
+ # for more information.
240
+ #
241
+ # @yield [response, operation] Access the result along with the RPC operation
242
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway>]
243
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
244
+ #
245
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway>]
246
+ #
247
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
248
+ #
249
+ # @example Basic example
250
+ # require "google/cloud/beyond_corp/app_gateways/v1"
251
+ #
252
+ # # Create a client object. The client can be reused for multiple calls.
253
+ # client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new
254
+ #
255
+ # # Create a request. To set request fields, pass in keyword arguments.
256
+ # request = Google::Cloud::BeyondCorp::AppGateways::V1::ListAppGatewaysRequest.new
257
+ #
258
+ # # Call the list_app_gateways method.
259
+ # result = client.list_app_gateways request
260
+ #
261
+ # # The returned object is of type Gapic::PagedEnumerable. You can
262
+ # # iterate over all elements by calling #each, and the enumerable
263
+ # # will lazily make API calls to fetch subsequent pages. Other
264
+ # # methods are also available for managing paging directly.
265
+ # result.each do |response|
266
+ # # Each element is of type ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway.
267
+ # p response
268
+ # end
269
+ #
270
+ def list_app_gateways request, options = nil
271
+ raise ::ArgumentError, "request must be provided" if request.nil?
272
+
273
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::AppGateways::V1::ListAppGatewaysRequest
274
+
275
+ # Converts hash and nil to an options object
276
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
277
+
278
+ # Customize the options with defaults
279
+ metadata = @config.rpcs.list_app_gateways.metadata.to_h
280
+
281
+ # Set x-goog-api-client and x-goog-user-project headers
282
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
283
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
284
+ gapic_version: ::Google::Cloud::BeyondCorp::AppGateways::V1::VERSION
285
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
286
+
287
+ header_params = {}
288
+ if request.parent
289
+ header_params["parent"] = request.parent
290
+ end
291
+
292
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
293
+ metadata[:"x-goog-request-params"] ||= request_params_header
294
+
295
+ options.apply_defaults timeout: @config.rpcs.list_app_gateways.timeout,
296
+ metadata: metadata,
297
+ retry_policy: @config.rpcs.list_app_gateways.retry_policy
298
+
299
+ options.apply_defaults timeout: @config.timeout,
300
+ metadata: @config.metadata,
301
+ retry_policy: @config.retry_policy
302
+
303
+ @app_gateways_service_stub.call_rpc :list_app_gateways, request, options: options do |response, operation|
304
+ response = ::Gapic::PagedEnumerable.new @app_gateways_service_stub, :list_app_gateways, request, response, operation, options
305
+ yield response, operation if block_given?
306
+ return response
307
+ end
308
+ rescue ::GRPC::BadStatus => e
309
+ raise ::Google::Cloud::Error.from_error(e)
310
+ end
311
+
312
+ ##
313
+ # Gets details of a single AppGateway.
314
+ #
315
+ # @overload get_app_gateway(request, options = nil)
316
+ # Pass arguments to `get_app_gateway` via a request object, either of type
317
+ # {::Google::Cloud::BeyondCorp::AppGateways::V1::GetAppGatewayRequest} or an equivalent Hash.
318
+ #
319
+ # @param request [::Google::Cloud::BeyondCorp::AppGateways::V1::GetAppGatewayRequest, ::Hash]
320
+ # A request object representing the call parameters. Required. To specify no
321
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
322
+ # @param options [::Gapic::CallOptions, ::Hash]
323
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
324
+ #
325
+ # @overload get_app_gateway(name: nil)
326
+ # Pass arguments to `get_app_gateway` via keyword arguments. Note that at
327
+ # least one keyword argument is required. To specify no parameters, or to keep all
328
+ # the default parameter values, pass an empty Hash as a request object (see above).
329
+ #
330
+ # @param name [::String]
331
+ # Required. BeyondCorp AppGateway name using the form:
332
+ # `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
333
+ #
334
+ # @yield [response, operation] Access the result along with the RPC operation
335
+ # @yieldparam response [::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway]
336
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
337
+ #
338
+ # @return [::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway]
339
+ #
340
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
341
+ #
342
+ # @example Basic example
343
+ # require "google/cloud/beyond_corp/app_gateways/v1"
344
+ #
345
+ # # Create a client object. The client can be reused for multiple calls.
346
+ # client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new
347
+ #
348
+ # # Create a request. To set request fields, pass in keyword arguments.
349
+ # request = Google::Cloud::BeyondCorp::AppGateways::V1::GetAppGatewayRequest.new
350
+ #
351
+ # # Call the get_app_gateway method.
352
+ # result = client.get_app_gateway request
353
+ #
354
+ # # The returned object is of type Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway.
355
+ # p result
356
+ #
357
+ def get_app_gateway request, options = nil
358
+ raise ::ArgumentError, "request must be provided" if request.nil?
359
+
360
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::AppGateways::V1::GetAppGatewayRequest
361
+
362
+ # Converts hash and nil to an options object
363
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
364
+
365
+ # Customize the options with defaults
366
+ metadata = @config.rpcs.get_app_gateway.metadata.to_h
367
+
368
+ # Set x-goog-api-client and x-goog-user-project headers
369
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
370
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
371
+ gapic_version: ::Google::Cloud::BeyondCorp::AppGateways::V1::VERSION
372
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
373
+
374
+ header_params = {}
375
+ if request.name
376
+ header_params["name"] = request.name
377
+ end
378
+
379
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
380
+ metadata[:"x-goog-request-params"] ||= request_params_header
381
+
382
+ options.apply_defaults timeout: @config.rpcs.get_app_gateway.timeout,
383
+ metadata: metadata,
384
+ retry_policy: @config.rpcs.get_app_gateway.retry_policy
385
+
386
+ options.apply_defaults timeout: @config.timeout,
387
+ metadata: @config.metadata,
388
+ retry_policy: @config.retry_policy
389
+
390
+ @app_gateways_service_stub.call_rpc :get_app_gateway, request, options: options do |response, operation|
391
+ yield response, operation if block_given?
392
+ return response
393
+ end
394
+ rescue ::GRPC::BadStatus => e
395
+ raise ::Google::Cloud::Error.from_error(e)
396
+ end
397
+
398
+ ##
399
+ # Creates a new AppGateway in a given project and location.
400
+ #
401
+ # @overload create_app_gateway(request, options = nil)
402
+ # Pass arguments to `create_app_gateway` via a request object, either of type
403
+ # {::Google::Cloud::BeyondCorp::AppGateways::V1::CreateAppGatewayRequest} or an equivalent Hash.
404
+ #
405
+ # @param request [::Google::Cloud::BeyondCorp::AppGateways::V1::CreateAppGatewayRequest, ::Hash]
406
+ # A request object representing the call parameters. Required. To specify no
407
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
408
+ # @param options [::Gapic::CallOptions, ::Hash]
409
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
410
+ #
411
+ # @overload create_app_gateway(parent: nil, app_gateway_id: nil, app_gateway: nil, request_id: nil, validate_only: nil)
412
+ # Pass arguments to `create_app_gateway` via keyword arguments. Note that at
413
+ # least one keyword argument is required. To specify no parameters, or to keep all
414
+ # the default parameter values, pass an empty Hash as a request object (see above).
415
+ #
416
+ # @param parent [::String]
417
+ # Required. The resource project name of the AppGateway location using the
418
+ # form: `projects/{project_id}/locations/{location_id}`
419
+ # @param app_gateway_id [::String]
420
+ # Optional. User-settable AppGateway resource ID.
421
+ # * Must start with a letter.
422
+ # * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
423
+ # * Must end with a number or a letter.
424
+ # @param app_gateway [::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway, ::Hash]
425
+ # Required. A BeyondCorp AppGateway resource.
426
+ # @param request_id [::String]
427
+ # Optional. An optional request ID to identify requests. Specify a unique
428
+ # request ID so that if you must retry your request, the server will know to
429
+ # ignore the request if it has already been completed. The server will
430
+ # guarantee that for at least 60 minutes since the first request.
431
+ #
432
+ # For example, consider a situation where you make an initial request and t
433
+ # he request times out. If you make the request again with the same request
434
+ # ID, the server can check if original operation with the same request ID
435
+ # was received, and if so, will ignore the second request. This prevents
436
+ # clients from accidentally creating duplicate commitments.
437
+ #
438
+ # The request ID must be a valid UUID with the exception that zero UUID is
439
+ # not supported (00000000-0000-0000-0000-000000000000).
440
+ # @param validate_only [::Boolean]
441
+ # Optional. If set, validates request by executing a dry-run which would not
442
+ # alter the resource in any way.
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/beyond_corp/app_gateways/v1"
454
+ #
455
+ # # Create a client object. The client can be reused for multiple calls.
456
+ # client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new
457
+ #
458
+ # # Create a request. To set request fields, pass in keyword arguments.
459
+ # request = Google::Cloud::BeyondCorp::AppGateways::V1::CreateAppGatewayRequest.new
460
+ #
461
+ # # Call the create_app_gateway method.
462
+ # result = client.create_app_gateway request
463
+ #
464
+ # # The returned object is of type Gapic::Operation. You can use this
465
+ # # object to check the status of an operation, cancel it, or wait
466
+ # # for results. Here is how to block until completion:
467
+ # result.wait_until_done! timeout: 60
468
+ # if result.response?
469
+ # p result.response
470
+ # else
471
+ # puts "Error!"
472
+ # end
473
+ #
474
+ def create_app_gateway request, options = nil
475
+ raise ::ArgumentError, "request must be provided" if request.nil?
476
+
477
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::AppGateways::V1::CreateAppGatewayRequest
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_app_gateway.metadata.to_h
484
+
485
+ # Set x-goog-api-client and x-goog-user-project 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::BeyondCorp::AppGateways::V1::VERSION
489
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
490
+
491
+ header_params = {}
492
+ if request.parent
493
+ header_params["parent"] = request.parent
494
+ end
495
+
496
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
497
+ metadata[:"x-goog-request-params"] ||= request_params_header
498
+
499
+ options.apply_defaults timeout: @config.rpcs.create_app_gateway.timeout,
500
+ metadata: metadata,
501
+ retry_policy: @config.rpcs.create_app_gateway.retry_policy
502
+
503
+ options.apply_defaults timeout: @config.timeout,
504
+ metadata: @config.metadata,
505
+ retry_policy: @config.retry_policy
506
+
507
+ @app_gateways_service_stub.call_rpc :create_app_gateway, request, options: options do |response, operation|
508
+ response = ::Gapic::Operation.new response, @operations_client, options: options
509
+ yield response, operation if block_given?
510
+ return response
511
+ end
512
+ rescue ::GRPC::BadStatus => e
513
+ raise ::Google::Cloud::Error.from_error(e)
514
+ end
515
+
516
+ ##
517
+ # Deletes a single AppGateway.
518
+ #
519
+ # @overload delete_app_gateway(request, options = nil)
520
+ # Pass arguments to `delete_app_gateway` via a request object, either of type
521
+ # {::Google::Cloud::BeyondCorp::AppGateways::V1::DeleteAppGatewayRequest} or an equivalent Hash.
522
+ #
523
+ # @param request [::Google::Cloud::BeyondCorp::AppGateways::V1::DeleteAppGatewayRequest, ::Hash]
524
+ # A request object representing the call parameters. Required. To specify no
525
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
526
+ # @param options [::Gapic::CallOptions, ::Hash]
527
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
528
+ #
529
+ # @overload delete_app_gateway(name: nil, request_id: nil, validate_only: nil)
530
+ # Pass arguments to `delete_app_gateway` via keyword arguments. Note that at
531
+ # least one keyword argument is required. To specify no parameters, or to keep all
532
+ # the default parameter values, pass an empty Hash as a request object (see above).
533
+ #
534
+ # @param name [::String]
535
+ # Required. BeyondCorp AppGateway name using the form:
536
+ # `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
537
+ # @param request_id [::String]
538
+ # Optional. An optional request ID to identify requests. Specify a unique
539
+ # request ID so that if you must retry your request, the server will know to
540
+ # ignore the request if it has already been completed. The server will
541
+ # guarantee that for at least 60 minutes after the first request.
542
+ #
543
+ # For example, consider a situation where you make an initial request and t
544
+ # he request times out. If you make the request again with the same request
545
+ # ID, the server can check if original operation with the same request ID
546
+ # was received, and if so, will ignore the second request. This prevents
547
+ # clients from accidentally creating duplicate commitments.
548
+ #
549
+ # The request ID must be a valid UUID with the exception that zero UUID is
550
+ # not supported (00000000-0000-0000-0000-000000000000).
551
+ # @param validate_only [::Boolean]
552
+ # Optional. If set, validates request by executing a dry-run which would not
553
+ # alter the resource in any way.
554
+ #
555
+ # @yield [response, operation] Access the result along with the RPC operation
556
+ # @yieldparam response [::Gapic::Operation]
557
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
558
+ #
559
+ # @return [::Gapic::Operation]
560
+ #
561
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
562
+ #
563
+ # @example Basic example
564
+ # require "google/cloud/beyond_corp/app_gateways/v1"
565
+ #
566
+ # # Create a client object. The client can be reused for multiple calls.
567
+ # client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new
568
+ #
569
+ # # Create a request. To set request fields, pass in keyword arguments.
570
+ # request = Google::Cloud::BeyondCorp::AppGateways::V1::DeleteAppGatewayRequest.new
571
+ #
572
+ # # Call the delete_app_gateway method.
573
+ # result = client.delete_app_gateway request
574
+ #
575
+ # # The returned object is of type Gapic::Operation. You can use this
576
+ # # object to check the status of an operation, cancel it, or wait
577
+ # # for results. Here is how to block until completion:
578
+ # result.wait_until_done! timeout: 60
579
+ # if result.response?
580
+ # p result.response
581
+ # else
582
+ # puts "Error!"
583
+ # end
584
+ #
585
+ def delete_app_gateway request, options = nil
586
+ raise ::ArgumentError, "request must be provided" if request.nil?
587
+
588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::AppGateways::V1::DeleteAppGatewayRequest
589
+
590
+ # Converts hash and nil to an options object
591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
592
+
593
+ # Customize the options with defaults
594
+ metadata = @config.rpcs.delete_app_gateway.metadata.to_h
595
+
596
+ # Set x-goog-api-client and x-goog-user-project headers
597
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
599
+ gapic_version: ::Google::Cloud::BeyondCorp::AppGateways::V1::VERSION
600
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
601
+
602
+ header_params = {}
603
+ if request.name
604
+ header_params["name"] = request.name
605
+ end
606
+
607
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
608
+ metadata[:"x-goog-request-params"] ||= request_params_header
609
+
610
+ options.apply_defaults timeout: @config.rpcs.delete_app_gateway.timeout,
611
+ metadata: metadata,
612
+ retry_policy: @config.rpcs.delete_app_gateway.retry_policy
613
+
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata,
616
+ retry_policy: @config.retry_policy
617
+
618
+ @app_gateways_service_stub.call_rpc :delete_app_gateway, request, options: options do |response, operation|
619
+ response = ::Gapic::Operation.new response, @operations_client, options: options
620
+ yield response, operation if block_given?
621
+ return response
622
+ end
623
+ rescue ::GRPC::BadStatus => e
624
+ raise ::Google::Cloud::Error.from_error(e)
625
+ end
626
+
627
+ ##
628
+ # Configuration class for the AppGatewaysService API.
629
+ #
630
+ # This class represents the configuration for AppGatewaysService,
631
+ # providing control over timeouts, retry behavior, logging, transport
632
+ # parameters, and other low-level controls. Certain parameters can also be
633
+ # applied individually to specific RPCs. See
634
+ # {::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client::Configuration::Rpcs}
635
+ # for a list of RPCs that can be configured independently.
636
+ #
637
+ # Configuration can be applied globally to all clients, or to a single client
638
+ # on construction.
639
+ #
640
+ # @example
641
+ #
642
+ # # Modify the global config, setting the timeout for
643
+ # # list_app_gateways to 20 seconds,
644
+ # # and all remaining timeouts to 10 seconds.
645
+ # ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.configure do |config|
646
+ # config.timeout = 10.0
647
+ # config.rpcs.list_app_gateways.timeout = 20.0
648
+ # end
649
+ #
650
+ # # Apply the above configuration only to a new client.
651
+ # client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new do |config|
652
+ # config.timeout = 10.0
653
+ # config.rpcs.list_app_gateways.timeout = 20.0
654
+ # end
655
+ #
656
+ # @!attribute [rw] endpoint
657
+ # The hostname or hostname:port of the service endpoint.
658
+ # Defaults to `"beyondcorp.googleapis.com"`.
659
+ # @return [::String]
660
+ # @!attribute [rw] credentials
661
+ # Credentials to send with calls. You may provide any of the following types:
662
+ # * (`String`) The path to a service account key file in JSON format
663
+ # * (`Hash`) A service account key as a Hash
664
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
665
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
666
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
667
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
668
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
669
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
670
+ # * (`nil`) indicating no credentials
671
+ # @return [::Object]
672
+ # @!attribute [rw] scope
673
+ # The OAuth scopes
674
+ # @return [::Array<::String>]
675
+ # @!attribute [rw] lib_name
676
+ # The library name as recorded in instrumentation and logging
677
+ # @return [::String]
678
+ # @!attribute [rw] lib_version
679
+ # The library version as recorded in instrumentation and logging
680
+ # @return [::String]
681
+ # @!attribute [rw] channel_args
682
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
683
+ # `GRPC::Core::Channel` object is provided as the credential.
684
+ # @return [::Hash]
685
+ # @!attribute [rw] interceptors
686
+ # An array of interceptors that are run before calls are executed.
687
+ # @return [::Array<::GRPC::ClientInterceptor>]
688
+ # @!attribute [rw] timeout
689
+ # The call timeout in seconds.
690
+ # @return [::Numeric]
691
+ # @!attribute [rw] metadata
692
+ # Additional gRPC headers to be sent with the call.
693
+ # @return [::Hash{::Symbol=>::String}]
694
+ # @!attribute [rw] retry_policy
695
+ # The retry policy. The value is a hash with the following keys:
696
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
697
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
698
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
699
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
700
+ # trigger a retry.
701
+ # @return [::Hash]
702
+ # @!attribute [rw] quota_project
703
+ # A separate project against which to charge quota.
704
+ # @return [::String]
705
+ #
706
+ class Configuration
707
+ extend ::Gapic::Config
708
+
709
+ config_attr :endpoint, "beyondcorp.googleapis.com", ::String
710
+ config_attr :credentials, nil do |value|
711
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
712
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
713
+ allowed.any? { |klass| klass === value }
714
+ end
715
+ config_attr :scope, nil, ::String, ::Array, nil
716
+ config_attr :lib_name, nil, ::String, nil
717
+ config_attr :lib_version, nil, ::String, nil
718
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
719
+ config_attr :interceptors, nil, ::Array, nil
720
+ config_attr :timeout, nil, ::Numeric, nil
721
+ config_attr :metadata, nil, ::Hash, nil
722
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
723
+ config_attr :quota_project, nil, ::String, nil
724
+
725
+ # @private
726
+ def initialize parent_config = nil
727
+ @parent_config = parent_config unless parent_config.nil?
728
+
729
+ yield self if block_given?
730
+ end
731
+
732
+ ##
733
+ # Configurations for individual RPCs
734
+ # @return [Rpcs]
735
+ #
736
+ def rpcs
737
+ @rpcs ||= begin
738
+ parent_rpcs = nil
739
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
740
+ Rpcs.new parent_rpcs
741
+ end
742
+ end
743
+
744
+ ##
745
+ # Configuration RPC class for the AppGatewaysService API.
746
+ #
747
+ # Includes fields providing the configuration for each RPC in this service.
748
+ # Each configuration object is of type `Gapic::Config::Method` and includes
749
+ # the following configuration fields:
750
+ #
751
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
752
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
753
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
754
+ # include the following keys:
755
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
756
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
757
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
758
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
759
+ # trigger a retry.
760
+ #
761
+ class Rpcs
762
+ ##
763
+ # RPC-specific configuration for `list_app_gateways`
764
+ # @return [::Gapic::Config::Method]
765
+ #
766
+ attr_reader :list_app_gateways
767
+ ##
768
+ # RPC-specific configuration for `get_app_gateway`
769
+ # @return [::Gapic::Config::Method]
770
+ #
771
+ attr_reader :get_app_gateway
772
+ ##
773
+ # RPC-specific configuration for `create_app_gateway`
774
+ # @return [::Gapic::Config::Method]
775
+ #
776
+ attr_reader :create_app_gateway
777
+ ##
778
+ # RPC-specific configuration for `delete_app_gateway`
779
+ # @return [::Gapic::Config::Method]
780
+ #
781
+ attr_reader :delete_app_gateway
782
+
783
+ # @private
784
+ def initialize parent_rpcs = nil
785
+ list_app_gateways_config = parent_rpcs.list_app_gateways if parent_rpcs.respond_to? :list_app_gateways
786
+ @list_app_gateways = ::Gapic::Config::Method.new list_app_gateways_config
787
+ get_app_gateway_config = parent_rpcs.get_app_gateway if parent_rpcs.respond_to? :get_app_gateway
788
+ @get_app_gateway = ::Gapic::Config::Method.new get_app_gateway_config
789
+ create_app_gateway_config = parent_rpcs.create_app_gateway if parent_rpcs.respond_to? :create_app_gateway
790
+ @create_app_gateway = ::Gapic::Config::Method.new create_app_gateway_config
791
+ delete_app_gateway_config = parent_rpcs.delete_app_gateway if parent_rpcs.respond_to? :delete_app_gateway
792
+ @delete_app_gateway = ::Gapic::Config::Method.new delete_app_gateway_config
793
+
794
+ yield self if block_given?
795
+ end
796
+ end
797
+ end
798
+ end
799
+ end
800
+ end
801
+ end
802
+ end
803
+ end
804
+ end