google-cloud-cloud_security_compliance-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.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +154 -8
- data/lib/google/cloud/cloud_security_compliance/v1/bindings_override.rb +75 -0
- data/lib/google/cloud/cloud_security_compliance/v1/config/client.rb +1467 -0
- data/lib/google/cloud/cloud_security_compliance/v1/config/credentials.rb +47 -0
- data/lib/google/cloud/cloud_security_compliance/v1/config/paths.rb +88 -0
- data/lib/google/cloud/cloud_security_compliance/v1/config/rest/client.rb +1379 -0
- data/lib/google/cloud/cloud_security_compliance/v1/config/rest/service_stub.rb +695 -0
- data/lib/google/cloud/cloud_security_compliance/v1/config/rest.rb +54 -0
- data/lib/google/cloud/cloud_security_compliance/v1/config.rb +56 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/client.rb +1047 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/credentials.rb +47 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/operations.rb +824 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/paths.rb +88 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/rest/client.rb +987 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/rest/operations.rb +925 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/rest/service_stub.rb +448 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment/rest.rb +55 -0
- data/lib/google/cloud/cloud_security_compliance/v1/deployment.rb +57 -0
- data/lib/google/cloud/cloud_security_compliance/v1/rest.rb +39 -0
- data/lib/google/cloud/cloud_security_compliance/v1/version.rb +7 -2
- data/lib/google/cloud/cloud_security_compliance/v1.rb +46 -0
- data/lib/google/cloud/cloudsecuritycompliance/v1/common_pb.rb +73 -0
- data/lib/google/cloud/cloudsecuritycompliance/v1/config_pb.rb +63 -0
- data/lib/google/cloud/cloudsecuritycompliance/v1/config_services_pb.rb +117 -0
- data/lib/google/cloud/cloudsecuritycompliance/v1/deployment_pb.rb +70 -0
- data/lib/google/cloud/cloudsecuritycompliance/v1/deployment_services_pb.rb +56 -0
- data/lib/google-cloud-cloud_security_compliance-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +473 -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 +227 -0
- data/proto_docs/google/cloud/cloudsecuritycompliance/v1/common.rb +638 -0
- data/proto_docs/google/cloud/cloudsecuritycompliance/v1/config.rb +223 -0
- data/proto_docs/google/cloud/cloudsecuritycompliance/v1/deployment.rb +429 -0
- data/proto_docs/google/longrunning/operations.rb +191 -0
- data/proto_docs/google/protobuf/any.rb +145 -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
- metadata +93 -9
@@ -0,0 +1,1467 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2025 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/cloudsecuritycompliance/v1/config_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module CloudSecurityCompliance
|
26
|
+
module V1
|
27
|
+
module Config
|
28
|
+
##
|
29
|
+
# Client for the Config service.
|
30
|
+
#
|
31
|
+
# Config Service manages compliance frameworks, cloud controls, and their
|
32
|
+
# configurations.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
API_VERSION = ""
|
37
|
+
|
38
|
+
# @private
|
39
|
+
DEFAULT_ENDPOINT_TEMPLATE = "cloudsecuritycompliance.$UNIVERSE_DOMAIN$"
|
40
|
+
|
41
|
+
include Paths
|
42
|
+
|
43
|
+
# @private
|
44
|
+
attr_reader :config_stub
|
45
|
+
|
46
|
+
##
|
47
|
+
# Configure the Config Client class.
|
48
|
+
#
|
49
|
+
# See {::Google::Cloud::CloudSecurityCompliance::V1::Config::Client::Configuration}
|
50
|
+
# for a description of the configuration fields.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
#
|
54
|
+
# # Modify the configuration for all Config clients
|
55
|
+
# ::Google::Cloud::CloudSecurityCompliance::V1::Config::Client.configure do |config|
|
56
|
+
# config.timeout = 10.0
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# @yield [config] Configure the Client client.
|
60
|
+
# @yieldparam config [Client::Configuration]
|
61
|
+
#
|
62
|
+
# @return [Client::Configuration]
|
63
|
+
#
|
64
|
+
def self.configure
|
65
|
+
@configure ||= begin
|
66
|
+
namespace = ["Google", "Cloud", "CloudSecurityCompliance", "V1"]
|
67
|
+
parent_config = while namespace.any?
|
68
|
+
parent_name = namespace.join "::"
|
69
|
+
parent_const = const_get parent_name
|
70
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
71
|
+
namespace.pop
|
72
|
+
end
|
73
|
+
default_config = Client::Configuration.new parent_config
|
74
|
+
|
75
|
+
default_config.rpcs.list_frameworks.timeout = 60.0
|
76
|
+
default_config.rpcs.list_frameworks.retry_policy = {
|
77
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
78
|
+
}
|
79
|
+
|
80
|
+
default_config.rpcs.get_framework.timeout = 60.0
|
81
|
+
default_config.rpcs.get_framework.retry_policy = {
|
82
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
83
|
+
}
|
84
|
+
|
85
|
+
default_config.rpcs.create_framework.timeout = 60.0
|
86
|
+
|
87
|
+
default_config.rpcs.update_framework.timeout = 60.0
|
88
|
+
|
89
|
+
default_config.rpcs.delete_framework.timeout = 60.0
|
90
|
+
|
91
|
+
default_config.rpcs.list_cloud_controls.timeout = 60.0
|
92
|
+
default_config.rpcs.list_cloud_controls.retry_policy = {
|
93
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
94
|
+
}
|
95
|
+
|
96
|
+
default_config.rpcs.get_cloud_control.timeout = 60.0
|
97
|
+
default_config.rpcs.get_cloud_control.retry_policy = {
|
98
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
99
|
+
}
|
100
|
+
|
101
|
+
default_config.rpcs.create_cloud_control.timeout = 60.0
|
102
|
+
|
103
|
+
default_config.rpcs.update_cloud_control.timeout = 60.0
|
104
|
+
|
105
|
+
default_config.rpcs.delete_cloud_control.timeout = 60.0
|
106
|
+
|
107
|
+
default_config
|
108
|
+
end
|
109
|
+
yield @configure if block_given?
|
110
|
+
@configure
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Configure the Config Client instance.
|
115
|
+
#
|
116
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
117
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
118
|
+
# should be made on {Client.configure}.
|
119
|
+
#
|
120
|
+
# See {::Google::Cloud::CloudSecurityCompliance::V1::Config::Client::Configuration}
|
121
|
+
# for a description of the configuration fields.
|
122
|
+
#
|
123
|
+
# @yield [config] Configure the Client client.
|
124
|
+
# @yieldparam config [Client::Configuration]
|
125
|
+
#
|
126
|
+
# @return [Client::Configuration]
|
127
|
+
#
|
128
|
+
def configure
|
129
|
+
yield @config if block_given?
|
130
|
+
@config
|
131
|
+
end
|
132
|
+
|
133
|
+
##
|
134
|
+
# The effective universe domain
|
135
|
+
#
|
136
|
+
# @return [String]
|
137
|
+
#
|
138
|
+
def universe_domain
|
139
|
+
@config_stub.universe_domain
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# Create a new Config client object.
|
144
|
+
#
|
145
|
+
# @example
|
146
|
+
#
|
147
|
+
# # Create a client using the default configuration
|
148
|
+
# client = ::Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
149
|
+
#
|
150
|
+
# # Create a client using a custom configuration
|
151
|
+
# client = ::Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new do |config|
|
152
|
+
# config.timeout = 10.0
|
153
|
+
# end
|
154
|
+
#
|
155
|
+
# @yield [config] Configure the Config client.
|
156
|
+
# @yieldparam config [Client::Configuration]
|
157
|
+
#
|
158
|
+
def initialize
|
159
|
+
# These require statements are intentionally placed here to initialize
|
160
|
+
# the gRPC module only when it's required.
|
161
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
162
|
+
require "gapic/grpc"
|
163
|
+
require "google/cloud/cloudsecuritycompliance/v1/config_services_pb"
|
164
|
+
|
165
|
+
# Create the configuration object
|
166
|
+
@config = Configuration.new Client.configure
|
167
|
+
|
168
|
+
# Yield the configuration if needed
|
169
|
+
yield @config if block_given?
|
170
|
+
|
171
|
+
# Create credentials
|
172
|
+
credentials = @config.credentials
|
173
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
174
|
+
# but only if the default endpoint does not have a region prefix.
|
175
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
176
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
177
|
+
!@config.endpoint.split(".").first.include?("-"))
|
178
|
+
credentials ||= Credentials.default scope: @config.scope,
|
179
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
180
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
181
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
182
|
+
end
|
183
|
+
@quota_project_id = @config.quota_project
|
184
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
185
|
+
|
186
|
+
@config_stub = ::Gapic::ServiceStub.new(
|
187
|
+
::Google::Cloud::CloudSecurityCompliance::V1::Config::Stub,
|
188
|
+
credentials: credentials,
|
189
|
+
endpoint: @config.endpoint,
|
190
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
191
|
+
universe_domain: @config.universe_domain,
|
192
|
+
channel_args: @config.channel_args,
|
193
|
+
interceptors: @config.interceptors,
|
194
|
+
channel_pool_config: @config.channel_pool,
|
195
|
+
logger: @config.logger
|
196
|
+
)
|
197
|
+
|
198
|
+
@config_stub.stub_logger&.info do |entry|
|
199
|
+
entry.set_system_name
|
200
|
+
entry.set_service
|
201
|
+
entry.message = "Created client for #{entry.service}"
|
202
|
+
entry.set_credentials_fields credentials
|
203
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
204
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
205
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
206
|
+
end
|
207
|
+
|
208
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
209
|
+
config.credentials = credentials
|
210
|
+
config.quota_project = @quota_project_id
|
211
|
+
config.endpoint = @config_stub.endpoint
|
212
|
+
config.universe_domain = @config_stub.universe_domain
|
213
|
+
config.logger = @config_stub.logger if config.respond_to? :logger=
|
214
|
+
end
|
215
|
+
end
|
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
|
+
# The logger used for request/response debug logging.
|
226
|
+
#
|
227
|
+
# @return [Logger]
|
228
|
+
#
|
229
|
+
def logger
|
230
|
+
@config_stub.logger
|
231
|
+
end
|
232
|
+
|
233
|
+
# Service calls
|
234
|
+
|
235
|
+
##
|
236
|
+
# Lists all Frameworks (both Built-in and Custom) available within a given
|
237
|
+
# parent resource. This method supports pagination.
|
238
|
+
# The latest major version of each Framework is returned.
|
239
|
+
#
|
240
|
+
# @overload list_frameworks(request, options = nil)
|
241
|
+
# Pass arguments to `list_frameworks` via a request object, either of type
|
242
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::ListFrameworksRequest} or an equivalent Hash.
|
243
|
+
#
|
244
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::ListFrameworksRequest, ::Hash]
|
245
|
+
# A request object representing the call parameters. Required. To specify no
|
246
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
247
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
248
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
249
|
+
#
|
250
|
+
# @overload list_frameworks(parent: nil, page_size: nil, page_token: nil)
|
251
|
+
# Pass arguments to `list_frameworks` via keyword arguments. Note that at
|
252
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
253
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
254
|
+
#
|
255
|
+
# @param parent [::String]
|
256
|
+
# Required. The parent resource name, in the format
|
257
|
+
# `organizations/{organization}/locations/{location}`.
|
258
|
+
# Only global location is supported.
|
259
|
+
# @param page_size [::Integer]
|
260
|
+
# Optional. The maximum number of frameworks to return. The default value is
|
261
|
+
# `500`.
|
262
|
+
#
|
263
|
+
# If you exceed the maximum value of `1000`, then the service uses the
|
264
|
+
# maximum value.
|
265
|
+
# @param page_token [::String]
|
266
|
+
# Optional. A pagination token returned from a previous request to list
|
267
|
+
# frameworks. Provide this token to retrieve the next page of results.
|
268
|
+
#
|
269
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
270
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::Framework>]
|
271
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
272
|
+
#
|
273
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::Framework>]
|
274
|
+
#
|
275
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
276
|
+
#
|
277
|
+
# @example Basic example
|
278
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
279
|
+
#
|
280
|
+
# # Create a client object. The client can be reused for multiple calls.
|
281
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
282
|
+
#
|
283
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
284
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::ListFrameworksRequest.new
|
285
|
+
#
|
286
|
+
# # Call the list_frameworks method.
|
287
|
+
# result = client.list_frameworks request
|
288
|
+
#
|
289
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
290
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
291
|
+
# result.each do |item|
|
292
|
+
# # Each element is of type ::Google::Cloud::CloudSecurityCompliance::V1::Framework.
|
293
|
+
# p item
|
294
|
+
# end
|
295
|
+
#
|
296
|
+
def list_frameworks request, options = nil
|
297
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
298
|
+
|
299
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::ListFrameworksRequest
|
300
|
+
|
301
|
+
# Converts hash and nil to an options object
|
302
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
303
|
+
|
304
|
+
# Customize the options with defaults
|
305
|
+
metadata = @config.rpcs.list_frameworks.metadata.to_h
|
306
|
+
|
307
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
308
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
309
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
310
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
311
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
312
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
313
|
+
|
314
|
+
header_params = {}
|
315
|
+
if request.parent
|
316
|
+
header_params["parent"] = request.parent
|
317
|
+
end
|
318
|
+
|
319
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
320
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
321
|
+
|
322
|
+
options.apply_defaults timeout: @config.rpcs.list_frameworks.timeout,
|
323
|
+
metadata: metadata,
|
324
|
+
retry_policy: @config.rpcs.list_frameworks.retry_policy
|
325
|
+
|
326
|
+
options.apply_defaults timeout: @config.timeout,
|
327
|
+
metadata: @config.metadata,
|
328
|
+
retry_policy: @config.retry_policy
|
329
|
+
|
330
|
+
@config_stub.call_rpc :list_frameworks, request, options: options do |response, operation|
|
331
|
+
response = ::Gapic::PagedEnumerable.new @config_stub, :list_frameworks, request, response, operation, options
|
332
|
+
yield response, operation if block_given?
|
333
|
+
throw :response, response
|
334
|
+
end
|
335
|
+
rescue ::GRPC::BadStatus => e
|
336
|
+
raise ::Google::Cloud::Error.from_error(e)
|
337
|
+
end
|
338
|
+
|
339
|
+
##
|
340
|
+
# Gets details of a single Framework.
|
341
|
+
# This method retrieves a Framework resource, which can be either Built-in or
|
342
|
+
# Custom, identified by its name.
|
343
|
+
#
|
344
|
+
# By default, the latest major version of the Framework is returned.
|
345
|
+
# A specific major version can be retrieved by specifying the
|
346
|
+
# `major_revision_id` in the request.
|
347
|
+
#
|
348
|
+
# @overload get_framework(request, options = nil)
|
349
|
+
# Pass arguments to `get_framework` via a request object, either of type
|
350
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkRequest} or an equivalent Hash.
|
351
|
+
#
|
352
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkRequest, ::Hash]
|
353
|
+
# A request object representing the call parameters. Required. To specify no
|
354
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
355
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
356
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
357
|
+
#
|
358
|
+
# @overload get_framework(name: nil, major_revision_id: nil)
|
359
|
+
# Pass arguments to `get_framework` via keyword arguments. Note that at
|
360
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
361
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
362
|
+
#
|
363
|
+
# @param name [::String]
|
364
|
+
# Required. The name of the framework to retrieve.
|
365
|
+
# Format:
|
366
|
+
# organizations/\\{organization}/locations/\\{location}/frameworks/\\{framework_id}
|
367
|
+
# @param major_revision_id [::Integer]
|
368
|
+
# Optional. The Framework major version to retrieve. If not specified, the
|
369
|
+
# most recently updated revision_id is retrieved.
|
370
|
+
#
|
371
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
372
|
+
# @yieldparam response [::Google::Cloud::CloudSecurityCompliance::V1::Framework]
|
373
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
374
|
+
#
|
375
|
+
# @return [::Google::Cloud::CloudSecurityCompliance::V1::Framework]
|
376
|
+
#
|
377
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
378
|
+
#
|
379
|
+
# @example Basic example
|
380
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
381
|
+
#
|
382
|
+
# # Create a client object. The client can be reused for multiple calls.
|
383
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
384
|
+
#
|
385
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
386
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkRequest.new
|
387
|
+
#
|
388
|
+
# # Call the get_framework method.
|
389
|
+
# result = client.get_framework request
|
390
|
+
#
|
391
|
+
# # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::Framework.
|
392
|
+
# p result
|
393
|
+
#
|
394
|
+
def get_framework request, options = nil
|
395
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
396
|
+
|
397
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::GetFrameworkRequest
|
398
|
+
|
399
|
+
# Converts hash and nil to an options object
|
400
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
401
|
+
|
402
|
+
# Customize the options with defaults
|
403
|
+
metadata = @config.rpcs.get_framework.metadata.to_h
|
404
|
+
|
405
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
406
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
407
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
408
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
409
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
410
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
411
|
+
|
412
|
+
header_params = {}
|
413
|
+
if request.name
|
414
|
+
header_params["name"] = request.name
|
415
|
+
end
|
416
|
+
|
417
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
418
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
419
|
+
|
420
|
+
options.apply_defaults timeout: @config.rpcs.get_framework.timeout,
|
421
|
+
metadata: metadata,
|
422
|
+
retry_policy: @config.rpcs.get_framework.retry_policy
|
423
|
+
|
424
|
+
options.apply_defaults timeout: @config.timeout,
|
425
|
+
metadata: @config.metadata,
|
426
|
+
retry_policy: @config.retry_policy
|
427
|
+
|
428
|
+
@config_stub.call_rpc :get_framework, request, options: options do |response, operation|
|
429
|
+
yield response, operation if block_given?
|
430
|
+
end
|
431
|
+
rescue ::GRPC::BadStatus => e
|
432
|
+
raise ::Google::Cloud::Error.from_error(e)
|
433
|
+
end
|
434
|
+
|
435
|
+
##
|
436
|
+
# Creates a new Framework with type `Custom` under a given parent resource.
|
437
|
+
# Frameworks with type `Built-in` are managed by Google and cannot be created
|
438
|
+
# through this API.
|
439
|
+
#
|
440
|
+
# @overload create_framework(request, options = nil)
|
441
|
+
# Pass arguments to `create_framework` via a request object, either of type
|
442
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkRequest} or an equivalent Hash.
|
443
|
+
#
|
444
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkRequest, ::Hash]
|
445
|
+
# A request object representing the call parameters. Required. To specify no
|
446
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
447
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
448
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
449
|
+
#
|
450
|
+
# @overload create_framework(parent: nil, framework_id: nil, framework: nil)
|
451
|
+
# Pass arguments to `create_framework` via keyword arguments. Note that at
|
452
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
453
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
454
|
+
#
|
455
|
+
# @param parent [::String]
|
456
|
+
# Required. The parent resource name, in the format
|
457
|
+
# `organizations/{organization}/locations/{location}`.
|
458
|
+
# @param framework_id [::String]
|
459
|
+
# Required. ID of the framework.
|
460
|
+
# This is not the full name of the framework.
|
461
|
+
# This is the last part of the full name of the framework.
|
462
|
+
# @param framework [::Google::Cloud::CloudSecurityCompliance::V1::Framework, ::Hash]
|
463
|
+
# Required. The resource being created
|
464
|
+
#
|
465
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
466
|
+
# @yieldparam response [::Google::Cloud::CloudSecurityCompliance::V1::Framework]
|
467
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
468
|
+
#
|
469
|
+
# @return [::Google::Cloud::CloudSecurityCompliance::V1::Framework]
|
470
|
+
#
|
471
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
472
|
+
#
|
473
|
+
# @example Basic example
|
474
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
475
|
+
#
|
476
|
+
# # Create a client object. The client can be reused for multiple calls.
|
477
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
478
|
+
#
|
479
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
480
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkRequest.new
|
481
|
+
#
|
482
|
+
# # Call the create_framework method.
|
483
|
+
# result = client.create_framework request
|
484
|
+
#
|
485
|
+
# # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::Framework.
|
486
|
+
# p result
|
487
|
+
#
|
488
|
+
def create_framework request, options = nil
|
489
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
490
|
+
|
491
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::CreateFrameworkRequest
|
492
|
+
|
493
|
+
# Converts hash and nil to an options object
|
494
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
495
|
+
|
496
|
+
# Customize the options with defaults
|
497
|
+
metadata = @config.rpcs.create_framework.metadata.to_h
|
498
|
+
|
499
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
500
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
501
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
502
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
503
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
504
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
505
|
+
|
506
|
+
header_params = {}
|
507
|
+
if request.parent
|
508
|
+
header_params["parent"] = request.parent
|
509
|
+
end
|
510
|
+
|
511
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
512
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
513
|
+
|
514
|
+
options.apply_defaults timeout: @config.rpcs.create_framework.timeout,
|
515
|
+
metadata: metadata,
|
516
|
+
retry_policy: @config.rpcs.create_framework.retry_policy
|
517
|
+
|
518
|
+
options.apply_defaults timeout: @config.timeout,
|
519
|
+
metadata: @config.metadata,
|
520
|
+
retry_policy: @config.retry_policy
|
521
|
+
|
522
|
+
@config_stub.call_rpc :create_framework, request, options: options do |response, operation|
|
523
|
+
yield response, operation if block_given?
|
524
|
+
end
|
525
|
+
rescue ::GRPC::BadStatus => e
|
526
|
+
raise ::Google::Cloud::Error.from_error(e)
|
527
|
+
end
|
528
|
+
|
529
|
+
##
|
530
|
+
# Updates a single Framework.
|
531
|
+
# This method allows for partial updates of a Framework resource. The fields
|
532
|
+
# to be updated are specified using the `update_mask`.
|
533
|
+
#
|
534
|
+
# - If an `update_mask` is provided, only the fields specified in the mask
|
535
|
+
# will be updated.
|
536
|
+
# - If no `update_mask` is provided, all fields present in the request's
|
537
|
+
# `framework` body will be used to overwrite the existing resource.
|
538
|
+
#
|
539
|
+
# This operation can only be performed on Frameworks with type `CUSTOM`.
|
540
|
+
# A successful update will result in a new version of the Framework.
|
541
|
+
#
|
542
|
+
# @overload update_framework(request, options = nil)
|
543
|
+
# Pass arguments to `update_framework` via a request object, either of type
|
544
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::UpdateFrameworkRequest} or an equivalent Hash.
|
545
|
+
#
|
546
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::UpdateFrameworkRequest, ::Hash]
|
547
|
+
# A request object representing the call parameters. Required. To specify no
|
548
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
549
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
550
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
551
|
+
#
|
552
|
+
# @overload update_framework(update_mask: nil, framework: nil, major_revision_id: nil)
|
553
|
+
# Pass arguments to `update_framework` via keyword arguments. Note that at
|
554
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
555
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
556
|
+
#
|
557
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
558
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
559
|
+
# Framework resource by the update.
|
560
|
+
# The fields specified in the update_mask are relative to the resource, not
|
561
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
562
|
+
# user does not provide a mask then all fields present in the request will be
|
563
|
+
# overwritten.
|
564
|
+
# @param framework [::Google::Cloud::CloudSecurityCompliance::V1::Framework, ::Hash]
|
565
|
+
# Required. The resource being updated
|
566
|
+
# @param major_revision_id [::Integer]
|
567
|
+
# Optional. The major version ID of the framework to update.
|
568
|
+
#
|
569
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
570
|
+
# @yieldparam response [::Google::Cloud::CloudSecurityCompliance::V1::Framework]
|
571
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
572
|
+
#
|
573
|
+
# @return [::Google::Cloud::CloudSecurityCompliance::V1::Framework]
|
574
|
+
#
|
575
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
576
|
+
#
|
577
|
+
# @example Basic example
|
578
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
579
|
+
#
|
580
|
+
# # Create a client object. The client can be reused for multiple calls.
|
581
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
582
|
+
#
|
583
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
584
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::UpdateFrameworkRequest.new
|
585
|
+
#
|
586
|
+
# # Call the update_framework method.
|
587
|
+
# result = client.update_framework request
|
588
|
+
#
|
589
|
+
# # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::Framework.
|
590
|
+
# p result
|
591
|
+
#
|
592
|
+
def update_framework request, options = nil
|
593
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
594
|
+
|
595
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::UpdateFrameworkRequest
|
596
|
+
|
597
|
+
# Converts hash and nil to an options object
|
598
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
599
|
+
|
600
|
+
# Customize the options with defaults
|
601
|
+
metadata = @config.rpcs.update_framework.metadata.to_h
|
602
|
+
|
603
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
604
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
605
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
606
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
607
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
608
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
609
|
+
|
610
|
+
header_params = {}
|
611
|
+
if request.framework&.name
|
612
|
+
header_params["framework.name"] = request.framework.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.update_framework.timeout,
|
619
|
+
metadata: metadata,
|
620
|
+
retry_policy: @config.rpcs.update_framework.retry_policy
|
621
|
+
|
622
|
+
options.apply_defaults timeout: @config.timeout,
|
623
|
+
metadata: @config.metadata,
|
624
|
+
retry_policy: @config.retry_policy
|
625
|
+
|
626
|
+
@config_stub.call_rpc :update_framework, request, options: options do |response, operation|
|
627
|
+
yield response, operation if block_given?
|
628
|
+
end
|
629
|
+
rescue ::GRPC::BadStatus => e
|
630
|
+
raise ::Google::Cloud::Error.from_error(e)
|
631
|
+
end
|
632
|
+
|
633
|
+
##
|
634
|
+
# Deletes a single Custom Framework, including all its minor and
|
635
|
+
# minor revisions.
|
636
|
+
#
|
637
|
+
# - This operation can only be performed on Frameworks with type `CUSTOM`.
|
638
|
+
# Built-in Frameworks cannot be deleted.
|
639
|
+
# - The Framework cannot be deleted if it is currently deployed on any
|
640
|
+
# resource.
|
641
|
+
# - This action is permanent and cannot be undone.
|
642
|
+
#
|
643
|
+
# @overload delete_framework(request, options = nil)
|
644
|
+
# Pass arguments to `delete_framework` via a request object, either of type
|
645
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::DeleteFrameworkRequest} or an equivalent Hash.
|
646
|
+
#
|
647
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::DeleteFrameworkRequest, ::Hash]
|
648
|
+
# A request object representing the call parameters. Required. To specify no
|
649
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
650
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
651
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
652
|
+
#
|
653
|
+
# @overload delete_framework(name: nil)
|
654
|
+
# Pass arguments to `delete_framework` via keyword arguments. Note that at
|
655
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
656
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
657
|
+
#
|
658
|
+
# @param name [::String]
|
659
|
+
# Required. Name of the resource, in the format
|
660
|
+
# `organizations/{organization}/locations/{location}/frameworks/{framework}`.
|
661
|
+
#
|
662
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
663
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
664
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
665
|
+
#
|
666
|
+
# @return [::Google::Protobuf::Empty]
|
667
|
+
#
|
668
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
669
|
+
#
|
670
|
+
# @example Basic example
|
671
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
672
|
+
#
|
673
|
+
# # Create a client object. The client can be reused for multiple calls.
|
674
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
675
|
+
#
|
676
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
677
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::DeleteFrameworkRequest.new
|
678
|
+
#
|
679
|
+
# # Call the delete_framework method.
|
680
|
+
# result = client.delete_framework request
|
681
|
+
#
|
682
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
683
|
+
# p result
|
684
|
+
#
|
685
|
+
def delete_framework request, options = nil
|
686
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
687
|
+
|
688
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::DeleteFrameworkRequest
|
689
|
+
|
690
|
+
# Converts hash and nil to an options object
|
691
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
692
|
+
|
693
|
+
# Customize the options with defaults
|
694
|
+
metadata = @config.rpcs.delete_framework.metadata.to_h
|
695
|
+
|
696
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
697
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
698
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
699
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
700
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
701
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
702
|
+
|
703
|
+
header_params = {}
|
704
|
+
if request.name
|
705
|
+
header_params["name"] = request.name
|
706
|
+
end
|
707
|
+
|
708
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
709
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
710
|
+
|
711
|
+
options.apply_defaults timeout: @config.rpcs.delete_framework.timeout,
|
712
|
+
metadata: metadata,
|
713
|
+
retry_policy: @config.rpcs.delete_framework.retry_policy
|
714
|
+
|
715
|
+
options.apply_defaults timeout: @config.timeout,
|
716
|
+
metadata: @config.metadata,
|
717
|
+
retry_policy: @config.retry_policy
|
718
|
+
|
719
|
+
@config_stub.call_rpc :delete_framework, request, options: options do |response, operation|
|
720
|
+
yield response, operation if block_given?
|
721
|
+
end
|
722
|
+
rescue ::GRPC::BadStatus => e
|
723
|
+
raise ::Google::Cloud::Error.from_error(e)
|
724
|
+
end
|
725
|
+
|
726
|
+
##
|
727
|
+
# Lists all CloudControls (both Built-in and Custom) available within a given
|
728
|
+
# parent resource. This method supports pagination.
|
729
|
+
# The latest major version of each CloudControl is returned.
|
730
|
+
#
|
731
|
+
# @overload list_cloud_controls(request, options = nil)
|
732
|
+
# Pass arguments to `list_cloud_controls` via a request object, either of type
|
733
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::ListCloudControlsRequest} or an equivalent Hash.
|
734
|
+
#
|
735
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::ListCloudControlsRequest, ::Hash]
|
736
|
+
# A request object representing the call parameters. Required. To specify no
|
737
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
738
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
739
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
740
|
+
#
|
741
|
+
# @overload list_cloud_controls(parent: nil, page_size: nil, page_token: nil)
|
742
|
+
# Pass arguments to `list_cloud_controls` via keyword arguments. Note that at
|
743
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
744
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
745
|
+
#
|
746
|
+
# @param parent [::String]
|
747
|
+
# Required. The parent resource name, in the format
|
748
|
+
# `organizations/{organization}/locations/{location}`.
|
749
|
+
# @param page_size [::Integer]
|
750
|
+
# Optional. The maximum number of CloudControls to return. The default value
|
751
|
+
# is `500`.
|
752
|
+
#
|
753
|
+
# If you exceed the maximum value of `1000`, then the service uses the
|
754
|
+
# maximum value.
|
755
|
+
# @param page_token [::String]
|
756
|
+
# Optional. A pagination token returned from a previous request to list
|
757
|
+
# CloudControls. Provide this token to retrieve the next page of results.
|
758
|
+
#
|
759
|
+
# When paginating, parent provided to
|
760
|
+
# ListCloudControls request must match the call that provided the page
|
761
|
+
# token.
|
762
|
+
#
|
763
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
764
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::CloudControl>]
|
765
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
766
|
+
#
|
767
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudSecurityCompliance::V1::CloudControl>]
|
768
|
+
#
|
769
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
770
|
+
#
|
771
|
+
# @example Basic example
|
772
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
773
|
+
#
|
774
|
+
# # Create a client object. The client can be reused for multiple calls.
|
775
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
776
|
+
#
|
777
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
778
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::ListCloudControlsRequest.new
|
779
|
+
#
|
780
|
+
# # Call the list_cloud_controls method.
|
781
|
+
# result = client.list_cloud_controls request
|
782
|
+
#
|
783
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
784
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
785
|
+
# result.each do |item|
|
786
|
+
# # Each element is of type ::Google::Cloud::CloudSecurityCompliance::V1::CloudControl.
|
787
|
+
# p item
|
788
|
+
# end
|
789
|
+
#
|
790
|
+
def list_cloud_controls request, options = nil
|
791
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
792
|
+
|
793
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::ListCloudControlsRequest
|
794
|
+
|
795
|
+
# Converts hash and nil to an options object
|
796
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
797
|
+
|
798
|
+
# Customize the options with defaults
|
799
|
+
metadata = @config.rpcs.list_cloud_controls.metadata.to_h
|
800
|
+
|
801
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
802
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
803
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
804
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
805
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
806
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
807
|
+
|
808
|
+
header_params = {}
|
809
|
+
if request.parent
|
810
|
+
header_params["parent"] = request.parent
|
811
|
+
end
|
812
|
+
|
813
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
814
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
815
|
+
|
816
|
+
options.apply_defaults timeout: @config.rpcs.list_cloud_controls.timeout,
|
817
|
+
metadata: metadata,
|
818
|
+
retry_policy: @config.rpcs.list_cloud_controls.retry_policy
|
819
|
+
|
820
|
+
options.apply_defaults timeout: @config.timeout,
|
821
|
+
metadata: @config.metadata,
|
822
|
+
retry_policy: @config.retry_policy
|
823
|
+
|
824
|
+
@config_stub.call_rpc :list_cloud_controls, request, options: options do |response, operation|
|
825
|
+
response = ::Gapic::PagedEnumerable.new @config_stub, :list_cloud_controls, request, response, operation, options
|
826
|
+
yield response, operation if block_given?
|
827
|
+
throw :response, response
|
828
|
+
end
|
829
|
+
rescue ::GRPC::BadStatus => e
|
830
|
+
raise ::Google::Cloud::Error.from_error(e)
|
831
|
+
end
|
832
|
+
|
833
|
+
##
|
834
|
+
# Gets details of a single CloudControl.
|
835
|
+
# This method retrieves a CloudControl resource, which can be either Built-in
|
836
|
+
# or Custom, identified by its name.
|
837
|
+
#
|
838
|
+
# By default, the latest major version of the CloudControl is returned.
|
839
|
+
# A specific major version can be retrieved by specifying the
|
840
|
+
# `major_revision_id` in the request.
|
841
|
+
#
|
842
|
+
# @overload get_cloud_control(request, options = nil)
|
843
|
+
# Pass arguments to `get_cloud_control` via a request object, either of type
|
844
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::GetCloudControlRequest} or an equivalent Hash.
|
845
|
+
#
|
846
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::GetCloudControlRequest, ::Hash]
|
847
|
+
# A request object representing the call parameters. Required. To specify no
|
848
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
849
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
850
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
851
|
+
#
|
852
|
+
# @overload get_cloud_control(name: nil)
|
853
|
+
# Pass arguments to `get_cloud_control` via keyword arguments. Note that at
|
854
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
855
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
856
|
+
#
|
857
|
+
# @param name [::String]
|
858
|
+
# Required. The name of the cloudcontrol to retrieve in the format:
|
859
|
+
# organizations/\\{organization}/locations/\\{location}/cloudControls/\\{cloud_control}
|
860
|
+
#
|
861
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
862
|
+
# @yieldparam response [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl]
|
863
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
864
|
+
#
|
865
|
+
# @return [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl]
|
866
|
+
#
|
867
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
868
|
+
#
|
869
|
+
# @example Basic example
|
870
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
871
|
+
#
|
872
|
+
# # Create a client object. The client can be reused for multiple calls.
|
873
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
874
|
+
#
|
875
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
876
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::GetCloudControlRequest.new
|
877
|
+
#
|
878
|
+
# # Call the get_cloud_control method.
|
879
|
+
# result = client.get_cloud_control request
|
880
|
+
#
|
881
|
+
# # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::CloudControl.
|
882
|
+
# p result
|
883
|
+
#
|
884
|
+
def get_cloud_control request, options = nil
|
885
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
886
|
+
|
887
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::GetCloudControlRequest
|
888
|
+
|
889
|
+
# Converts hash and nil to an options object
|
890
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
891
|
+
|
892
|
+
# Customize the options with defaults
|
893
|
+
metadata = @config.rpcs.get_cloud_control.metadata.to_h
|
894
|
+
|
895
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
896
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
897
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
898
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
899
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
900
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
901
|
+
|
902
|
+
header_params = {}
|
903
|
+
if request.name
|
904
|
+
header_params["name"] = request.name
|
905
|
+
end
|
906
|
+
|
907
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
908
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
909
|
+
|
910
|
+
options.apply_defaults timeout: @config.rpcs.get_cloud_control.timeout,
|
911
|
+
metadata: metadata,
|
912
|
+
retry_policy: @config.rpcs.get_cloud_control.retry_policy
|
913
|
+
|
914
|
+
options.apply_defaults timeout: @config.timeout,
|
915
|
+
metadata: @config.metadata,
|
916
|
+
retry_policy: @config.retry_policy
|
917
|
+
|
918
|
+
@config_stub.call_rpc :get_cloud_control, request, options: options do |response, operation|
|
919
|
+
yield response, operation if block_given?
|
920
|
+
end
|
921
|
+
rescue ::GRPC::BadStatus => e
|
922
|
+
raise ::Google::Cloud::Error.from_error(e)
|
923
|
+
end
|
924
|
+
|
925
|
+
##
|
926
|
+
# Creates a new CloudControl with type `Custom` under a given parent
|
927
|
+
# resource. `Built-in` CloudControls are managed by Google and cannot be
|
928
|
+
# created through this API.
|
929
|
+
#
|
930
|
+
# @overload create_cloud_control(request, options = nil)
|
931
|
+
# Pass arguments to `create_cloud_control` via a request object, either of type
|
932
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::CreateCloudControlRequest} or an equivalent Hash.
|
933
|
+
#
|
934
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::CreateCloudControlRequest, ::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 create_cloud_control(parent: nil, cloud_control_id: nil, cloud_control: nil)
|
941
|
+
# Pass arguments to `create_cloud_control` 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 parent [::String]
|
946
|
+
# Required. The parent resource name, in the format
|
947
|
+
# `organizations/{organization}/locations/{location}`.
|
948
|
+
# @param cloud_control_id [::String]
|
949
|
+
# Required. ID of the CloudControl.
|
950
|
+
# This is the last segment of the CloudControl resource name.
|
951
|
+
# Format: `^[a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$`.
|
952
|
+
# @param cloud_control [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl, ::Hash]
|
953
|
+
# Required. The resource being created
|
954
|
+
#
|
955
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
956
|
+
# @yieldparam response [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl]
|
957
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
958
|
+
#
|
959
|
+
# @return [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl]
|
960
|
+
#
|
961
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
962
|
+
#
|
963
|
+
# @example Basic example
|
964
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
965
|
+
#
|
966
|
+
# # Create a client object. The client can be reused for multiple calls.
|
967
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
968
|
+
#
|
969
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
970
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::CreateCloudControlRequest.new
|
971
|
+
#
|
972
|
+
# # Call the create_cloud_control method.
|
973
|
+
# result = client.create_cloud_control request
|
974
|
+
#
|
975
|
+
# # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::CloudControl.
|
976
|
+
# p result
|
977
|
+
#
|
978
|
+
def create_cloud_control request, options = nil
|
979
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
980
|
+
|
981
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::CreateCloudControlRequest
|
982
|
+
|
983
|
+
# Converts hash and nil to an options object
|
984
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
985
|
+
|
986
|
+
# Customize the options with defaults
|
987
|
+
metadata = @config.rpcs.create_cloud_control.metadata.to_h
|
988
|
+
|
989
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
990
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
991
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
992
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
993
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
994
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
995
|
+
|
996
|
+
header_params = {}
|
997
|
+
if request.parent
|
998
|
+
header_params["parent"] = request.parent
|
999
|
+
end
|
1000
|
+
|
1001
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1002
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1003
|
+
|
1004
|
+
options.apply_defaults timeout: @config.rpcs.create_cloud_control.timeout,
|
1005
|
+
metadata: metadata,
|
1006
|
+
retry_policy: @config.rpcs.create_cloud_control.retry_policy
|
1007
|
+
|
1008
|
+
options.apply_defaults timeout: @config.timeout,
|
1009
|
+
metadata: @config.metadata,
|
1010
|
+
retry_policy: @config.retry_policy
|
1011
|
+
|
1012
|
+
@config_stub.call_rpc :create_cloud_control, request, options: options do |response, operation|
|
1013
|
+
yield response, operation if block_given?
|
1014
|
+
end
|
1015
|
+
rescue ::GRPC::BadStatus => e
|
1016
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
##
|
1020
|
+
# Updates a single CloudControl.
|
1021
|
+
# This method allows for partial updates of a Custom CloudControl resource.
|
1022
|
+
# Built-in CloudControls cannot be updated.
|
1023
|
+
#
|
1024
|
+
# - If an `update_mask` is provided, only the fields specified in the mask
|
1025
|
+
# will be updated.
|
1026
|
+
# - If no `update_mask` is provided, all fields present in the request's
|
1027
|
+
# `cloud_control` body will be used to overwrite the existing resource.
|
1028
|
+
#
|
1029
|
+
# A successful update will result in a new version of the CloudControl.
|
1030
|
+
#
|
1031
|
+
# @overload update_cloud_control(request, options = nil)
|
1032
|
+
# Pass arguments to `update_cloud_control` via a request object, either of type
|
1033
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::UpdateCloudControlRequest} or an equivalent Hash.
|
1034
|
+
#
|
1035
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::UpdateCloudControlRequest, ::Hash]
|
1036
|
+
# A request object representing the call parameters. Required. To specify no
|
1037
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1038
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1039
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1040
|
+
#
|
1041
|
+
# @overload update_cloud_control(update_mask: nil, cloud_control: nil)
|
1042
|
+
# Pass arguments to `update_cloud_control` via keyword arguments. Note that at
|
1043
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1044
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1045
|
+
#
|
1046
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1047
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
1048
|
+
# CloudControl resource by the update.
|
1049
|
+
# The fields specified in the update_mask are relative to the resource, not
|
1050
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
1051
|
+
# user does not provide a mask then all fields present in the request will be
|
1052
|
+
# overwritten. The fields that can be updated are:
|
1053
|
+
# 1. Display_name
|
1054
|
+
# 2. Description
|
1055
|
+
# 3. Parameters
|
1056
|
+
# 4. Rules
|
1057
|
+
# 5. ParameterSpec.
|
1058
|
+
# @param cloud_control [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl, ::Hash]
|
1059
|
+
# Required. The resource being updated
|
1060
|
+
#
|
1061
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1062
|
+
# @yieldparam response [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl]
|
1063
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1064
|
+
#
|
1065
|
+
# @return [::Google::Cloud::CloudSecurityCompliance::V1::CloudControl]
|
1066
|
+
#
|
1067
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1068
|
+
#
|
1069
|
+
# @example Basic example
|
1070
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
1071
|
+
#
|
1072
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1073
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
1074
|
+
#
|
1075
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1076
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::UpdateCloudControlRequest.new
|
1077
|
+
#
|
1078
|
+
# # Call the update_cloud_control method.
|
1079
|
+
# result = client.update_cloud_control request
|
1080
|
+
#
|
1081
|
+
# # The returned object is of type Google::Cloud::CloudSecurityCompliance::V1::CloudControl.
|
1082
|
+
# p result
|
1083
|
+
#
|
1084
|
+
def update_cloud_control request, options = nil
|
1085
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1086
|
+
|
1087
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::UpdateCloudControlRequest
|
1088
|
+
|
1089
|
+
# Converts hash and nil to an options object
|
1090
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1091
|
+
|
1092
|
+
# Customize the options with defaults
|
1093
|
+
metadata = @config.rpcs.update_cloud_control.metadata.to_h
|
1094
|
+
|
1095
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1096
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1097
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1098
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
1099
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1100
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1101
|
+
|
1102
|
+
header_params = {}
|
1103
|
+
if request.cloud_control&.name
|
1104
|
+
header_params["cloud_control.name"] = request.cloud_control.name
|
1105
|
+
end
|
1106
|
+
|
1107
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1108
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1109
|
+
|
1110
|
+
options.apply_defaults timeout: @config.rpcs.update_cloud_control.timeout,
|
1111
|
+
metadata: metadata,
|
1112
|
+
retry_policy: @config.rpcs.update_cloud_control.retry_policy
|
1113
|
+
|
1114
|
+
options.apply_defaults timeout: @config.timeout,
|
1115
|
+
metadata: @config.metadata,
|
1116
|
+
retry_policy: @config.retry_policy
|
1117
|
+
|
1118
|
+
@config_stub.call_rpc :update_cloud_control, request, options: options do |response, operation|
|
1119
|
+
yield response, operation if block_given?
|
1120
|
+
end
|
1121
|
+
rescue ::GRPC::BadStatus => e
|
1122
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
##
|
1126
|
+
# Deletes a single Custom CloudControl, including all its
|
1127
|
+
# major and minor revisions.
|
1128
|
+
#
|
1129
|
+
# - This operation can only be performed on CloudControls with type `CUSTOM`.
|
1130
|
+
# Built-in CloudControls cannot be deleted.
|
1131
|
+
# - The CloudControl cannot be deleted if any of its revisions are currently
|
1132
|
+
# referenced by any Framework.
|
1133
|
+
# - This action is permanent and cannot be undone.
|
1134
|
+
#
|
1135
|
+
# @overload delete_cloud_control(request, options = nil)
|
1136
|
+
# Pass arguments to `delete_cloud_control` via a request object, either of type
|
1137
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::DeleteCloudControlRequest} or an equivalent Hash.
|
1138
|
+
#
|
1139
|
+
# @param request [::Google::Cloud::CloudSecurityCompliance::V1::DeleteCloudControlRequest, ::Hash]
|
1140
|
+
# A request object representing the call parameters. Required. To specify no
|
1141
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1142
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1143
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1144
|
+
#
|
1145
|
+
# @overload delete_cloud_control(name: nil)
|
1146
|
+
# Pass arguments to `delete_cloud_control` via keyword arguments. Note that at
|
1147
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1148
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1149
|
+
#
|
1150
|
+
# @param name [::String]
|
1151
|
+
# Required. Name of the resource, in the format
|
1152
|
+
# `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`.
|
1153
|
+
#
|
1154
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1155
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
1156
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1157
|
+
#
|
1158
|
+
# @return [::Google::Protobuf::Empty]
|
1159
|
+
#
|
1160
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1161
|
+
#
|
1162
|
+
# @example Basic example
|
1163
|
+
# require "google/cloud/cloud_security_compliance/v1"
|
1164
|
+
#
|
1165
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1166
|
+
# client = Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new
|
1167
|
+
#
|
1168
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1169
|
+
# request = Google::Cloud::CloudSecurityCompliance::V1::DeleteCloudControlRequest.new
|
1170
|
+
#
|
1171
|
+
# # Call the delete_cloud_control method.
|
1172
|
+
# result = client.delete_cloud_control request
|
1173
|
+
#
|
1174
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1175
|
+
# p result
|
1176
|
+
#
|
1177
|
+
def delete_cloud_control request, options = nil
|
1178
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1179
|
+
|
1180
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudSecurityCompliance::V1::DeleteCloudControlRequest
|
1181
|
+
|
1182
|
+
# Converts hash and nil to an options object
|
1183
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1184
|
+
|
1185
|
+
# Customize the options with defaults
|
1186
|
+
metadata = @config.rpcs.delete_cloud_control.metadata.to_h
|
1187
|
+
|
1188
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1189
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1190
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1191
|
+
gapic_version: ::Google::Cloud::CloudSecurityCompliance::V1::VERSION
|
1192
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1193
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1194
|
+
|
1195
|
+
header_params = {}
|
1196
|
+
if request.name
|
1197
|
+
header_params["name"] = request.name
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1201
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1202
|
+
|
1203
|
+
options.apply_defaults timeout: @config.rpcs.delete_cloud_control.timeout,
|
1204
|
+
metadata: metadata,
|
1205
|
+
retry_policy: @config.rpcs.delete_cloud_control.retry_policy
|
1206
|
+
|
1207
|
+
options.apply_defaults timeout: @config.timeout,
|
1208
|
+
metadata: @config.metadata,
|
1209
|
+
retry_policy: @config.retry_policy
|
1210
|
+
|
1211
|
+
@config_stub.call_rpc :delete_cloud_control, request, options: options do |response, operation|
|
1212
|
+
yield response, operation if block_given?
|
1213
|
+
end
|
1214
|
+
rescue ::GRPC::BadStatus => e
|
1215
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1216
|
+
end
|
1217
|
+
|
1218
|
+
##
|
1219
|
+
# Configuration class for the Config API.
|
1220
|
+
#
|
1221
|
+
# This class represents the configuration for Config,
|
1222
|
+
# providing control over timeouts, retry behavior, logging, transport
|
1223
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
1224
|
+
# applied individually to specific RPCs. See
|
1225
|
+
# {::Google::Cloud::CloudSecurityCompliance::V1::Config::Client::Configuration::Rpcs}
|
1226
|
+
# for a list of RPCs that can be configured independently.
|
1227
|
+
#
|
1228
|
+
# Configuration can be applied globally to all clients, or to a single client
|
1229
|
+
# on construction.
|
1230
|
+
#
|
1231
|
+
# @example
|
1232
|
+
#
|
1233
|
+
# # Modify the global config, setting the timeout for
|
1234
|
+
# # list_frameworks to 20 seconds,
|
1235
|
+
# # and all remaining timeouts to 10 seconds.
|
1236
|
+
# ::Google::Cloud::CloudSecurityCompliance::V1::Config::Client.configure do |config|
|
1237
|
+
# config.timeout = 10.0
|
1238
|
+
# config.rpcs.list_frameworks.timeout = 20.0
|
1239
|
+
# end
|
1240
|
+
#
|
1241
|
+
# # Apply the above configuration only to a new client.
|
1242
|
+
# client = ::Google::Cloud::CloudSecurityCompliance::V1::Config::Client.new do |config|
|
1243
|
+
# config.timeout = 10.0
|
1244
|
+
# config.rpcs.list_frameworks.timeout = 20.0
|
1245
|
+
# end
|
1246
|
+
#
|
1247
|
+
# @!attribute [rw] endpoint
|
1248
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1249
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1250
|
+
# @return [::String,nil]
|
1251
|
+
# @!attribute [rw] credentials
|
1252
|
+
# Credentials to send with calls. You may provide any of the following types:
|
1253
|
+
# * (`String`) The path to a service account key file in JSON format
|
1254
|
+
# * (`Hash`) A service account key as a Hash
|
1255
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1256
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
1257
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1258
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1259
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1260
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1261
|
+
# * (`nil`) indicating no credentials
|
1262
|
+
#
|
1263
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1264
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1265
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1266
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1267
|
+
# For more information, refer to [Validate credential configurations from external
|
1268
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1269
|
+
# @return [::Object]
|
1270
|
+
# @!attribute [rw] scope
|
1271
|
+
# The OAuth scopes
|
1272
|
+
# @return [::Array<::String>]
|
1273
|
+
# @!attribute [rw] lib_name
|
1274
|
+
# The library name as recorded in instrumentation and logging
|
1275
|
+
# @return [::String]
|
1276
|
+
# @!attribute [rw] lib_version
|
1277
|
+
# The library version as recorded in instrumentation and logging
|
1278
|
+
# @return [::String]
|
1279
|
+
# @!attribute [rw] channel_args
|
1280
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
1281
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
1282
|
+
# @return [::Hash]
|
1283
|
+
# @!attribute [rw] interceptors
|
1284
|
+
# An array of interceptors that are run before calls are executed.
|
1285
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
1286
|
+
# @!attribute [rw] timeout
|
1287
|
+
# The call timeout in seconds.
|
1288
|
+
# @return [::Numeric]
|
1289
|
+
# @!attribute [rw] metadata
|
1290
|
+
# Additional gRPC headers to be sent with the call.
|
1291
|
+
# @return [::Hash{::Symbol=>::String}]
|
1292
|
+
# @!attribute [rw] retry_policy
|
1293
|
+
# The retry policy. The value is a hash with the following keys:
|
1294
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1295
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1296
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1297
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1298
|
+
# trigger a retry.
|
1299
|
+
# @return [::Hash]
|
1300
|
+
# @!attribute [rw] quota_project
|
1301
|
+
# A separate project against which to charge quota.
|
1302
|
+
# @return [::String]
|
1303
|
+
# @!attribute [rw] universe_domain
|
1304
|
+
# The universe domain within which to make requests. This determines the
|
1305
|
+
# default endpoint URL. The default value of nil uses the environment
|
1306
|
+
# universe (usually the default "googleapis.com" universe).
|
1307
|
+
# @return [::String,nil]
|
1308
|
+
# @!attribute [rw] logger
|
1309
|
+
# A custom logger to use for request/response debug logging, or the value
|
1310
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1311
|
+
# explicitly disable logging.
|
1312
|
+
# @return [::Logger,:default,nil]
|
1313
|
+
#
|
1314
|
+
class Configuration
|
1315
|
+
extend ::Gapic::Config
|
1316
|
+
|
1317
|
+
# @private
|
1318
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1319
|
+
DEFAULT_ENDPOINT = "cloudsecuritycompliance.googleapis.com"
|
1320
|
+
|
1321
|
+
config_attr :endpoint, nil, ::String, nil
|
1322
|
+
config_attr :credentials, nil do |value|
|
1323
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
1324
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
|
1325
|
+
allowed.any? { |klass| klass === value }
|
1326
|
+
end
|
1327
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1328
|
+
config_attr :lib_name, nil, ::String, nil
|
1329
|
+
config_attr :lib_version, nil, ::String, nil
|
1330
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
1331
|
+
config_attr :interceptors, nil, ::Array, nil
|
1332
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1333
|
+
config_attr :metadata, nil, ::Hash, nil
|
1334
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1335
|
+
config_attr :quota_project, nil, ::String, nil
|
1336
|
+
config_attr :universe_domain, nil, ::String, nil
|
1337
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1338
|
+
|
1339
|
+
# @private
|
1340
|
+
def initialize parent_config = nil
|
1341
|
+
@parent_config = parent_config unless parent_config.nil?
|
1342
|
+
|
1343
|
+
yield self if block_given?
|
1344
|
+
end
|
1345
|
+
|
1346
|
+
##
|
1347
|
+
# Configurations for individual RPCs
|
1348
|
+
# @return [Rpcs]
|
1349
|
+
#
|
1350
|
+
def rpcs
|
1351
|
+
@rpcs ||= begin
|
1352
|
+
parent_rpcs = nil
|
1353
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1354
|
+
Rpcs.new parent_rpcs
|
1355
|
+
end
|
1356
|
+
end
|
1357
|
+
|
1358
|
+
##
|
1359
|
+
# Configuration for the channel pool
|
1360
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
1361
|
+
#
|
1362
|
+
def channel_pool
|
1363
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
1364
|
+
end
|
1365
|
+
|
1366
|
+
##
|
1367
|
+
# Configuration RPC class for the Config API.
|
1368
|
+
#
|
1369
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1370
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1371
|
+
# the following configuration fields:
|
1372
|
+
#
|
1373
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1374
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
1375
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1376
|
+
# include the following keys:
|
1377
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1378
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1379
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1380
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1381
|
+
# trigger a retry.
|
1382
|
+
#
|
1383
|
+
class Rpcs
|
1384
|
+
##
|
1385
|
+
# RPC-specific configuration for `list_frameworks`
|
1386
|
+
# @return [::Gapic::Config::Method]
|
1387
|
+
#
|
1388
|
+
attr_reader :list_frameworks
|
1389
|
+
##
|
1390
|
+
# RPC-specific configuration for `get_framework`
|
1391
|
+
# @return [::Gapic::Config::Method]
|
1392
|
+
#
|
1393
|
+
attr_reader :get_framework
|
1394
|
+
##
|
1395
|
+
# RPC-specific configuration for `create_framework`
|
1396
|
+
# @return [::Gapic::Config::Method]
|
1397
|
+
#
|
1398
|
+
attr_reader :create_framework
|
1399
|
+
##
|
1400
|
+
# RPC-specific configuration for `update_framework`
|
1401
|
+
# @return [::Gapic::Config::Method]
|
1402
|
+
#
|
1403
|
+
attr_reader :update_framework
|
1404
|
+
##
|
1405
|
+
# RPC-specific configuration for `delete_framework`
|
1406
|
+
# @return [::Gapic::Config::Method]
|
1407
|
+
#
|
1408
|
+
attr_reader :delete_framework
|
1409
|
+
##
|
1410
|
+
# RPC-specific configuration for `list_cloud_controls`
|
1411
|
+
# @return [::Gapic::Config::Method]
|
1412
|
+
#
|
1413
|
+
attr_reader :list_cloud_controls
|
1414
|
+
##
|
1415
|
+
# RPC-specific configuration for `get_cloud_control`
|
1416
|
+
# @return [::Gapic::Config::Method]
|
1417
|
+
#
|
1418
|
+
attr_reader :get_cloud_control
|
1419
|
+
##
|
1420
|
+
# RPC-specific configuration for `create_cloud_control`
|
1421
|
+
# @return [::Gapic::Config::Method]
|
1422
|
+
#
|
1423
|
+
attr_reader :create_cloud_control
|
1424
|
+
##
|
1425
|
+
# RPC-specific configuration for `update_cloud_control`
|
1426
|
+
# @return [::Gapic::Config::Method]
|
1427
|
+
#
|
1428
|
+
attr_reader :update_cloud_control
|
1429
|
+
##
|
1430
|
+
# RPC-specific configuration for `delete_cloud_control`
|
1431
|
+
# @return [::Gapic::Config::Method]
|
1432
|
+
#
|
1433
|
+
attr_reader :delete_cloud_control
|
1434
|
+
|
1435
|
+
# @private
|
1436
|
+
def initialize parent_rpcs = nil
|
1437
|
+
list_frameworks_config = parent_rpcs.list_frameworks if parent_rpcs.respond_to? :list_frameworks
|
1438
|
+
@list_frameworks = ::Gapic::Config::Method.new list_frameworks_config
|
1439
|
+
get_framework_config = parent_rpcs.get_framework if parent_rpcs.respond_to? :get_framework
|
1440
|
+
@get_framework = ::Gapic::Config::Method.new get_framework_config
|
1441
|
+
create_framework_config = parent_rpcs.create_framework if parent_rpcs.respond_to? :create_framework
|
1442
|
+
@create_framework = ::Gapic::Config::Method.new create_framework_config
|
1443
|
+
update_framework_config = parent_rpcs.update_framework if parent_rpcs.respond_to? :update_framework
|
1444
|
+
@update_framework = ::Gapic::Config::Method.new update_framework_config
|
1445
|
+
delete_framework_config = parent_rpcs.delete_framework if parent_rpcs.respond_to? :delete_framework
|
1446
|
+
@delete_framework = ::Gapic::Config::Method.new delete_framework_config
|
1447
|
+
list_cloud_controls_config = parent_rpcs.list_cloud_controls if parent_rpcs.respond_to? :list_cloud_controls
|
1448
|
+
@list_cloud_controls = ::Gapic::Config::Method.new list_cloud_controls_config
|
1449
|
+
get_cloud_control_config = parent_rpcs.get_cloud_control if parent_rpcs.respond_to? :get_cloud_control
|
1450
|
+
@get_cloud_control = ::Gapic::Config::Method.new get_cloud_control_config
|
1451
|
+
create_cloud_control_config = parent_rpcs.create_cloud_control if parent_rpcs.respond_to? :create_cloud_control
|
1452
|
+
@create_cloud_control = ::Gapic::Config::Method.new create_cloud_control_config
|
1453
|
+
update_cloud_control_config = parent_rpcs.update_cloud_control if parent_rpcs.respond_to? :update_cloud_control
|
1454
|
+
@update_cloud_control = ::Gapic::Config::Method.new update_cloud_control_config
|
1455
|
+
delete_cloud_control_config = parent_rpcs.delete_cloud_control if parent_rpcs.respond_to? :delete_cloud_control
|
1456
|
+
@delete_cloud_control = ::Gapic::Config::Method.new delete_cloud_control_config
|
1457
|
+
|
1458
|
+
yield self if block_given?
|
1459
|
+
end
|
1460
|
+
end
|
1461
|
+
end
|
1462
|
+
end
|
1463
|
+
end
|
1464
|
+
end
|
1465
|
+
end
|
1466
|
+
end
|
1467
|
+
end
|