google-cloud-beyond_corp-client_gateways-v1 0.1.0

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