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