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