google-cloud-beyond_corp-client_connector_services-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_connector_services/v1/client_connector_services_service/client.rb +919 -0
  7. data/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/credentials.rb +49 -0
  8. data/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/operations.rb +772 -0
  9. data/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/paths.rb +71 -0
  10. data/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service.rb +62 -0
  11. data/lib/google/cloud/beyond_corp/client_connector_services/v1/version.rb +30 -0
  12. data/lib/google/cloud/beyond_corp/client_connector_services/v1.rb +42 -0
  13. data/lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_pb.rb +129 -0
  14. data/lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_services_pb.rb +65 -0
  15. data/lib/google-cloud-beyond_corp-client_connector_services-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/clientconnectorservices/v1/client_connector_services_service.rb +336 -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,919 @@
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/clientconnectorservices/v1/client_connector_services_service_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module BeyondCorp
27
+ module ClientConnectorServices
28
+ module V1
29
+ module ClientConnectorServicesService
30
+ ##
31
+ # Client for the ClientConnectorServicesService 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 ClientConnectorServicesService exposes the following resources:
41
+ #
42
+ # * Client Connector Services, named as follows:
43
+ # `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
44
+ #
45
+ class Client
46
+ include Paths
47
+
48
+ # @private
49
+ attr_reader :client_connector_services_service_stub
50
+
51
+ ##
52
+ # Configure the ClientConnectorServicesService Client class.
53
+ #
54
+ # See {::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client::Configuration}
55
+ # for a description of the configuration fields.
56
+ #
57
+ # @example
58
+ #
59
+ # # Modify the configuration for all ClientConnectorServicesService clients
60
+ # ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::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", "ClientConnectorServices", "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 ClientConnectorServicesService 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::ClientConnectorServices::V1::ClientConnectorServicesService::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 ClientConnectorServicesService client object.
108
+ #
109
+ # @example
110
+ #
111
+ # # Create a client using the default configuration
112
+ # client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new
113
+ #
114
+ # # Create a client using a custom configuration
115
+ # client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new do |config|
116
+ # config.timeout = 10.0
117
+ # end
118
+ #
119
+ # @yield [config] Configure the ClientConnectorServicesService 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/clientconnectorservices/v1/client_connector_services_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_connector_services_service_stub = ::Gapic::ServiceStub.new(
168
+ ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::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::ClientConnectorServices::V1::ClientConnectorServicesService::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 ClientConnectorServices in a given project and location.
201
+ #
202
+ # @overload list_client_connector_services(request, options = nil)
203
+ # Pass arguments to `list_client_connector_services` via a request object, either of type
204
+ # {::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ListClientConnectorServicesRequest} or an equivalent Hash.
205
+ #
206
+ # @param request [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ListClientConnectorServicesRequest, ::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_connector_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
213
+ # Pass arguments to `list_client_connector_services` 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 ListClientConnectorServicesRequest.
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::ClientConnectorServices::V1::ClientConnectorService>]
231
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
232
+ #
233
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService>]
234
+ #
235
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
236
+ #
237
+ # @example Basic example
238
+ # require "google/cloud/beyond_corp/client_connector_services/v1"
239
+ #
240
+ # # Create a client object. The client can be reused for multiple calls.
241
+ # client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new
242
+ #
243
+ # # Create a request. To set request fields, pass in keyword arguments.
244
+ # request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ListClientConnectorServicesRequest.new
245
+ #
246
+ # # Call the list_client_connector_services method.
247
+ # result = client.list_client_connector_services 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::ClientConnectorServices::V1::ClientConnectorService.
255
+ # p response
256
+ # end
257
+ #
258
+ def list_client_connector_services request, options = nil
259
+ raise ::ArgumentError, "request must be provided" if request.nil?
260
+
261
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ListClientConnectorServicesRequest
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_connector_services.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::ClientConnectorServices::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_connector_services.timeout,
284
+ metadata: metadata,
285
+ retry_policy: @config.rpcs.list_client_connector_services.retry_policy
286
+
287
+ options.apply_defaults timeout: @config.timeout,
288
+ metadata: @config.metadata,
289
+ retry_policy: @config.retry_policy
290
+
291
+ @client_connector_services_service_stub.call_rpc :list_client_connector_services, request, options: options do |response, operation|
292
+ response = ::Gapic::PagedEnumerable.new @client_connector_services_service_stub, :list_client_connector_services, 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 ClientConnectorService.
302
+ #
303
+ # @overload get_client_connector_service(request, options = nil)
304
+ # Pass arguments to `get_client_connector_service` via a request object, either of type
305
+ # {::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::GetClientConnectorServiceRequest} or an equivalent Hash.
306
+ #
307
+ # @param request [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::GetClientConnectorServiceRequest, ::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_connector_service(name: nil)
314
+ # Pass arguments to `get_client_connector_service` 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::ClientConnectorServices::V1::ClientConnectorService]
323
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
324
+ #
325
+ # @return [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService]
326
+ #
327
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
328
+ #
329
+ # @example Basic example
330
+ # require "google/cloud/beyond_corp/client_connector_services/v1"
331
+ #
332
+ # # Create a client object. The client can be reused for multiple calls.
333
+ # client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new
334
+ #
335
+ # # Create a request. To set request fields, pass in keyword arguments.
336
+ # request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::GetClientConnectorServiceRequest.new
337
+ #
338
+ # # Call the get_client_connector_service method.
339
+ # result = client.get_client_connector_service request
340
+ #
341
+ # # The returned object is of type Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService.
342
+ # p result
343
+ #
344
+ def get_client_connector_service request, options = nil
345
+ raise ::ArgumentError, "request must be provided" if request.nil?
346
+
347
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::GetClientConnectorServiceRequest
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_connector_service.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::ClientConnectorServices::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_connector_service.timeout,
370
+ metadata: metadata,
371
+ retry_policy: @config.rpcs.get_client_connector_service.retry_policy
372
+
373
+ options.apply_defaults timeout: @config.timeout,
374
+ metadata: @config.metadata,
375
+ retry_policy: @config.retry_policy
376
+
377
+ @client_connector_services_service_stub.call_rpc :get_client_connector_service, 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 ClientConnectorService in a given project and location.
387
+ #
388
+ # @overload create_client_connector_service(request, options = nil)
389
+ # Pass arguments to `create_client_connector_service` via a request object, either of type
390
+ # {::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::CreateClientConnectorServiceRequest} or an equivalent Hash.
391
+ #
392
+ # @param request [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::CreateClientConnectorServiceRequest, ::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_connector_service(parent: nil, client_connector_service_id: nil, client_connector_service: nil, request_id: nil, validate_only: nil)
399
+ # Pass arguments to `create_client_connector_service` 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_connector_service_id [::String]
406
+ # Optional. User-settable client connector service 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
+ #
411
+ # A random system generated name will be assigned
412
+ # if not specified by the user.
413
+ # @param client_connector_service [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService, ::Hash]
414
+ # Required. The resource being created.
415
+ # @param request_id [::String]
416
+ # Optional. An optional request ID to identify requests. Specify a unique
417
+ # request ID so that if you must retry your request, the server will know to
418
+ # ignore the request if it has already been completed. The server will
419
+ # guarantee that for at least 60 minutes since the first request.
420
+ #
421
+ # For example, consider a situation where you make an initial request and t
422
+ # he request times out. If you make the request again with the same request
423
+ # ID, the server can check if original operation with the same request ID
424
+ # was received, and if so, will ignore the second request. This prevents
425
+ # clients from accidentally creating duplicate commitments.
426
+ #
427
+ # The request ID must be a valid UUID with the exception that zero UUID is
428
+ # not supported (00000000-0000-0000-0000-000000000000).
429
+ # @param validate_only [::Boolean]
430
+ # Optional. If set, validates request by executing a dry-run which would not
431
+ # alter the resource in any way.
432
+ #
433
+ # @yield [response, operation] Access the result along with the RPC operation
434
+ # @yieldparam response [::Gapic::Operation]
435
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
436
+ #
437
+ # @return [::Gapic::Operation]
438
+ #
439
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
440
+ #
441
+ # @example Basic example
442
+ # require "google/cloud/beyond_corp/client_connector_services/v1"
443
+ #
444
+ # # Create a client object. The client can be reused for multiple calls.
445
+ # client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new
446
+ #
447
+ # # Create a request. To set request fields, pass in keyword arguments.
448
+ # request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::CreateClientConnectorServiceRequest.new
449
+ #
450
+ # # Call the create_client_connector_service method.
451
+ # result = client.create_client_connector_service request
452
+ #
453
+ # # The returned object is of type Gapic::Operation. You can use this
454
+ # # object to check the status of an operation, cancel it, or wait
455
+ # # for results. Here is how to block until completion:
456
+ # result.wait_until_done! timeout: 60
457
+ # if result.response?
458
+ # p result.response
459
+ # else
460
+ # puts "Error!"
461
+ # end
462
+ #
463
+ def create_client_connector_service request, options = nil
464
+ raise ::ArgumentError, "request must be provided" if request.nil?
465
+
466
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::CreateClientConnectorServiceRequest
467
+
468
+ # Converts hash and nil to an options object
469
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
470
+
471
+ # Customize the options with defaults
472
+ metadata = @config.rpcs.create_client_connector_service.metadata.to_h
473
+
474
+ # Set x-goog-api-client and x-goog-user-project headers
475
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
476
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
477
+ gapic_version: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::VERSION
478
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
479
+
480
+ header_params = {}
481
+ if request.parent
482
+ header_params["parent"] = request.parent
483
+ end
484
+
485
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
486
+ metadata[:"x-goog-request-params"] ||= request_params_header
487
+
488
+ options.apply_defaults timeout: @config.rpcs.create_client_connector_service.timeout,
489
+ metadata: metadata,
490
+ retry_policy: @config.rpcs.create_client_connector_service.retry_policy
491
+
492
+ options.apply_defaults timeout: @config.timeout,
493
+ metadata: @config.metadata,
494
+ retry_policy: @config.retry_policy
495
+
496
+ @client_connector_services_service_stub.call_rpc :create_client_connector_service, request, options: options do |response, operation|
497
+ response = ::Gapic::Operation.new response, @operations_client, options: options
498
+ yield response, operation if block_given?
499
+ return response
500
+ end
501
+ rescue ::GRPC::BadStatus => e
502
+ raise ::Google::Cloud::Error.from_error(e)
503
+ end
504
+
505
+ ##
506
+ # Updates the parameters of a single ClientConnectorService.
507
+ #
508
+ # @overload update_client_connector_service(request, options = nil)
509
+ # Pass arguments to `update_client_connector_service` via a request object, either of type
510
+ # {::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::UpdateClientConnectorServiceRequest} or an equivalent Hash.
511
+ #
512
+ # @param request [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::UpdateClientConnectorServiceRequest, ::Hash]
513
+ # A request object representing the call parameters. Required. To specify no
514
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
515
+ # @param options [::Gapic::CallOptions, ::Hash]
516
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
517
+ #
518
+ # @overload update_client_connector_service(update_mask: nil, client_connector_service: nil, request_id: nil, validate_only: nil, allow_missing: nil)
519
+ # Pass arguments to `update_client_connector_service` via keyword arguments. Note that at
520
+ # least one keyword argument is required. To specify no parameters, or to keep all
521
+ # the default parameter values, pass an empty Hash as a request object (see above).
522
+ #
523
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
524
+ # Required. Field mask is used to specify the fields to be overwritten in the
525
+ # ClientConnectorService resource by the update.
526
+ # The fields specified in the update_mask are relative to the resource, not
527
+ # the full request. A field will be overwritten if it is in the mask. If the
528
+ # user does not provide a mask then all fields will be overwritten.
529
+ #
530
+ # Mutable fields: display_name.
531
+ # @param client_connector_service [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService, ::Hash]
532
+ # Required. The resource being updated.
533
+ # @param request_id [::String]
534
+ # Optional. An optional request ID to identify requests. Specify a unique
535
+ # request ID so that if you must retry your request, the server will know to
536
+ # ignore the request if it has already been completed. The server will
537
+ # guarantee that for at least 60 minutes since the first request.
538
+ #
539
+ # For example, consider a situation where you make an initial request and t
540
+ # he request times out. If you make the request again with the same request
541
+ # ID, the server can check if original operation with the same request ID
542
+ # was received, and if so, will ignore the second request. This prevents
543
+ # clients from accidentally creating duplicate commitments.
544
+ #
545
+ # The request ID must be a valid UUID with the exception that zero UUID is
546
+ # not supported (00000000-0000-0000-0000-000000000000).
547
+ # @param validate_only [::Boolean]
548
+ # Optional. If set, validates request by executing a dry-run which would not
549
+ # alter the resource in any way.
550
+ # @param allow_missing [::Boolean]
551
+ # Optional. If set as true, will create the resource if it is not found.
552
+ #
553
+ # @yield [response, operation] Access the result along with the RPC operation
554
+ # @yieldparam response [::Gapic::Operation]
555
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
556
+ #
557
+ # @return [::Gapic::Operation]
558
+ #
559
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
560
+ #
561
+ # @example Basic example
562
+ # require "google/cloud/beyond_corp/client_connector_services/v1"
563
+ #
564
+ # # Create a client object. The client can be reused for multiple calls.
565
+ # client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new
566
+ #
567
+ # # Create a request. To set request fields, pass in keyword arguments.
568
+ # request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::UpdateClientConnectorServiceRequest.new
569
+ #
570
+ # # Call the update_client_connector_service method.
571
+ # result = client.update_client_connector_service request
572
+ #
573
+ # # The returned object is of type Gapic::Operation. You can use this
574
+ # # object to check the status of an operation, cancel it, or wait
575
+ # # for results. Here is how to block until completion:
576
+ # result.wait_until_done! timeout: 60
577
+ # if result.response?
578
+ # p result.response
579
+ # else
580
+ # puts "Error!"
581
+ # end
582
+ #
583
+ def update_client_connector_service request, options = nil
584
+ raise ::ArgumentError, "request must be provided" if request.nil?
585
+
586
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::UpdateClientConnectorServiceRequest
587
+
588
+ # Converts hash and nil to an options object
589
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
590
+
591
+ # Customize the options with defaults
592
+ metadata = @config.rpcs.update_client_connector_service.metadata.to_h
593
+
594
+ # Set x-goog-api-client and x-goog-user-project headers
595
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
596
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
597
+ gapic_version: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::VERSION
598
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
599
+
600
+ header_params = {}
601
+ if request.client_connector_service&.name
602
+ header_params["client_connector_service.name"] = request.client_connector_service.name
603
+ end
604
+
605
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
606
+ metadata[:"x-goog-request-params"] ||= request_params_header
607
+
608
+ options.apply_defaults timeout: @config.rpcs.update_client_connector_service.timeout,
609
+ metadata: metadata,
610
+ retry_policy: @config.rpcs.update_client_connector_service.retry_policy
611
+
612
+ options.apply_defaults timeout: @config.timeout,
613
+ metadata: @config.metadata,
614
+ retry_policy: @config.retry_policy
615
+
616
+ @client_connector_services_service_stub.call_rpc :update_client_connector_service, request, options: options do |response, operation|
617
+ response = ::Gapic::Operation.new response, @operations_client, options: options
618
+ yield response, operation if block_given?
619
+ return response
620
+ end
621
+ rescue ::GRPC::BadStatus => e
622
+ raise ::Google::Cloud::Error.from_error(e)
623
+ end
624
+
625
+ ##
626
+ # Deletes a single ClientConnectorService.
627
+ #
628
+ # @overload delete_client_connector_service(request, options = nil)
629
+ # Pass arguments to `delete_client_connector_service` via a request object, either of type
630
+ # {::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::DeleteClientConnectorServiceRequest} or an equivalent Hash.
631
+ #
632
+ # @param request [::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::DeleteClientConnectorServiceRequest, ::Hash]
633
+ # A request object representing the call parameters. Required. To specify no
634
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
635
+ # @param options [::Gapic::CallOptions, ::Hash]
636
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
637
+ #
638
+ # @overload delete_client_connector_service(name: nil, request_id: nil, validate_only: nil)
639
+ # Pass arguments to `delete_client_connector_service` via keyword arguments. Note that at
640
+ # least one keyword argument is required. To specify no parameters, or to keep all
641
+ # the default parameter values, pass an empty Hash as a request object (see above).
642
+ #
643
+ # @param name [::String]
644
+ # Required. Name of the resource.
645
+ # @param request_id [::String]
646
+ # Optional. An optional request ID to identify requests. Specify a unique
647
+ # request ID so that if you must retry your request, the server will know to
648
+ # ignore the request if it has already been completed. The server will
649
+ # guarantee that for at least 60 minutes after the first request.
650
+ #
651
+ # For example, consider a situation where you make an initial request and t
652
+ # he request times out. If you make the request again with the same request
653
+ # ID, the server can check if original operation with the same request ID
654
+ # was received, and if so, will ignore the second request. This prevents
655
+ # clients from accidentally creating duplicate commitments.
656
+ #
657
+ # The request ID must be a valid UUID with the exception that zero UUID is
658
+ # not supported (00000000-0000-0000-0000-000000000000).
659
+ # @param validate_only [::Boolean]
660
+ # Optional. If set, validates request by executing a dry-run which would not
661
+ # alter the resource in any way.
662
+ #
663
+ # @yield [response, operation] Access the result along with the RPC operation
664
+ # @yieldparam response [::Gapic::Operation]
665
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
666
+ #
667
+ # @return [::Gapic::Operation]
668
+ #
669
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
670
+ #
671
+ # @example Basic example
672
+ # require "google/cloud/beyond_corp/client_connector_services/v1"
673
+ #
674
+ # # Create a client object. The client can be reused for multiple calls.
675
+ # client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new
676
+ #
677
+ # # Create a request. To set request fields, pass in keyword arguments.
678
+ # request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::DeleteClientConnectorServiceRequest.new
679
+ #
680
+ # # Call the delete_client_connector_service method.
681
+ # result = client.delete_client_connector_service request
682
+ #
683
+ # # The returned object is of type Gapic::Operation. You can use this
684
+ # # object to check the status of an operation, cancel it, or wait
685
+ # # for results. Here is how to block until completion:
686
+ # result.wait_until_done! timeout: 60
687
+ # if result.response?
688
+ # p result.response
689
+ # else
690
+ # puts "Error!"
691
+ # end
692
+ #
693
+ def delete_client_connector_service request, options = nil
694
+ raise ::ArgumentError, "request must be provided" if request.nil?
695
+
696
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::DeleteClientConnectorServiceRequest
697
+
698
+ # Converts hash and nil to an options object
699
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
700
+
701
+ # Customize the options with defaults
702
+ metadata = @config.rpcs.delete_client_connector_service.metadata.to_h
703
+
704
+ # Set x-goog-api-client and x-goog-user-project headers
705
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
706
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
707
+ gapic_version: ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::VERSION
708
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
709
+
710
+ header_params = {}
711
+ if request.name
712
+ header_params["name"] = request.name
713
+ end
714
+
715
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
716
+ metadata[:"x-goog-request-params"] ||= request_params_header
717
+
718
+ options.apply_defaults timeout: @config.rpcs.delete_client_connector_service.timeout,
719
+ metadata: metadata,
720
+ retry_policy: @config.rpcs.delete_client_connector_service.retry_policy
721
+
722
+ options.apply_defaults timeout: @config.timeout,
723
+ metadata: @config.metadata,
724
+ retry_policy: @config.retry_policy
725
+
726
+ @client_connector_services_service_stub.call_rpc :delete_client_connector_service, request, options: options do |response, operation|
727
+ response = ::Gapic::Operation.new response, @operations_client, options: options
728
+ yield response, operation if block_given?
729
+ return response
730
+ end
731
+ rescue ::GRPC::BadStatus => e
732
+ raise ::Google::Cloud::Error.from_error(e)
733
+ end
734
+
735
+ ##
736
+ # Configuration class for the ClientConnectorServicesService API.
737
+ #
738
+ # This class represents the configuration for ClientConnectorServicesService,
739
+ # providing control over timeouts, retry behavior, logging, transport
740
+ # parameters, and other low-level controls. Certain parameters can also be
741
+ # applied individually to specific RPCs. See
742
+ # {::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client::Configuration::Rpcs}
743
+ # for a list of RPCs that can be configured independently.
744
+ #
745
+ # Configuration can be applied globally to all clients, or to a single client
746
+ # on construction.
747
+ #
748
+ # @example
749
+ #
750
+ # # Modify the global config, setting the timeout for
751
+ # # list_client_connector_services to 20 seconds,
752
+ # # and all remaining timeouts to 10 seconds.
753
+ # ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.configure do |config|
754
+ # config.timeout = 10.0
755
+ # config.rpcs.list_client_connector_services.timeout = 20.0
756
+ # end
757
+ #
758
+ # # Apply the above configuration only to a new client.
759
+ # client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new do |config|
760
+ # config.timeout = 10.0
761
+ # config.rpcs.list_client_connector_services.timeout = 20.0
762
+ # end
763
+ #
764
+ # @!attribute [rw] endpoint
765
+ # The hostname or hostname:port of the service endpoint.
766
+ # Defaults to `"beyondcorp.googleapis.com"`.
767
+ # @return [::String]
768
+ # @!attribute [rw] credentials
769
+ # Credentials to send with calls. You may provide any of the following types:
770
+ # * (`String`) The path to a service account key file in JSON format
771
+ # * (`Hash`) A service account key as a Hash
772
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
773
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
774
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
775
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
776
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
777
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
778
+ # * (`nil`) indicating no credentials
779
+ # @return [::Object]
780
+ # @!attribute [rw] scope
781
+ # The OAuth scopes
782
+ # @return [::Array<::String>]
783
+ # @!attribute [rw] lib_name
784
+ # The library name as recorded in instrumentation and logging
785
+ # @return [::String]
786
+ # @!attribute [rw] lib_version
787
+ # The library version as recorded in instrumentation and logging
788
+ # @return [::String]
789
+ # @!attribute [rw] channel_args
790
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
791
+ # `GRPC::Core::Channel` object is provided as the credential.
792
+ # @return [::Hash]
793
+ # @!attribute [rw] interceptors
794
+ # An array of interceptors that are run before calls are executed.
795
+ # @return [::Array<::GRPC::ClientInterceptor>]
796
+ # @!attribute [rw] timeout
797
+ # The call timeout in seconds.
798
+ # @return [::Numeric]
799
+ # @!attribute [rw] metadata
800
+ # Additional gRPC headers to be sent with the call.
801
+ # @return [::Hash{::Symbol=>::String}]
802
+ # @!attribute [rw] retry_policy
803
+ # The retry policy. The value is a hash with the following keys:
804
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
805
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
806
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
807
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
808
+ # trigger a retry.
809
+ # @return [::Hash]
810
+ # @!attribute [rw] quota_project
811
+ # A separate project against which to charge quota.
812
+ # @return [::String]
813
+ #
814
+ class Configuration
815
+ extend ::Gapic::Config
816
+
817
+ config_attr :endpoint, "beyondcorp.googleapis.com", ::String
818
+ config_attr :credentials, nil do |value|
819
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
820
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
821
+ allowed.any? { |klass| klass === value }
822
+ end
823
+ config_attr :scope, nil, ::String, ::Array, nil
824
+ config_attr :lib_name, nil, ::String, nil
825
+ config_attr :lib_version, nil, ::String, nil
826
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
827
+ config_attr :interceptors, nil, ::Array, nil
828
+ config_attr :timeout, nil, ::Numeric, nil
829
+ config_attr :metadata, nil, ::Hash, nil
830
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
831
+ config_attr :quota_project, nil, ::String, nil
832
+
833
+ # @private
834
+ def initialize parent_config = nil
835
+ @parent_config = parent_config unless parent_config.nil?
836
+
837
+ yield self if block_given?
838
+ end
839
+
840
+ ##
841
+ # Configurations for individual RPCs
842
+ # @return [Rpcs]
843
+ #
844
+ def rpcs
845
+ @rpcs ||= begin
846
+ parent_rpcs = nil
847
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
848
+ Rpcs.new parent_rpcs
849
+ end
850
+ end
851
+
852
+ ##
853
+ # Configuration RPC class for the ClientConnectorServicesService API.
854
+ #
855
+ # Includes fields providing the configuration for each RPC in this service.
856
+ # Each configuration object is of type `Gapic::Config::Method` and includes
857
+ # the following configuration fields:
858
+ #
859
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
860
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
861
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
862
+ # include the following keys:
863
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
864
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
865
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
866
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
867
+ # trigger a retry.
868
+ #
869
+ class Rpcs
870
+ ##
871
+ # RPC-specific configuration for `list_client_connector_services`
872
+ # @return [::Gapic::Config::Method]
873
+ #
874
+ attr_reader :list_client_connector_services
875
+ ##
876
+ # RPC-specific configuration for `get_client_connector_service`
877
+ # @return [::Gapic::Config::Method]
878
+ #
879
+ attr_reader :get_client_connector_service
880
+ ##
881
+ # RPC-specific configuration for `create_client_connector_service`
882
+ # @return [::Gapic::Config::Method]
883
+ #
884
+ attr_reader :create_client_connector_service
885
+ ##
886
+ # RPC-specific configuration for `update_client_connector_service`
887
+ # @return [::Gapic::Config::Method]
888
+ #
889
+ attr_reader :update_client_connector_service
890
+ ##
891
+ # RPC-specific configuration for `delete_client_connector_service`
892
+ # @return [::Gapic::Config::Method]
893
+ #
894
+ attr_reader :delete_client_connector_service
895
+
896
+ # @private
897
+ def initialize parent_rpcs = nil
898
+ list_client_connector_services_config = parent_rpcs.list_client_connector_services if parent_rpcs.respond_to? :list_client_connector_services
899
+ @list_client_connector_services = ::Gapic::Config::Method.new list_client_connector_services_config
900
+ get_client_connector_service_config = parent_rpcs.get_client_connector_service if parent_rpcs.respond_to? :get_client_connector_service
901
+ @get_client_connector_service = ::Gapic::Config::Method.new get_client_connector_service_config
902
+ create_client_connector_service_config = parent_rpcs.create_client_connector_service if parent_rpcs.respond_to? :create_client_connector_service
903
+ @create_client_connector_service = ::Gapic::Config::Method.new create_client_connector_service_config
904
+ update_client_connector_service_config = parent_rpcs.update_client_connector_service if parent_rpcs.respond_to? :update_client_connector_service
905
+ @update_client_connector_service = ::Gapic::Config::Method.new update_client_connector_service_config
906
+ delete_client_connector_service_config = parent_rpcs.delete_client_connector_service if parent_rpcs.respond_to? :delete_client_connector_service
907
+ @delete_client_connector_service = ::Gapic::Config::Method.new delete_client_connector_service_config
908
+
909
+ yield self if block_given?
910
+ end
911
+ end
912
+ end
913
+ end
914
+ end
915
+ end
916
+ end
917
+ end
918
+ end
919
+ end