google-cloud-security_center-v2 0.a → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/security_center/v2/rest.rb +37 -0
  6. data/lib/google/cloud/security_center/v2/security_center/client.rb +4771 -0
  7. data/lib/google/cloud/security_center/v2/security_center/credentials.rb +51 -0
  8. data/lib/google/cloud/security_center/v2/security_center/operations.rb +809 -0
  9. data/lib/google/cloud/security_center/v2/security_center/paths.rb +973 -0
  10. data/lib/google/cloud/security_center/v2/security_center/rest/client.rb +4390 -0
  11. data/lib/google/cloud/security_center/v2/security_center/rest/operations.rb +901 -0
  12. data/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb +3165 -0
  13. data/lib/google/cloud/security_center/v2/security_center/rest.rb +53 -0
  14. data/lib/google/cloud/security_center/v2/security_center.rb +56 -0
  15. data/lib/google/cloud/security_center/v2/version.rb +7 -2
  16. data/lib/google/cloud/security_center/v2.rb +45 -0
  17. data/lib/google/cloud/securitycenter/v2/access_pb.rb +44 -0
  18. data/lib/google/cloud/securitycenter/v2/application_pb.rb +42 -0
  19. data/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb +47 -0
  20. data/lib/google/cloud/securitycenter/v2/attack_path_pb.rb +49 -0
  21. data/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb +45 -0
  22. data/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb +47 -0
  23. data/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb +45 -0
  24. data/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb +44 -0
  25. data/lib/google/cloud/securitycenter/v2/compliance_pb.rb +42 -0
  26. data/lib/google/cloud/securitycenter/v2/connection_pb.rb +43 -0
  27. data/lib/google/cloud/securitycenter/v2/contact_details_pb.rb +43 -0
  28. data/lib/google/cloud/securitycenter/v2/container_pb.rb +47 -0
  29. data/lib/google/cloud/securitycenter/v2/database_pb.rb +42 -0
  30. data/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb +43 -0
  31. data/lib/google/cloud/securitycenter/v2/external_system_pb.rb +47 -0
  32. data/lib/google/cloud/securitycenter/v2/file_pb.rb +43 -0
  33. data/lib/google/cloud/securitycenter/v2/finding_pb.rb +109 -0
  34. data/lib/google/cloud/securitycenter/v2/group_membership_pb.rb +43 -0
  35. data/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb +43 -0
  36. data/lib/google/cloud/securitycenter/v2/indicator_pb.rb +47 -0
  37. data/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb +42 -0
  38. data/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb +57 -0
  39. data/lib/google/cloud/securitycenter/v2/label_pb.rb +42 -0
  40. data/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb +42 -0
  41. data/lib/google/cloud/securitycenter/v2/log_entry_pb.rb +46 -0
  42. data/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb +44 -0
  43. data/lib/google/cloud/securitycenter/v2/mute_config_pb.rb +48 -0
  44. data/lib/google/cloud/securitycenter/v2/notification_config_pb.rb +46 -0
  45. data/lib/google/cloud/securitycenter/v2/notification_message_pb.rb +47 -0
  46. data/lib/google/cloud/securitycenter/v2/org_policy_pb.rb +44 -0
  47. data/lib/google/cloud/securitycenter/v2/process_pb.rb +46 -0
  48. data/lib/google/cloud/securitycenter/v2/resource_pb.rb +44 -0
  49. data/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb +49 -0
  50. data/lib/google/cloud/securitycenter/v2/security_marks_pb.rb +44 -0
  51. data/lib/google/cloud/securitycenter/v2/security_posture_pb.rb +43 -0
  52. data/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb +128 -0
  53. data/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb +167 -0
  54. data/lib/google/cloud/securitycenter/v2/simulation_pb.rb +49 -0
  55. data/lib/google/cloud/securitycenter/v2/source_pb.rb +44 -0
  56. data/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb +42 -0
  57. data/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb +46 -0
  58. data/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb +58 -0
  59. data/lib/google-cloud-security_center-v2.rb +21 -0
  60. data/proto_docs/README.md +4 -0
  61. data/proto_docs/google/api/client.rb +399 -0
  62. data/proto_docs/google/api/field_behavior.rb +85 -0
  63. data/proto_docs/google/api/launch_stage.rb +71 -0
  64. data/proto_docs/google/api/resource.rb +222 -0
  65. data/proto_docs/google/api/routing.rb +459 -0
  66. data/proto_docs/google/cloud/securitycenter/v2/access.rb +120 -0
  67. data/proto_docs/google/cloud/securitycenter/v2/application.rb +40 -0
  68. data/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb +73 -0
  69. data/proto_docs/google/cloud/securitycenter/v2/attack_path.rb +147 -0
  70. data/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb +90 -0
  71. data/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb +96 -0
  72. data/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb +52 -0
  73. data/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb +50 -0
  74. data/proto_docs/google/cloud/securitycenter/v2/compliance.rb +43 -0
  75. data/proto_docs/google/cloud/securitycenter/v2/connection.rb +70 -0
  76. data/proto_docs/google/cloud/securitycenter/v2/contact_details.rb +44 -0
  77. data/proto_docs/google/cloud/securitycenter/v2/container.rb +49 -0
  78. data/proto_docs/google/cloud/securitycenter/v2/database.rb +67 -0
  79. data/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb +64 -0
  80. data/proto_docs/google/cloud/securitycenter/v2/external_system.rb +106 -0
  81. data/proto_docs/google/cloud/securitycenter/v2/file.rb +72 -0
  82. data/proto_docs/google/cloud/securitycenter/v2/finding.rb +427 -0
  83. data/proto_docs/google/cloud/securitycenter/v2/group_membership.rb +48 -0
  84. data/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb +56 -0
  85. data/proto_docs/google/cloud/securitycenter/v2/indicator.rb +112 -0
  86. data/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb +66 -0
  87. data/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb +241 -0
  88. data/proto_docs/google/cloud/securitycenter/v2/label.rb +41 -0
  89. data/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb +36 -0
  90. data/proto_docs/google/cloud/securitycenter/v2/log_entry.rb +58 -0
  91. data/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb +285 -0
  92. data/proto_docs/google/cloud/securitycenter/v2/mute_config.rb +100 -0
  93. data/proto_docs/google/cloud/securitycenter/v2/notification_config.rb +90 -0
  94. data/proto_docs/google/cloud/securitycenter/v2/notification_message.rb +42 -0
  95. data/proto_docs/google/cloud/securitycenter/v2/org_policy.rb +37 -0
  96. data/proto_docs/google/cloud/securitycenter/v2/process.rb +79 -0
  97. data/proto_docs/google/cloud/securitycenter/v2/resource.rb +42 -0
  98. data/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb +122 -0
  99. data/proto_docs/google/cloud/securitycenter/v2/security_marks.rb +84 -0
  100. data/proto_docs/google/cloud/securitycenter/v2/security_posture.rb +83 -0
  101. data/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb +1136 -0
  102. data/proto_docs/google/cloud/securitycenter/v2/simulation.rb +43 -0
  103. data/proto_docs/google/cloud/securitycenter/v2/source.rb +65 -0
  104. data/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb +46 -0
  105. data/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb +86 -0
  106. data/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb +333 -0
  107. data/proto_docs/google/iam/v1/iam_policy.rb +87 -0
  108. data/proto_docs/google/iam/v1/options.rb +50 -0
  109. data/proto_docs/google/iam/v1/policy.rb +426 -0
  110. data/proto_docs/google/longrunning/operations.rb +164 -0
  111. data/proto_docs/google/protobuf/any.rb +145 -0
  112. data/proto_docs/google/protobuf/duration.rb +98 -0
  113. data/proto_docs/google/protobuf/empty.rb +34 -0
  114. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  115. data/proto_docs/google/protobuf/struct.rb +96 -0
  116. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  117. data/proto_docs/google/rpc/status.rb +48 -0
  118. data/proto_docs/google/type/expr.rb +75 -0
  119. metadata +173 -10
@@ -0,0 +1,4390 @@
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/securitycenter/v2/securitycenter_service_pb"
21
+ require "google/cloud/security_center/v2/security_center/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module SecurityCenter
26
+ module V2
27
+ module SecurityCenter
28
+ module Rest
29
+ ##
30
+ # REST client for the SecurityCenter service.
31
+ #
32
+ # V2 APIs for Security Center service.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :security_center_stub
45
+
46
+ ##
47
+ # Configure the SecurityCenter Client class.
48
+ #
49
+ # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all SecurityCenter clients
55
+ # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::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", "SecurityCenter", "V2"]
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
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the SecurityCenter Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @security_center_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new SecurityCenter REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the SecurityCenter client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # Create the configuration object
128
+ @config = Configuration.new Client.configure
129
+
130
+ # Yield the configuration if needed
131
+ yield @config if block_given?
132
+
133
+ # Create credentials
134
+ credentials = @config.credentials
135
+ # Use self-signed JWT if the endpoint is unchanged from default,
136
+ # but only if the default endpoint does not have a region prefix.
137
+ enable_self_signed_jwt = @config.endpoint.nil? ||
138
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
139
+ !@config.endpoint.split(".").first.include?("-"))
140
+ credentials ||= Credentials.default scope: @config.scope,
141
+ enable_self_signed_jwt: enable_self_signed_jwt
142
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
143
+ credentials = Credentials.new credentials, scope: @config.scope
144
+ end
145
+
146
+ @quota_project_id = @config.quota_project
147
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
148
+
149
+ @operations_client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Operations.new do |config|
150
+ config.credentials = credentials
151
+ config.quota_project = @quota_project_id
152
+ config.endpoint = @config.endpoint
153
+ config.universe_domain = @config.universe_domain
154
+ end
155
+
156
+ @security_center_stub = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.new(
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ credentials: credentials
161
+ )
162
+ end
163
+
164
+ ##
165
+ # Get the associated client for long-running operations.
166
+ #
167
+ # @return [::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Operations]
168
+ #
169
+ attr_reader :operations_client
170
+
171
+ # Service calls
172
+
173
+ ##
174
+ # Creates a ResourceValueConfig for an organization. Maps user's tags to
175
+ # difference resource values for use by the attack path simulation.
176
+ #
177
+ # @overload batch_create_resource_value_configs(request, options = nil)
178
+ # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type
179
+ # {::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest} or an equivalent Hash.
180
+ #
181
+ # @param request [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Hash]
182
+ # A request object representing the call parameters. Required. To specify no
183
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
184
+ # @param options [::Gapic::CallOptions, ::Hash]
185
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
186
+ #
187
+ # @overload batch_create_resource_value_configs(parent: nil, requests: nil)
188
+ # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at
189
+ # least one keyword argument is required. To specify no parameters, or to keep all
190
+ # the default parameter values, pass an empty Hash as a request object (see above).
191
+ #
192
+ # @param parent [::String]
193
+ # Required. Resource name of the new ResourceValueConfig's parent.
194
+ # The parent field in the CreateResourceValueConfigRequest
195
+ # messages must either be empty or match this field.
196
+ # @param requests [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, ::Hash>]
197
+ # Required. The resource value configs to be created.
198
+ # @yield [result, operation] Access the result along with the TransportOperation object
199
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse]
200
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
201
+ #
202
+ # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse]
203
+ #
204
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
205
+ #
206
+ # @example Basic example
207
+ # require "google/cloud/security_center/v2"
208
+ #
209
+ # # Create a client object. The client can be reused for multiple calls.
210
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
211
+ #
212
+ # # Create a request. To set request fields, pass in keyword arguments.
213
+ # request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new
214
+ #
215
+ # # Call the batch_create_resource_value_configs method.
216
+ # result = client.batch_create_resource_value_configs request
217
+ #
218
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.
219
+ # p result
220
+ #
221
+ def batch_create_resource_value_configs request, options = nil
222
+ raise ::ArgumentError, "request must be provided" if request.nil?
223
+
224
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest
225
+
226
+ # Converts hash and nil to an options object
227
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
228
+
229
+ # Customize the options with defaults
230
+ call_metadata = @config.rpcs.batch_create_resource_value_configs.metadata.to_h
231
+
232
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
233
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
234
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
235
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
236
+ transports_version_send: [:rest]
237
+
238
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
239
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
240
+
241
+ options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout,
242
+ metadata: call_metadata,
243
+ retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
247
+ retry_policy: @config.retry_policy
248
+
249
+ @security_center_stub.batch_create_resource_value_configs request, options do |result, operation|
250
+ yield result, operation if block_given?
251
+ return result
252
+ end
253
+ rescue ::Gapic::Rest::Error => e
254
+ raise ::Google::Cloud::Error.from_error(e)
255
+ end
256
+
257
+ ##
258
+ # Kicks off an LRO to bulk mute findings for a parent based on a filter. If
259
+ # no location is specified, findings are muted in global. The parent
260
+ # can be either an organization, folder, or project. The findings matched by
261
+ # the filter will be muted after the LRO is done.
262
+ #
263
+ # @overload bulk_mute_findings(request, options = nil)
264
+ # Pass arguments to `bulk_mute_findings` via a request object, either of type
265
+ # {::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest} or an equivalent Hash.
266
+ #
267
+ # @param request [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Hash]
268
+ # A request object representing the call parameters. Required. To specify no
269
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
270
+ # @param options [::Gapic::CallOptions, ::Hash]
271
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
272
+ #
273
+ # @overload bulk_mute_findings(parent: nil, filter: nil)
274
+ # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at
275
+ # least one keyword argument is required. To specify no parameters, or to keep all
276
+ # the default parameter values, pass an empty Hash as a request object (see above).
277
+ #
278
+ # @param parent [::String]
279
+ # Required. The parent, at which bulk action needs to be applied. If no
280
+ # location is specified, findings are updated in global. The following list
281
+ # shows some examples:
282
+ #
283
+ # + `organizations/[organization_id]`
284
+ # + `organizations/[organization_id]/locations/[location_id]`
285
+ # + `folders/[folder_id]`
286
+ # + `folders/[folder_id]/locations/[location_id]`
287
+ # + `projects/[project_id]`
288
+ # + `projects/[project_id]/locations/[location_id]`
289
+ # @param filter [::String]
290
+ # Expression that identifies findings that should be updated.
291
+ # The expression is a list of zero or more restrictions combined
292
+ # via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
293
+ # has higher precedence than `AND`.
294
+ #
295
+ # Restrictions have the form `<field> <operator> <value>` and may have a
296
+ # `-` character in front of them to indicate negation. The fields map to
297
+ # those defined in the corresponding resource.
298
+ #
299
+ # The supported operators are:
300
+ #
301
+ # * `=` for all value types.
302
+ # * `>`, `<`, `>=`, `<=` for integer values.
303
+ # * `:`, meaning substring matching, for strings.
304
+ #
305
+ # The supported value types are:
306
+ #
307
+ # * string literals in quotes.
308
+ # * integer literals without quotes.
309
+ # * boolean literals `true` and `false` without quotes.
310
+ # @yield [result, operation] Access the result along with the TransportOperation object
311
+ # @yieldparam result [::Gapic::Operation]
312
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
313
+ #
314
+ # @return [::Gapic::Operation]
315
+ #
316
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
317
+ #
318
+ # @example Basic example
319
+ # require "google/cloud/security_center/v2"
320
+ #
321
+ # # Create a client object. The client can be reused for multiple calls.
322
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
323
+ #
324
+ # # Create a request. To set request fields, pass in keyword arguments.
325
+ # request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new
326
+ #
327
+ # # Call the bulk_mute_findings method.
328
+ # result = client.bulk_mute_findings request
329
+ #
330
+ # # The returned object is of type Gapic::Operation. You can use it to
331
+ # # check the status of an operation, cancel it, or wait for results.
332
+ # # Here is how to wait for a response.
333
+ # result.wait_until_done! timeout: 60
334
+ # if result.response?
335
+ # p result.response
336
+ # else
337
+ # puts "No response received."
338
+ # end
339
+ #
340
+ def bulk_mute_findings request, options = nil
341
+ raise ::ArgumentError, "request must be provided" if request.nil?
342
+
343
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest
344
+
345
+ # Converts hash and nil to an options object
346
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
+
348
+ # Customize the options with defaults
349
+ call_metadata = @config.rpcs.bulk_mute_findings.metadata.to_h
350
+
351
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
352
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
353
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
354
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
355
+ transports_version_send: [:rest]
356
+
357
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
358
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
+
360
+ options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout,
361
+ metadata: call_metadata,
362
+ retry_policy: @config.rpcs.bulk_mute_findings.retry_policy
363
+
364
+ options.apply_defaults timeout: @config.timeout,
365
+ metadata: @config.metadata,
366
+ retry_policy: @config.retry_policy
367
+
368
+ @security_center_stub.bulk_mute_findings request, options do |result, operation|
369
+ result = ::Gapic::Operation.new result, @operations_client, options: options
370
+ yield result, operation if block_given?
371
+ return result
372
+ end
373
+ rescue ::Gapic::Rest::Error => e
374
+ raise ::Google::Cloud::Error.from_error(e)
375
+ end
376
+
377
+ ##
378
+ # Creates a BigQuery export.
379
+ #
380
+ # @overload create_big_query_export(request, options = nil)
381
+ # Pass arguments to `create_big_query_export` via a request object, either of type
382
+ # {::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest} or an equivalent Hash.
383
+ #
384
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Hash]
385
+ # A request object representing the call parameters. Required. To specify no
386
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
387
+ # @param options [::Gapic::CallOptions, ::Hash]
388
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
389
+ #
390
+ # @overload create_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil)
391
+ # Pass arguments to `create_big_query_export` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param parent [::String]
396
+ # Required. The name of the parent resource of the new BigQuery export. Its
397
+ # format is "organizations/[organization_id]/locations/[location_id]",
398
+ # "folders/[folder_id]/locations/[location_id]", or
399
+ # "projects/[project_id]/locations/[location_id]".
400
+ # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash]
401
+ # Required. The BigQuery export being created.
402
+ # @param big_query_export_id [::String]
403
+ # Required. Unique identifier provided by the client within the parent scope.
404
+ # It must consist of only lowercase letters, numbers, and hyphens, must start
405
+ # with a letter, must end with either a letter or a number, and must be 63
406
+ # characters or less.
407
+ # @yield [result, operation] Access the result along with the TransportOperation object
408
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
409
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
410
+ #
411
+ # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
412
+ #
413
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
414
+ #
415
+ # @example Basic example
416
+ # require "google/cloud/security_center/v2"
417
+ #
418
+ # # Create a client object. The client can be reused for multiple calls.
419
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
420
+ #
421
+ # # Create a request. To set request fields, pass in keyword arguments.
422
+ # request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new
423
+ #
424
+ # # Call the create_big_query_export method.
425
+ # result = client.create_big_query_export request
426
+ #
427
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport.
428
+ # p result
429
+ #
430
+ def create_big_query_export request, options = nil
431
+ raise ::ArgumentError, "request must be provided" if request.nil?
432
+
433
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest
434
+
435
+ # Converts hash and nil to an options object
436
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
437
+
438
+ # Customize the options with defaults
439
+ call_metadata = @config.rpcs.create_big_query_export.metadata.to_h
440
+
441
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
442
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
443
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
444
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
445
+ transports_version_send: [:rest]
446
+
447
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
448
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
449
+
450
+ options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout,
451
+ metadata: call_metadata,
452
+ retry_policy: @config.rpcs.create_big_query_export.retry_policy
453
+
454
+ options.apply_defaults timeout: @config.timeout,
455
+ metadata: @config.metadata,
456
+ retry_policy: @config.retry_policy
457
+
458
+ @security_center_stub.create_big_query_export request, options do |result, operation|
459
+ yield result, operation if block_given?
460
+ return result
461
+ end
462
+ rescue ::Gapic::Rest::Error => e
463
+ raise ::Google::Cloud::Error.from_error(e)
464
+ end
465
+
466
+ ##
467
+ # Creates a finding in a location. The corresponding source must exist for
468
+ # finding creation to succeed.
469
+ #
470
+ # @overload create_finding(request, options = nil)
471
+ # Pass arguments to `create_finding` via a request object, either of type
472
+ # {::Google::Cloud::SecurityCenter::V2::CreateFindingRequest} or an equivalent Hash.
473
+ #
474
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Hash]
475
+ # A request object representing the call parameters. Required. To specify no
476
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
477
+ # @param options [::Gapic::CallOptions, ::Hash]
478
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
479
+ #
480
+ # @overload create_finding(parent: nil, finding_id: nil, finding: nil)
481
+ # Pass arguments to `create_finding` via keyword arguments. Note that at
482
+ # least one keyword argument is required. To specify no parameters, or to keep all
483
+ # the default parameter values, pass an empty Hash as a request object (see above).
484
+ #
485
+ # @param parent [::String]
486
+ # Required. Resource name of the new finding's parent. The following list
487
+ # shows some examples of the format:
488
+ # +
489
+ # `organizations/[organization_id]/sources/[source_id]`
490
+ # +
491
+ # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
492
+ # @param finding_id [::String]
493
+ # Required. Unique identifier provided by the client within the parent scope.
494
+ # It must be alphanumeric and less than or equal to 32 characters and
495
+ # greater than 0 characters in length.
496
+ # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash]
497
+ # Required. The Finding being created. The name and security_marks will be
498
+ # ignored as they are both output only fields on this resource.
499
+ # @yield [result, operation] Access the result along with the TransportOperation object
500
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding]
501
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
502
+ #
503
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
504
+ #
505
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
506
+ #
507
+ # @example Basic example
508
+ # require "google/cloud/security_center/v2"
509
+ #
510
+ # # Create a client object. The client can be reused for multiple calls.
511
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
512
+ #
513
+ # # Create a request. To set request fields, pass in keyword arguments.
514
+ # request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new
515
+ #
516
+ # # Call the create_finding method.
517
+ # result = client.create_finding request
518
+ #
519
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
520
+ # p result
521
+ #
522
+ def create_finding request, options = nil
523
+ raise ::ArgumentError, "request must be provided" if request.nil?
524
+
525
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest
526
+
527
+ # Converts hash and nil to an options object
528
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
529
+
530
+ # Customize the options with defaults
531
+ call_metadata = @config.rpcs.create_finding.metadata.to_h
532
+
533
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
534
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
535
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
536
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
537
+ transports_version_send: [:rest]
538
+
539
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
540
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
541
+
542
+ options.apply_defaults timeout: @config.rpcs.create_finding.timeout,
543
+ metadata: call_metadata,
544
+ retry_policy: @config.rpcs.create_finding.retry_policy
545
+
546
+ options.apply_defaults timeout: @config.timeout,
547
+ metadata: @config.metadata,
548
+ retry_policy: @config.retry_policy
549
+
550
+ @security_center_stub.create_finding request, options do |result, operation|
551
+ yield result, operation if block_given?
552
+ return result
553
+ end
554
+ rescue ::Gapic::Rest::Error => e
555
+ raise ::Google::Cloud::Error.from_error(e)
556
+ end
557
+
558
+ ##
559
+ # Creates a mute config.
560
+ #
561
+ # @overload create_mute_config(request, options = nil)
562
+ # Pass arguments to `create_mute_config` via a request object, either of type
563
+ # {::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest} or an equivalent Hash.
564
+ #
565
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Hash]
566
+ # A request object representing the call parameters. Required. To specify no
567
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
568
+ # @param options [::Gapic::CallOptions, ::Hash]
569
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
570
+ #
571
+ # @overload create_mute_config(parent: nil, mute_config: nil, mute_config_id: nil)
572
+ # Pass arguments to `create_mute_config` via keyword arguments. Note that at
573
+ # least one keyword argument is required. To specify no parameters, or to keep all
574
+ # the default parameter values, pass an empty Hash as a request object (see above).
575
+ #
576
+ # @param parent [::String]
577
+ # Required. Resource name of the new mute configs's parent. Its format is
578
+ # "organizations/[organization_id]/locations/[location_id]",
579
+ # "folders/[folder_id]/locations/[location_id]", or
580
+ # "projects/[project_id]/locations/[location_id]".
581
+ # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash]
582
+ # Required. The mute config being created.
583
+ # @param mute_config_id [::String]
584
+ # Required. Unique identifier provided by the client within the parent scope.
585
+ # It must consist of only lowercase letters, numbers, and hyphens, must start
586
+ # with a letter, must end with either a letter or a number, and must be 63
587
+ # characters or less.
588
+ # @yield [result, operation] Access the result along with the TransportOperation object
589
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig]
590
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
591
+ #
592
+ # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig]
593
+ #
594
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
595
+ #
596
+ # @example Basic example
597
+ # require "google/cloud/security_center/v2"
598
+ #
599
+ # # Create a client object. The client can be reused for multiple calls.
600
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
601
+ #
602
+ # # Create a request. To set request fields, pass in keyword arguments.
603
+ # request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new
604
+ #
605
+ # # Call the create_mute_config method.
606
+ # result = client.create_mute_config request
607
+ #
608
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig.
609
+ # p result
610
+ #
611
+ def create_mute_config request, options = nil
612
+ raise ::ArgumentError, "request must be provided" if request.nil?
613
+
614
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest
615
+
616
+ # Converts hash and nil to an options object
617
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
618
+
619
+ # Customize the options with defaults
620
+ call_metadata = @config.rpcs.create_mute_config.metadata.to_h
621
+
622
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
623
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
624
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
625
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
626
+ transports_version_send: [:rest]
627
+
628
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
629
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
630
+
631
+ options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout,
632
+ metadata: call_metadata,
633
+ retry_policy: @config.rpcs.create_mute_config.retry_policy
634
+
635
+ options.apply_defaults timeout: @config.timeout,
636
+ metadata: @config.metadata,
637
+ retry_policy: @config.retry_policy
638
+
639
+ @security_center_stub.create_mute_config request, options do |result, operation|
640
+ yield result, operation if block_given?
641
+ return result
642
+ end
643
+ rescue ::Gapic::Rest::Error => e
644
+ raise ::Google::Cloud::Error.from_error(e)
645
+ end
646
+
647
+ ##
648
+ # Creates a notification config.
649
+ #
650
+ # @overload create_notification_config(request, options = nil)
651
+ # Pass arguments to `create_notification_config` via a request object, either of type
652
+ # {::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest} or an equivalent Hash.
653
+ #
654
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Hash]
655
+ # A request object representing the call parameters. Required. To specify no
656
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
657
+ # @param options [::Gapic::CallOptions, ::Hash]
658
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
659
+ #
660
+ # @overload create_notification_config(parent: nil, config_id: nil, notification_config: nil)
661
+ # Pass arguments to `create_notification_config` via keyword arguments. Note that at
662
+ # least one keyword argument is required. To specify no parameters, or to keep all
663
+ # the default parameter values, pass an empty Hash as a request object (see above).
664
+ #
665
+ # @param parent [::String]
666
+ # Required. Resource name of the new notification config's parent. Its format
667
+ # is "organizations/[organization_id]/locations/[location_id]",
668
+ # "folders/[folder_id]/locations/[location_id]", or
669
+ # "projects/[project_id]/locations/[location_id]".
670
+ # @param config_id [::String]
671
+ # Required.
672
+ # Unique identifier provided by the client within the parent scope.
673
+ # It must be between 1 and 128 characters and contain alphanumeric
674
+ # characters, underscores, or hyphens only.
675
+ # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash]
676
+ # Required. The notification config being created. The name and the service
677
+ # account will be ignored as they are both output only fields on this
678
+ # resource.
679
+ # @yield [result, operation] Access the result along with the TransportOperation object
680
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
681
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
682
+ #
683
+ # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
684
+ #
685
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
686
+ #
687
+ # @example Basic example
688
+ # require "google/cloud/security_center/v2"
689
+ #
690
+ # # Create a client object. The client can be reused for multiple calls.
691
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
692
+ #
693
+ # # Create a request. To set request fields, pass in keyword arguments.
694
+ # request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new
695
+ #
696
+ # # Call the create_notification_config method.
697
+ # result = client.create_notification_config request
698
+ #
699
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig.
700
+ # p result
701
+ #
702
+ def create_notification_config request, options = nil
703
+ raise ::ArgumentError, "request must be provided" if request.nil?
704
+
705
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest
706
+
707
+ # Converts hash and nil to an options object
708
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
709
+
710
+ # Customize the options with defaults
711
+ call_metadata = @config.rpcs.create_notification_config.metadata.to_h
712
+
713
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
714
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
715
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
716
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
717
+ transports_version_send: [:rest]
718
+
719
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
720
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
721
+
722
+ options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout,
723
+ metadata: call_metadata,
724
+ retry_policy: @config.rpcs.create_notification_config.retry_policy
725
+
726
+ options.apply_defaults timeout: @config.timeout,
727
+ metadata: @config.metadata,
728
+ retry_policy: @config.retry_policy
729
+
730
+ @security_center_stub.create_notification_config request, options do |result, operation|
731
+ yield result, operation if block_given?
732
+ return result
733
+ end
734
+ rescue ::Gapic::Rest::Error => e
735
+ raise ::Google::Cloud::Error.from_error(e)
736
+ end
737
+
738
+ ##
739
+ # Creates a source.
740
+ #
741
+ # @overload create_source(request, options = nil)
742
+ # Pass arguments to `create_source` via a request object, either of type
743
+ # {::Google::Cloud::SecurityCenter::V2::CreateSourceRequest} or an equivalent Hash.
744
+ #
745
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Hash]
746
+ # A request object representing the call parameters. Required. To specify no
747
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
748
+ # @param options [::Gapic::CallOptions, ::Hash]
749
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
750
+ #
751
+ # @overload create_source(parent: nil, source: nil)
752
+ # Pass arguments to `create_source` via keyword arguments. Note that at
753
+ # least one keyword argument is required. To specify no parameters, or to keep all
754
+ # the default parameter values, pass an empty Hash as a request object (see above).
755
+ #
756
+ # @param parent [::String]
757
+ # Required. Resource name of the new source's parent. Its format should be
758
+ # "organizations/[organization_id]".
759
+ # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash]
760
+ # Required. The Source being created, only the display_name and description
761
+ # will be used. All other fields will be ignored.
762
+ # @yield [result, operation] Access the result along with the TransportOperation object
763
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source]
764
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
765
+ #
766
+ # @return [::Google::Cloud::SecurityCenter::V2::Source]
767
+ #
768
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
769
+ #
770
+ # @example Basic example
771
+ # require "google/cloud/security_center/v2"
772
+ #
773
+ # # Create a client object. The client can be reused for multiple calls.
774
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
775
+ #
776
+ # # Create a request. To set request fields, pass in keyword arguments.
777
+ # request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new
778
+ #
779
+ # # Call the create_source method.
780
+ # result = client.create_source request
781
+ #
782
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source.
783
+ # p result
784
+ #
785
+ def create_source request, options = nil
786
+ raise ::ArgumentError, "request must be provided" if request.nil?
787
+
788
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest
789
+
790
+ # Converts hash and nil to an options object
791
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
792
+
793
+ # Customize the options with defaults
794
+ call_metadata = @config.rpcs.create_source.metadata.to_h
795
+
796
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
797
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
798
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
799
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
800
+ transports_version_send: [:rest]
801
+
802
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
803
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
804
+
805
+ options.apply_defaults timeout: @config.rpcs.create_source.timeout,
806
+ metadata: call_metadata,
807
+ retry_policy: @config.rpcs.create_source.retry_policy
808
+
809
+ options.apply_defaults timeout: @config.timeout,
810
+ metadata: @config.metadata,
811
+ retry_policy: @config.retry_policy
812
+
813
+ @security_center_stub.create_source request, options do |result, operation|
814
+ yield result, operation if block_given?
815
+ return result
816
+ end
817
+ rescue ::Gapic::Rest::Error => e
818
+ raise ::Google::Cloud::Error.from_error(e)
819
+ end
820
+
821
+ ##
822
+ # Deletes an existing BigQuery export.
823
+ #
824
+ # @overload delete_big_query_export(request, options = nil)
825
+ # Pass arguments to `delete_big_query_export` via a request object, either of type
826
+ # {::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest} or an equivalent Hash.
827
+ #
828
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Hash]
829
+ # A request object representing the call parameters. Required. To specify no
830
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
831
+ # @param options [::Gapic::CallOptions, ::Hash]
832
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
833
+ #
834
+ # @overload delete_big_query_export(name: nil)
835
+ # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at
836
+ # least one keyword argument is required. To specify no parameters, or to keep all
837
+ # the default parameter values, pass an empty Hash as a request object (see above).
838
+ #
839
+ # @param name [::String]
840
+ # Required. The name of the BigQuery export to delete. The following list
841
+ # shows some examples of the format:
842
+ #
843
+ # +
844
+ # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
845
+ # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
846
+ # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}`
847
+ # @yield [result, operation] Access the result along with the TransportOperation object
848
+ # @yieldparam result [::Google::Protobuf::Empty]
849
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
850
+ #
851
+ # @return [::Google::Protobuf::Empty]
852
+ #
853
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
854
+ #
855
+ # @example Basic example
856
+ # require "google/cloud/security_center/v2"
857
+ #
858
+ # # Create a client object. The client can be reused for multiple calls.
859
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
860
+ #
861
+ # # Create a request. To set request fields, pass in keyword arguments.
862
+ # request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new
863
+ #
864
+ # # Call the delete_big_query_export method.
865
+ # result = client.delete_big_query_export request
866
+ #
867
+ # # The returned object is of type Google::Protobuf::Empty.
868
+ # p result
869
+ #
870
+ def delete_big_query_export request, options = nil
871
+ raise ::ArgumentError, "request must be provided" if request.nil?
872
+
873
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest
874
+
875
+ # Converts hash and nil to an options object
876
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
877
+
878
+ # Customize the options with defaults
879
+ call_metadata = @config.rpcs.delete_big_query_export.metadata.to_h
880
+
881
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
882
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
883
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
884
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
885
+ transports_version_send: [:rest]
886
+
887
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
888
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
889
+
890
+ options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout,
891
+ metadata: call_metadata,
892
+ retry_policy: @config.rpcs.delete_big_query_export.retry_policy
893
+
894
+ options.apply_defaults timeout: @config.timeout,
895
+ metadata: @config.metadata,
896
+ retry_policy: @config.retry_policy
897
+
898
+ @security_center_stub.delete_big_query_export request, options do |result, operation|
899
+ yield result, operation if block_given?
900
+ return result
901
+ end
902
+ rescue ::Gapic::Rest::Error => e
903
+ raise ::Google::Cloud::Error.from_error(e)
904
+ end
905
+
906
+ ##
907
+ # Deletes an existing mute config. If no location is specified, default is
908
+ # global.
909
+ #
910
+ # @overload delete_mute_config(request, options = nil)
911
+ # Pass arguments to `delete_mute_config` via a request object, either of type
912
+ # {::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest} or an equivalent Hash.
913
+ #
914
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Hash]
915
+ # A request object representing the call parameters. Required. To specify no
916
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
917
+ # @param options [::Gapic::CallOptions, ::Hash]
918
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
919
+ #
920
+ # @overload delete_mute_config(name: nil)
921
+ # Pass arguments to `delete_mute_config` via keyword arguments. Note that at
922
+ # least one keyword argument is required. To specify no parameters, or to keep all
923
+ # the default parameter values, pass an empty Hash as a request object (see above).
924
+ #
925
+ # @param name [::String]
926
+ # Required. Name of the mute config to delete. The following list shows some
927
+ # examples of the format:
928
+ #
929
+ # + `organizations/{organization}/muteConfigs/{config_id}`
930
+ # +
931
+ # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
932
+ # + `folders/{folder}/muteConfigs/{config_id}`
933
+ # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
934
+ # + `projects/{project}/muteConfigs/{config_id}`
935
+ # + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
936
+ # @yield [result, operation] Access the result along with the TransportOperation object
937
+ # @yieldparam result [::Google::Protobuf::Empty]
938
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
939
+ #
940
+ # @return [::Google::Protobuf::Empty]
941
+ #
942
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
943
+ #
944
+ # @example Basic example
945
+ # require "google/cloud/security_center/v2"
946
+ #
947
+ # # Create a client object. The client can be reused for multiple calls.
948
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
949
+ #
950
+ # # Create a request. To set request fields, pass in keyword arguments.
951
+ # request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new
952
+ #
953
+ # # Call the delete_mute_config method.
954
+ # result = client.delete_mute_config request
955
+ #
956
+ # # The returned object is of type Google::Protobuf::Empty.
957
+ # p result
958
+ #
959
+ def delete_mute_config request, options = nil
960
+ raise ::ArgumentError, "request must be provided" if request.nil?
961
+
962
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest
963
+
964
+ # Converts hash and nil to an options object
965
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
966
+
967
+ # Customize the options with defaults
968
+ call_metadata = @config.rpcs.delete_mute_config.metadata.to_h
969
+
970
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
971
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
972
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
973
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
974
+ transports_version_send: [:rest]
975
+
976
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
977
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
978
+
979
+ options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout,
980
+ metadata: call_metadata,
981
+ retry_policy: @config.rpcs.delete_mute_config.retry_policy
982
+
983
+ options.apply_defaults timeout: @config.timeout,
984
+ metadata: @config.metadata,
985
+ retry_policy: @config.retry_policy
986
+
987
+ @security_center_stub.delete_mute_config request, options do |result, operation|
988
+ yield result, operation if block_given?
989
+ return result
990
+ end
991
+ rescue ::Gapic::Rest::Error => e
992
+ raise ::Google::Cloud::Error.from_error(e)
993
+ end
994
+
995
+ ##
996
+ # Deletes a notification config.
997
+ #
998
+ # @overload delete_notification_config(request, options = nil)
999
+ # Pass arguments to `delete_notification_config` via a request object, either of type
1000
+ # {::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest} or an equivalent Hash.
1001
+ #
1002
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Hash]
1003
+ # A request object representing the call parameters. Required. To specify no
1004
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1005
+ # @param options [::Gapic::CallOptions, ::Hash]
1006
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1007
+ #
1008
+ # @overload delete_notification_config(name: nil)
1009
+ # Pass arguments to `delete_notification_config` via keyword arguments. Note that at
1010
+ # least one keyword argument is required. To specify no parameters, or to keep all
1011
+ # the default parameter values, pass an empty Hash as a request object (see above).
1012
+ #
1013
+ # @param name [::String]
1014
+ # Required. Name of the notification config to delete. The following list
1015
+ # shows some examples of the format:
1016
+ #
1017
+ # +
1018
+ # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
1019
+ # +
1020
+ # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]`
1021
+ # +
1022
+ # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]`
1023
+ # @yield [result, operation] Access the result along with the TransportOperation object
1024
+ # @yieldparam result [::Google::Protobuf::Empty]
1025
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1026
+ #
1027
+ # @return [::Google::Protobuf::Empty]
1028
+ #
1029
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1030
+ #
1031
+ # @example Basic example
1032
+ # require "google/cloud/security_center/v2"
1033
+ #
1034
+ # # Create a client object. The client can be reused for multiple calls.
1035
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1036
+ #
1037
+ # # Create a request. To set request fields, pass in keyword arguments.
1038
+ # request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new
1039
+ #
1040
+ # # Call the delete_notification_config method.
1041
+ # result = client.delete_notification_config request
1042
+ #
1043
+ # # The returned object is of type Google::Protobuf::Empty.
1044
+ # p result
1045
+ #
1046
+ def delete_notification_config request, options = nil
1047
+ raise ::ArgumentError, "request must be provided" if request.nil?
1048
+
1049
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest
1050
+
1051
+ # Converts hash and nil to an options object
1052
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1053
+
1054
+ # Customize the options with defaults
1055
+ call_metadata = @config.rpcs.delete_notification_config.metadata.to_h
1056
+
1057
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1058
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1059
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1060
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1061
+ transports_version_send: [:rest]
1062
+
1063
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1064
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1065
+
1066
+ options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout,
1067
+ metadata: call_metadata,
1068
+ retry_policy: @config.rpcs.delete_notification_config.retry_policy
1069
+
1070
+ options.apply_defaults timeout: @config.timeout,
1071
+ metadata: @config.metadata,
1072
+ retry_policy: @config.retry_policy
1073
+
1074
+ @security_center_stub.delete_notification_config request, options do |result, operation|
1075
+ yield result, operation if block_given?
1076
+ return result
1077
+ end
1078
+ rescue ::Gapic::Rest::Error => e
1079
+ raise ::Google::Cloud::Error.from_error(e)
1080
+ end
1081
+
1082
+ ##
1083
+ # Deletes a ResourceValueConfig.
1084
+ #
1085
+ # @overload delete_resource_value_config(request, options = nil)
1086
+ # Pass arguments to `delete_resource_value_config` via a request object, either of type
1087
+ # {::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest} or an equivalent Hash.
1088
+ #
1089
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Hash]
1090
+ # A request object representing the call parameters. Required. To specify no
1091
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1092
+ # @param options [::Gapic::CallOptions, ::Hash]
1093
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1094
+ #
1095
+ # @overload delete_resource_value_config(name: nil)
1096
+ # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at
1097
+ # least one keyword argument is required. To specify no parameters, or to keep all
1098
+ # the default parameter values, pass an empty Hash as a request object (see above).
1099
+ #
1100
+ # @param name [::String]
1101
+ # Required. Name of the ResourceValueConfig to delete
1102
+ # @yield [result, operation] Access the result along with the TransportOperation object
1103
+ # @yieldparam result [::Google::Protobuf::Empty]
1104
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1105
+ #
1106
+ # @return [::Google::Protobuf::Empty]
1107
+ #
1108
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1109
+ #
1110
+ # @example Basic example
1111
+ # require "google/cloud/security_center/v2"
1112
+ #
1113
+ # # Create a client object. The client can be reused for multiple calls.
1114
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1115
+ #
1116
+ # # Create a request. To set request fields, pass in keyword arguments.
1117
+ # request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new
1118
+ #
1119
+ # # Call the delete_resource_value_config method.
1120
+ # result = client.delete_resource_value_config request
1121
+ #
1122
+ # # The returned object is of type Google::Protobuf::Empty.
1123
+ # p result
1124
+ #
1125
+ def delete_resource_value_config request, options = nil
1126
+ raise ::ArgumentError, "request must be provided" if request.nil?
1127
+
1128
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest
1129
+
1130
+ # Converts hash and nil to an options object
1131
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1132
+
1133
+ # Customize the options with defaults
1134
+ call_metadata = @config.rpcs.delete_resource_value_config.metadata.to_h
1135
+
1136
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1137
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1138
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1139
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1140
+ transports_version_send: [:rest]
1141
+
1142
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1143
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1144
+
1145
+ options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout,
1146
+ metadata: call_metadata,
1147
+ retry_policy: @config.rpcs.delete_resource_value_config.retry_policy
1148
+
1149
+ options.apply_defaults timeout: @config.timeout,
1150
+ metadata: @config.metadata,
1151
+ retry_policy: @config.retry_policy
1152
+
1153
+ @security_center_stub.delete_resource_value_config request, options do |result, operation|
1154
+ yield result, operation if block_given?
1155
+ return result
1156
+ end
1157
+ rescue ::Gapic::Rest::Error => e
1158
+ raise ::Google::Cloud::Error.from_error(e)
1159
+ end
1160
+
1161
+ ##
1162
+ # Gets a BigQuery export.
1163
+ #
1164
+ # @overload get_big_query_export(request, options = nil)
1165
+ # Pass arguments to `get_big_query_export` via a request object, either of type
1166
+ # {::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest} or an equivalent Hash.
1167
+ #
1168
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Hash]
1169
+ # A request object representing the call parameters. Required. To specify no
1170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1171
+ # @param options [::Gapic::CallOptions, ::Hash]
1172
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1173
+ #
1174
+ # @overload get_big_query_export(name: nil)
1175
+ # Pass arguments to `get_big_query_export` via keyword arguments. Note that at
1176
+ # least one keyword argument is required. To specify no parameters, or to keep all
1177
+ # the default parameter values, pass an empty Hash as a request object (see above).
1178
+ #
1179
+ # @param name [::String]
1180
+ # Required. Name of the BigQuery export to retrieve. The following list shows
1181
+ # some examples of the format:
1182
+ #
1183
+ # +
1184
+ # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
1185
+ # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
1186
+ # + `projects/{project}locations/{location}//bigQueryExports/{export_id}`
1187
+ # @yield [result, operation] Access the result along with the TransportOperation object
1188
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
1189
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1190
+ #
1191
+ # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
1192
+ #
1193
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1194
+ #
1195
+ # @example Basic example
1196
+ # require "google/cloud/security_center/v2"
1197
+ #
1198
+ # # Create a client object. The client can be reused for multiple calls.
1199
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1200
+ #
1201
+ # # Create a request. To set request fields, pass in keyword arguments.
1202
+ # request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new
1203
+ #
1204
+ # # Call the get_big_query_export method.
1205
+ # result = client.get_big_query_export request
1206
+ #
1207
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport.
1208
+ # p result
1209
+ #
1210
+ def get_big_query_export request, options = nil
1211
+ raise ::ArgumentError, "request must be provided" if request.nil?
1212
+
1213
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest
1214
+
1215
+ # Converts hash and nil to an options object
1216
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1217
+
1218
+ # Customize the options with defaults
1219
+ call_metadata = @config.rpcs.get_big_query_export.metadata.to_h
1220
+
1221
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1222
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1223
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1224
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1225
+ transports_version_send: [:rest]
1226
+
1227
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1228
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1229
+
1230
+ options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout,
1231
+ metadata: call_metadata,
1232
+ retry_policy: @config.rpcs.get_big_query_export.retry_policy
1233
+
1234
+ options.apply_defaults timeout: @config.timeout,
1235
+ metadata: @config.metadata,
1236
+ retry_policy: @config.retry_policy
1237
+
1238
+ @security_center_stub.get_big_query_export request, options do |result, operation|
1239
+ yield result, operation if block_given?
1240
+ return result
1241
+ end
1242
+ rescue ::Gapic::Rest::Error => e
1243
+ raise ::Google::Cloud::Error.from_error(e)
1244
+ end
1245
+
1246
+ ##
1247
+ # Get the simulation by name or the latest simulation for the given
1248
+ # organization.
1249
+ #
1250
+ # @overload get_simulation(request, options = nil)
1251
+ # Pass arguments to `get_simulation` via a request object, either of type
1252
+ # {::Google::Cloud::SecurityCenter::V2::GetSimulationRequest} or an equivalent Hash.
1253
+ #
1254
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Hash]
1255
+ # A request object representing the call parameters. Required. To specify no
1256
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1257
+ # @param options [::Gapic::CallOptions, ::Hash]
1258
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1259
+ #
1260
+ # @overload get_simulation(name: nil)
1261
+ # Pass arguments to `get_simulation` via keyword arguments. Note that at
1262
+ # least one keyword argument is required. To specify no parameters, or to keep all
1263
+ # the default parameter values, pass an empty Hash as a request object (see above).
1264
+ #
1265
+ # @param name [::String]
1266
+ # Required. The organization name or simulation name of this simulation
1267
+ #
1268
+ # Valid format:
1269
+ # "organizations/\\{organization}/simulations/latest"
1270
+ # "organizations/\\{organization}/simulations/\\{simulation}"
1271
+ # @yield [result, operation] Access the result along with the TransportOperation object
1272
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Simulation]
1273
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1274
+ #
1275
+ # @return [::Google::Cloud::SecurityCenter::V2::Simulation]
1276
+ #
1277
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1278
+ #
1279
+ # @example Basic example
1280
+ # require "google/cloud/security_center/v2"
1281
+ #
1282
+ # # Create a client object. The client can be reused for multiple calls.
1283
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1284
+ #
1285
+ # # Create a request. To set request fields, pass in keyword arguments.
1286
+ # request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new
1287
+ #
1288
+ # # Call the get_simulation method.
1289
+ # result = client.get_simulation request
1290
+ #
1291
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation.
1292
+ # p result
1293
+ #
1294
+ def get_simulation request, options = nil
1295
+ raise ::ArgumentError, "request must be provided" if request.nil?
1296
+
1297
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest
1298
+
1299
+ # Converts hash and nil to an options object
1300
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1301
+
1302
+ # Customize the options with defaults
1303
+ call_metadata = @config.rpcs.get_simulation.metadata.to_h
1304
+
1305
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1306
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1307
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1308
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1309
+ transports_version_send: [:rest]
1310
+
1311
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1312
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1313
+
1314
+ options.apply_defaults timeout: @config.rpcs.get_simulation.timeout,
1315
+ metadata: call_metadata,
1316
+ retry_policy: @config.rpcs.get_simulation.retry_policy
1317
+
1318
+ options.apply_defaults timeout: @config.timeout,
1319
+ metadata: @config.metadata,
1320
+ retry_policy: @config.retry_policy
1321
+
1322
+ @security_center_stub.get_simulation request, options do |result, operation|
1323
+ yield result, operation if block_given?
1324
+ return result
1325
+ end
1326
+ rescue ::Gapic::Rest::Error => e
1327
+ raise ::Google::Cloud::Error.from_error(e)
1328
+ end
1329
+
1330
+ ##
1331
+ # Get the valued resource by name
1332
+ #
1333
+ # @overload get_valued_resource(request, options = nil)
1334
+ # Pass arguments to `get_valued_resource` via a request object, either of type
1335
+ # {::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest} or an equivalent Hash.
1336
+ #
1337
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Hash]
1338
+ # A request object representing the call parameters. Required. To specify no
1339
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1340
+ # @param options [::Gapic::CallOptions, ::Hash]
1341
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1342
+ #
1343
+ # @overload get_valued_resource(name: nil)
1344
+ # Pass arguments to `get_valued_resource` via keyword arguments. Note that at
1345
+ # least one keyword argument is required. To specify no parameters, or to keep all
1346
+ # the default parameter values, pass an empty Hash as a request object (see above).
1347
+ #
1348
+ # @param name [::String]
1349
+ # Required. The name of this valued resource
1350
+ #
1351
+ # Valid format:
1352
+ # "organizations/\\{organization}/simulations/\\{simulation}/valuedResources/\\{valued_resource}"
1353
+ # @yield [result, operation] Access the result along with the TransportOperation object
1354
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ValuedResource]
1355
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1356
+ #
1357
+ # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource]
1358
+ #
1359
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1360
+ #
1361
+ # @example Basic example
1362
+ # require "google/cloud/security_center/v2"
1363
+ #
1364
+ # # Create a client object. The client can be reused for multiple calls.
1365
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1366
+ #
1367
+ # # Create a request. To set request fields, pass in keyword arguments.
1368
+ # request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new
1369
+ #
1370
+ # # Call the get_valued_resource method.
1371
+ # result = client.get_valued_resource request
1372
+ #
1373
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource.
1374
+ # p result
1375
+ #
1376
+ def get_valued_resource request, options = nil
1377
+ raise ::ArgumentError, "request must be provided" if request.nil?
1378
+
1379
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest
1380
+
1381
+ # Converts hash and nil to an options object
1382
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1383
+
1384
+ # Customize the options with defaults
1385
+ call_metadata = @config.rpcs.get_valued_resource.metadata.to_h
1386
+
1387
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1388
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1389
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1390
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1391
+ transports_version_send: [:rest]
1392
+
1393
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1394
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1395
+
1396
+ options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout,
1397
+ metadata: call_metadata,
1398
+ retry_policy: @config.rpcs.get_valued_resource.retry_policy
1399
+
1400
+ options.apply_defaults timeout: @config.timeout,
1401
+ metadata: @config.metadata,
1402
+ retry_policy: @config.retry_policy
1403
+
1404
+ @security_center_stub.get_valued_resource request, options do |result, operation|
1405
+ yield result, operation if block_given?
1406
+ return result
1407
+ end
1408
+ rescue ::Gapic::Rest::Error => e
1409
+ raise ::Google::Cloud::Error.from_error(e)
1410
+ end
1411
+
1412
+ ##
1413
+ # Gets the access control policy on the specified Source.
1414
+ #
1415
+ # @overload get_iam_policy(request, options = nil)
1416
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1417
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1418
+ #
1419
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1420
+ # A request object representing the call parameters. Required. To specify no
1421
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1422
+ # @param options [::Gapic::CallOptions, ::Hash]
1423
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1424
+ #
1425
+ # @overload get_iam_policy(resource: nil, options: nil)
1426
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1427
+ # least one keyword argument is required. To specify no parameters, or to keep all
1428
+ # the default parameter values, pass an empty Hash as a request object (see above).
1429
+ #
1430
+ # @param resource [::String]
1431
+ # REQUIRED: The resource for which the policy is being requested.
1432
+ # See the operation documentation for the appropriate value for this field.
1433
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1434
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1435
+ # `GetIamPolicy`.
1436
+ # @yield [result, operation] Access the result along with the TransportOperation object
1437
+ # @yieldparam result [::Google::Iam::V1::Policy]
1438
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1439
+ #
1440
+ # @return [::Google::Iam::V1::Policy]
1441
+ #
1442
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1443
+ #
1444
+ # @example Basic example
1445
+ # require "google/cloud/security_center/v2"
1446
+ #
1447
+ # # Create a client object. The client can be reused for multiple calls.
1448
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1449
+ #
1450
+ # # Create a request. To set request fields, pass in keyword arguments.
1451
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1452
+ #
1453
+ # # Call the get_iam_policy method.
1454
+ # result = client.get_iam_policy request
1455
+ #
1456
+ # # The returned object is of type Google::Iam::V1::Policy.
1457
+ # p result
1458
+ #
1459
+ def get_iam_policy request, options = nil
1460
+ raise ::ArgumentError, "request must be provided" if request.nil?
1461
+
1462
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1463
+
1464
+ # Converts hash and nil to an options object
1465
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1466
+
1467
+ # Customize the options with defaults
1468
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
1469
+
1470
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1471
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1472
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1473
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1474
+ transports_version_send: [:rest]
1475
+
1476
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1477
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1478
+
1479
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1480
+ metadata: call_metadata,
1481
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1482
+
1483
+ options.apply_defaults timeout: @config.timeout,
1484
+ metadata: @config.metadata,
1485
+ retry_policy: @config.retry_policy
1486
+
1487
+ @security_center_stub.get_iam_policy request, options do |result, operation|
1488
+ yield result, operation if block_given?
1489
+ return result
1490
+ end
1491
+ rescue ::Gapic::Rest::Error => e
1492
+ raise ::Google::Cloud::Error.from_error(e)
1493
+ end
1494
+
1495
+ ##
1496
+ # Gets a mute config. If no location is specified, default is
1497
+ # global.
1498
+ #
1499
+ # @overload get_mute_config(request, options = nil)
1500
+ # Pass arguments to `get_mute_config` via a request object, either of type
1501
+ # {::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest} or an equivalent Hash.
1502
+ #
1503
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Hash]
1504
+ # A request object representing the call parameters. Required. To specify no
1505
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1506
+ # @param options [::Gapic::CallOptions, ::Hash]
1507
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1508
+ #
1509
+ # @overload get_mute_config(name: nil)
1510
+ # Pass arguments to `get_mute_config` via keyword arguments. Note that at
1511
+ # least one keyword argument is required. To specify no parameters, or to keep all
1512
+ # the default parameter values, pass an empty Hash as a request object (see above).
1513
+ #
1514
+ # @param name [::String]
1515
+ # Required. Name of the mute config to retrieve. The following list shows
1516
+ # some examples of the format:
1517
+ #
1518
+ # + `organizations/{organization}/muteConfigs/{config_id}`
1519
+ # +
1520
+ # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
1521
+ # + `folders/{folder}/muteConfigs/{config_id}`
1522
+ # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
1523
+ # + `projects/{project}/muteConfigs/{config_id}`
1524
+ # + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
1525
+ # @yield [result, operation] Access the result along with the TransportOperation object
1526
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig]
1527
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1528
+ #
1529
+ # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig]
1530
+ #
1531
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1532
+ #
1533
+ # @example Basic example
1534
+ # require "google/cloud/security_center/v2"
1535
+ #
1536
+ # # Create a client object. The client can be reused for multiple calls.
1537
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1538
+ #
1539
+ # # Create a request. To set request fields, pass in keyword arguments.
1540
+ # request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new
1541
+ #
1542
+ # # Call the get_mute_config method.
1543
+ # result = client.get_mute_config request
1544
+ #
1545
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig.
1546
+ # p result
1547
+ #
1548
+ def get_mute_config request, options = nil
1549
+ raise ::ArgumentError, "request must be provided" if request.nil?
1550
+
1551
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest
1552
+
1553
+ # Converts hash and nil to an options object
1554
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1555
+
1556
+ # Customize the options with defaults
1557
+ call_metadata = @config.rpcs.get_mute_config.metadata.to_h
1558
+
1559
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1560
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1561
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1562
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1563
+ transports_version_send: [:rest]
1564
+
1565
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1566
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1567
+
1568
+ options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout,
1569
+ metadata: call_metadata,
1570
+ retry_policy: @config.rpcs.get_mute_config.retry_policy
1571
+
1572
+ options.apply_defaults timeout: @config.timeout,
1573
+ metadata: @config.metadata,
1574
+ retry_policy: @config.retry_policy
1575
+
1576
+ @security_center_stub.get_mute_config request, options do |result, operation|
1577
+ yield result, operation if block_given?
1578
+ return result
1579
+ end
1580
+ rescue ::Gapic::Rest::Error => e
1581
+ raise ::Google::Cloud::Error.from_error(e)
1582
+ end
1583
+
1584
+ ##
1585
+ # Gets a notification config.
1586
+ #
1587
+ # @overload get_notification_config(request, options = nil)
1588
+ # Pass arguments to `get_notification_config` via a request object, either of type
1589
+ # {::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest} or an equivalent Hash.
1590
+ #
1591
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Hash]
1592
+ # A request object representing the call parameters. Required. To specify no
1593
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1594
+ # @param options [::Gapic::CallOptions, ::Hash]
1595
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1596
+ #
1597
+ # @overload get_notification_config(name: nil)
1598
+ # Pass arguments to `get_notification_config` via keyword arguments. Note that at
1599
+ # least one keyword argument is required. To specify no parameters, or to keep all
1600
+ # the default parameter values, pass an empty Hash as a request object (see above).
1601
+ #
1602
+ # @param name [::String]
1603
+ # Required. Name of the notification config to get. The following list shows
1604
+ # some examples of the format:
1605
+ #
1606
+ # +
1607
+ # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
1608
+ # +
1609
+ # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]`
1610
+ # +
1611
+ # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]`
1612
+ # @yield [result, operation] Access the result along with the TransportOperation object
1613
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
1614
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1615
+ #
1616
+ # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
1617
+ #
1618
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1619
+ #
1620
+ # @example Basic example
1621
+ # require "google/cloud/security_center/v2"
1622
+ #
1623
+ # # Create a client object. The client can be reused for multiple calls.
1624
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1625
+ #
1626
+ # # Create a request. To set request fields, pass in keyword arguments.
1627
+ # request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new
1628
+ #
1629
+ # # Call the get_notification_config method.
1630
+ # result = client.get_notification_config request
1631
+ #
1632
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig.
1633
+ # p result
1634
+ #
1635
+ def get_notification_config request, options = nil
1636
+ raise ::ArgumentError, "request must be provided" if request.nil?
1637
+
1638
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest
1639
+
1640
+ # Converts hash and nil to an options object
1641
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1642
+
1643
+ # Customize the options with defaults
1644
+ call_metadata = @config.rpcs.get_notification_config.metadata.to_h
1645
+
1646
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1647
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1648
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1649
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1650
+ transports_version_send: [:rest]
1651
+
1652
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1653
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1654
+
1655
+ options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout,
1656
+ metadata: call_metadata,
1657
+ retry_policy: @config.rpcs.get_notification_config.retry_policy
1658
+
1659
+ options.apply_defaults timeout: @config.timeout,
1660
+ metadata: @config.metadata,
1661
+ retry_policy: @config.retry_policy
1662
+
1663
+ @security_center_stub.get_notification_config request, options do |result, operation|
1664
+ yield result, operation if block_given?
1665
+ return result
1666
+ end
1667
+ rescue ::Gapic::Rest::Error => e
1668
+ raise ::Google::Cloud::Error.from_error(e)
1669
+ end
1670
+
1671
+ ##
1672
+ # Gets a ResourceValueConfig.
1673
+ #
1674
+ # @overload get_resource_value_config(request, options = nil)
1675
+ # Pass arguments to `get_resource_value_config` via a request object, either of type
1676
+ # {::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest} or an equivalent Hash.
1677
+ #
1678
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Hash]
1679
+ # A request object representing the call parameters. Required. To specify no
1680
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1681
+ # @param options [::Gapic::CallOptions, ::Hash]
1682
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1683
+ #
1684
+ # @overload get_resource_value_config(name: nil)
1685
+ # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at
1686
+ # least one keyword argument is required. To specify no parameters, or to keep all
1687
+ # the default parameter values, pass an empty Hash as a request object (see above).
1688
+ #
1689
+ # @param name [::String]
1690
+ # Required. Name of the resource value config to retrieve. Its format is
1691
+ # organizations/\\{organization}/resourceValueConfigs/\\{config_id}.
1692
+ # @yield [result, operation] Access the result along with the TransportOperation object
1693
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
1694
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1695
+ #
1696
+ # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
1697
+ #
1698
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1699
+ #
1700
+ # @example Basic example
1701
+ # require "google/cloud/security_center/v2"
1702
+ #
1703
+ # # Create a client object. The client can be reused for multiple calls.
1704
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1705
+ #
1706
+ # # Create a request. To set request fields, pass in keyword arguments.
1707
+ # request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new
1708
+ #
1709
+ # # Call the get_resource_value_config method.
1710
+ # result = client.get_resource_value_config request
1711
+ #
1712
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig.
1713
+ # p result
1714
+ #
1715
+ def get_resource_value_config request, options = nil
1716
+ raise ::ArgumentError, "request must be provided" if request.nil?
1717
+
1718
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest
1719
+
1720
+ # Converts hash and nil to an options object
1721
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1722
+
1723
+ # Customize the options with defaults
1724
+ call_metadata = @config.rpcs.get_resource_value_config.metadata.to_h
1725
+
1726
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1727
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1728
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1729
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1730
+ transports_version_send: [:rest]
1731
+
1732
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1733
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1734
+
1735
+ options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout,
1736
+ metadata: call_metadata,
1737
+ retry_policy: @config.rpcs.get_resource_value_config.retry_policy
1738
+
1739
+ options.apply_defaults timeout: @config.timeout,
1740
+ metadata: @config.metadata,
1741
+ retry_policy: @config.retry_policy
1742
+
1743
+ @security_center_stub.get_resource_value_config request, options do |result, operation|
1744
+ yield result, operation if block_given?
1745
+ return result
1746
+ end
1747
+ rescue ::Gapic::Rest::Error => e
1748
+ raise ::Google::Cloud::Error.from_error(e)
1749
+ end
1750
+
1751
+ ##
1752
+ # Gets a source.
1753
+ #
1754
+ # @overload get_source(request, options = nil)
1755
+ # Pass arguments to `get_source` via a request object, either of type
1756
+ # {::Google::Cloud::SecurityCenter::V2::GetSourceRequest} or an equivalent Hash.
1757
+ #
1758
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Hash]
1759
+ # A request object representing the call parameters. Required. To specify no
1760
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1761
+ # @param options [::Gapic::CallOptions, ::Hash]
1762
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1763
+ #
1764
+ # @overload get_source(name: nil)
1765
+ # Pass arguments to `get_source` via keyword arguments. Note that at
1766
+ # least one keyword argument is required. To specify no parameters, or to keep all
1767
+ # the default parameter values, pass an empty Hash as a request object (see above).
1768
+ #
1769
+ # @param name [::String]
1770
+ # Required. Relative resource name of the source. Its format is
1771
+ # "organizations/[organization_id]/source/[source_id]".
1772
+ # @yield [result, operation] Access the result along with the TransportOperation object
1773
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source]
1774
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1775
+ #
1776
+ # @return [::Google::Cloud::SecurityCenter::V2::Source]
1777
+ #
1778
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1779
+ #
1780
+ # @example Basic example
1781
+ # require "google/cloud/security_center/v2"
1782
+ #
1783
+ # # Create a client object. The client can be reused for multiple calls.
1784
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1785
+ #
1786
+ # # Create a request. To set request fields, pass in keyword arguments.
1787
+ # request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new
1788
+ #
1789
+ # # Call the get_source method.
1790
+ # result = client.get_source request
1791
+ #
1792
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source.
1793
+ # p result
1794
+ #
1795
+ def get_source request, options = nil
1796
+ raise ::ArgumentError, "request must be provided" if request.nil?
1797
+
1798
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSourceRequest
1799
+
1800
+ # Converts hash and nil to an options object
1801
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1802
+
1803
+ # Customize the options with defaults
1804
+ call_metadata = @config.rpcs.get_source.metadata.to_h
1805
+
1806
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1807
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1808
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1809
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1810
+ transports_version_send: [:rest]
1811
+
1812
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1813
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1814
+
1815
+ options.apply_defaults timeout: @config.rpcs.get_source.timeout,
1816
+ metadata: call_metadata,
1817
+ retry_policy: @config.rpcs.get_source.retry_policy
1818
+
1819
+ options.apply_defaults timeout: @config.timeout,
1820
+ metadata: @config.metadata,
1821
+ retry_policy: @config.retry_policy
1822
+
1823
+ @security_center_stub.get_source request, options do |result, operation|
1824
+ yield result, operation if block_given?
1825
+ return result
1826
+ end
1827
+ rescue ::Gapic::Rest::Error => e
1828
+ raise ::Google::Cloud::Error.from_error(e)
1829
+ end
1830
+
1831
+ ##
1832
+ # Filters an organization or source's findings and groups them by their
1833
+ # specified properties in a location. If no location is specified, findings
1834
+ # are assumed to be in global
1835
+ #
1836
+ # To group across all sources provide a `-` as the source id.
1837
+ # The following list shows some examples:
1838
+ #
1839
+ # + `/v2/organizations/{organization_id}/sources/-/findings`
1840
+ # +
1841
+ # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings`
1842
+ # + `/v2/folders/{folder_id}/sources/-/findings`
1843
+ # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings`
1844
+ # + `/v2/projects/{project_id}/sources/-/findings`
1845
+ # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings`
1846
+ #
1847
+ # @overload group_findings(request, options = nil)
1848
+ # Pass arguments to `group_findings` via a request object, either of type
1849
+ # {::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest} or an equivalent Hash.
1850
+ #
1851
+ # @param request [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Hash]
1852
+ # A request object representing the call parameters. Required. To specify no
1853
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1854
+ # @param options [::Gapic::CallOptions, ::Hash]
1855
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1856
+ #
1857
+ # @overload group_findings(parent: nil, filter: nil, group_by: nil, page_token: nil, page_size: nil)
1858
+ # Pass arguments to `group_findings` via keyword arguments. Note that at
1859
+ # least one keyword argument is required. To specify no parameters, or to keep all
1860
+ # the default parameter values, pass an empty Hash as a request object (see above).
1861
+ #
1862
+ # @param parent [::String]
1863
+ # Required. Name of the source to groupBy. If no location is specified,
1864
+ # finding is assumed to be in global.
1865
+ # The following list shows some examples:
1866
+ #
1867
+ # + `organizations/[organization_id]/sources/[source_id]`
1868
+ # +
1869
+ # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
1870
+ # + `folders/[folder_id]/sources/[source_id]`
1871
+ # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
1872
+ # + `projects/[project_id]/sources/[source_id]`
1873
+ # + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
1874
+ #
1875
+ # To groupBy across all sources provide a source_id of `-`. The following
1876
+ # list shows some examples:
1877
+ #
1878
+ # + `organizations/{organization_id}/sources/-`
1879
+ # + `organizations/{organization_id}/sources/-/locations/[location_id]`
1880
+ # + `folders/{folder_id}/sources/-`
1881
+ # + `folders/{folder_id}/sources/-/locations/[location_id]`
1882
+ # + `projects/{project_id}/sources/-`
1883
+ # + `projects/{project_id}/sources/-/locations/[location_id]`
1884
+ # @param filter [::String]
1885
+ # Expression that defines the filter to apply across findings.
1886
+ # The expression is a list of one or more restrictions combined via logical
1887
+ # operators `AND` and `OR`.
1888
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
1889
+ #
1890
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
1891
+ # character in front of them to indicate negation. Examples include:
1892
+ #
1893
+ # * name
1894
+ # * security_marks.marks.marka
1895
+ #
1896
+ # The supported operators are:
1897
+ #
1898
+ # * `=` for all value types.
1899
+ # * `>`, `<`, `>=`, `<=` for integer values.
1900
+ # * `:`, meaning substring matching, for strings.
1901
+ #
1902
+ # The supported value types are:
1903
+ #
1904
+ # * string literals in quotes.
1905
+ # * integer literals without quotes.
1906
+ # * boolean literals `true` and `false` without quotes.
1907
+ #
1908
+ # The following field and operator combinations are supported:
1909
+ #
1910
+ # * name: `=`
1911
+ # * parent: `=`, `:`
1912
+ # * resource_name: `=`, `:`
1913
+ # * state: `=`, `:`
1914
+ # * category: `=`, `:`
1915
+ # * external_uri: `=`, `:`
1916
+ # * event_time: `=`, `>`, `<`, `>=`, `<=`
1917
+ #
1918
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
1919
+ # Examples:
1920
+ # `event_time = "2019-06-10T16:07:18-07:00"`
1921
+ # `event_time = 1560208038000`
1922
+ #
1923
+ # * severity: `=`, `:`
1924
+ # * security_marks.marks: `=`, `:`
1925
+ # * resource:
1926
+ # * resource.name: `=`, `:`
1927
+ # * resource.parent_name: `=`, `:`
1928
+ # * resource.parent_display_name: `=`, `:`
1929
+ # * resource.project_name: `=`, `:`
1930
+ # * resource.project_display_name: `=`, `:`
1931
+ # * resource.type: `=`, `:`
1932
+ # @param group_by [::String]
1933
+ # Required. Expression that defines what assets fields to use for grouping.
1934
+ # The string value should follow SQL syntax: comma separated list of fields.
1935
+ # For example: "parent,resource_name".
1936
+ #
1937
+ # The following fields are supported:
1938
+ #
1939
+ # * resource_name
1940
+ # * category
1941
+ # * state
1942
+ # * parent
1943
+ # * severity
1944
+ # @param page_token [::String]
1945
+ # The value returned by the last `GroupFindingsResponse`; indicates
1946
+ # that this is a continuation of a prior `GroupFindings` call, and
1947
+ # that the system should return the next page of data.
1948
+ # @param page_size [::Integer]
1949
+ # The maximum number of results to return in a single response. Default is
1950
+ # 10, minimum is 1, maximum is 1000.
1951
+ # @yield [result, operation] Access the result along with the TransportOperation object
1952
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>]
1953
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1954
+ #
1955
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>]
1956
+ #
1957
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1958
+ #
1959
+ # @example Basic example
1960
+ # require "google/cloud/security_center/v2"
1961
+ #
1962
+ # # Create a client object. The client can be reused for multiple calls.
1963
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
1964
+ #
1965
+ # # Create a request. To set request fields, pass in keyword arguments.
1966
+ # request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new
1967
+ #
1968
+ # # Call the group_findings method.
1969
+ # result = client.group_findings request
1970
+ #
1971
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1972
+ # # over elements, and API calls will be issued to fetch pages as needed.
1973
+ # result.each do |item|
1974
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult.
1975
+ # p item
1976
+ # end
1977
+ #
1978
+ def group_findings request, options = nil
1979
+ raise ::ArgumentError, "request must be provided" if request.nil?
1980
+
1981
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest
1982
+
1983
+ # Converts hash and nil to an options object
1984
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1985
+
1986
+ # Customize the options with defaults
1987
+ call_metadata = @config.rpcs.group_findings.metadata.to_h
1988
+
1989
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1990
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1991
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1992
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
1993
+ transports_version_send: [:rest]
1994
+
1995
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1996
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1997
+
1998
+ options.apply_defaults timeout: @config.rpcs.group_findings.timeout,
1999
+ metadata: call_metadata,
2000
+ retry_policy: @config.rpcs.group_findings.retry_policy
2001
+
2002
+ options.apply_defaults timeout: @config.timeout,
2003
+ metadata: @config.metadata,
2004
+ retry_policy: @config.retry_policy
2005
+
2006
+ @security_center_stub.group_findings request, options do |result, operation|
2007
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", request, result, options
2008
+ yield result, operation if block_given?
2009
+ return result
2010
+ end
2011
+ rescue ::Gapic::Rest::Error => e
2012
+ raise ::Google::Cloud::Error.from_error(e)
2013
+ end
2014
+
2015
+ ##
2016
+ # Lists the attack paths for a set of simulation results or valued resources
2017
+ # and filter.
2018
+ #
2019
+ # @overload list_attack_paths(request, options = nil)
2020
+ # Pass arguments to `list_attack_paths` via a request object, either of type
2021
+ # {::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest} or an equivalent Hash.
2022
+ #
2023
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Hash]
2024
+ # A request object representing the call parameters. Required. To specify no
2025
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2026
+ # @param options [::Gapic::CallOptions, ::Hash]
2027
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2028
+ #
2029
+ # @overload list_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil)
2030
+ # Pass arguments to `list_attack_paths` via keyword arguments. Note that at
2031
+ # least one keyword argument is required. To specify no parameters, or to keep all
2032
+ # the default parameter values, pass an empty Hash as a request object (see above).
2033
+ #
2034
+ # @param parent [::String]
2035
+ # Required. Name of parent to list attack paths.
2036
+ #
2037
+ # Valid formats:
2038
+ # "organizations/\\{organization}",
2039
+ # "organizations/\\{organization}/simulations/\\{simulation}"
2040
+ # "organizations/\\{organization}/simulations/\\{simulation}/attackExposureResults/\\{attack_exposure_result_v2}"
2041
+ # "organizations/\\{organization}/simulations/\\{simulation}/valuedResources/\\{valued_resource}"
2042
+ # @param filter [::String]
2043
+ # The filter expression that filters the attack path in the response.
2044
+ # Supported fields:
2045
+ #
2046
+ # * `valued_resources` supports =
2047
+ # @param page_token [::String]
2048
+ # The value returned by the last `ListAttackPathsResponse`; indicates
2049
+ # that this is a continuation of a prior `ListAttackPaths` call, and
2050
+ # that the system should return the next page of data.
2051
+ # @param page_size [::Integer]
2052
+ # The maximum number of results to return in a single response. Default is
2053
+ # 10, minimum is 1, maximum is 1000.
2054
+ # @yield [result, operation] Access the result along with the TransportOperation object
2055
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>]
2056
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2057
+ #
2058
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>]
2059
+ #
2060
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2061
+ #
2062
+ # @example Basic example
2063
+ # require "google/cloud/security_center/v2"
2064
+ #
2065
+ # # Create a client object. The client can be reused for multiple calls.
2066
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2067
+ #
2068
+ # # Create a request. To set request fields, pass in keyword arguments.
2069
+ # request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new
2070
+ #
2071
+ # # Call the list_attack_paths method.
2072
+ # result = client.list_attack_paths request
2073
+ #
2074
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2075
+ # # over elements, and API calls will be issued to fetch pages as needed.
2076
+ # result.each do |item|
2077
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath.
2078
+ # p item
2079
+ # end
2080
+ #
2081
+ def list_attack_paths request, options = nil
2082
+ raise ::ArgumentError, "request must be provided" if request.nil?
2083
+
2084
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest
2085
+
2086
+ # Converts hash and nil to an options object
2087
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2088
+
2089
+ # Customize the options with defaults
2090
+ call_metadata = @config.rpcs.list_attack_paths.metadata.to_h
2091
+
2092
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2093
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2094
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2095
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2096
+ transports_version_send: [:rest]
2097
+
2098
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2099
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2100
+
2101
+ options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout,
2102
+ metadata: call_metadata,
2103
+ retry_policy: @config.rpcs.list_attack_paths.retry_policy
2104
+
2105
+ options.apply_defaults timeout: @config.timeout,
2106
+ metadata: @config.metadata,
2107
+ retry_policy: @config.retry_policy
2108
+
2109
+ @security_center_stub.list_attack_paths request, options do |result, operation|
2110
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_attack_paths, "attack_paths", request, result, options
2111
+ yield result, operation if block_given?
2112
+ return result
2113
+ end
2114
+ rescue ::Gapic::Rest::Error => e
2115
+ raise ::Google::Cloud::Error.from_error(e)
2116
+ end
2117
+
2118
+ ##
2119
+ # Lists BigQuery exports. Note that when requesting BigQuery exports at a
2120
+ # given level all exports under that level are also returned e.g. if
2121
+ # requesting BigQuery exports under a folder, then all BigQuery exports
2122
+ # immediately under the folder plus the ones created under the projects
2123
+ # within the folder are returned.
2124
+ #
2125
+ # @overload list_big_query_exports(request, options = nil)
2126
+ # Pass arguments to `list_big_query_exports` via a request object, either of type
2127
+ # {::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest} or an equivalent Hash.
2128
+ #
2129
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Hash]
2130
+ # A request object representing the call parameters. Required. To specify no
2131
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2132
+ # @param options [::Gapic::CallOptions, ::Hash]
2133
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2134
+ #
2135
+ # @overload list_big_query_exports(parent: nil, page_size: nil, page_token: nil)
2136
+ # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at
2137
+ # least one keyword argument is required. To specify no parameters, or to keep all
2138
+ # the default parameter values, pass an empty Hash as a request object (see above).
2139
+ #
2140
+ # @param parent [::String]
2141
+ # Required. The parent, which owns the collection of BigQuery exports. Its
2142
+ # format is "organizations/[organization_id]/locations/[location_id]",
2143
+ # "folders/[folder_id]/locations/[location_id]", or
2144
+ # "projects/[project_id]/locations/[location_id]".
2145
+ # @param page_size [::Integer]
2146
+ # The maximum number of configs to return. The service may return fewer than
2147
+ # this value.
2148
+ # If unspecified, at most 10 configs will be returned.
2149
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2150
+ # @param page_token [::String]
2151
+ # A page token, received from a previous `ListBigQueryExports` call.
2152
+ # Provide this to retrieve the subsequent page.
2153
+ # When paginating, all other parameters provided to `ListBigQueryExports`
2154
+ # must match the call that provided the page token.
2155
+ # @yield [result, operation] Access the result along with the TransportOperation object
2156
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>]
2157
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2158
+ #
2159
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>]
2160
+ #
2161
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2162
+ #
2163
+ # @example Basic example
2164
+ # require "google/cloud/security_center/v2"
2165
+ #
2166
+ # # Create a client object. The client can be reused for multiple calls.
2167
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2168
+ #
2169
+ # # Create a request. To set request fields, pass in keyword arguments.
2170
+ # request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new
2171
+ #
2172
+ # # Call the list_big_query_exports method.
2173
+ # result = client.list_big_query_exports request
2174
+ #
2175
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2176
+ # # over elements, and API calls will be issued to fetch pages as needed.
2177
+ # result.each do |item|
2178
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport.
2179
+ # p item
2180
+ # end
2181
+ #
2182
+ def list_big_query_exports request, options = nil
2183
+ raise ::ArgumentError, "request must be provided" if request.nil?
2184
+
2185
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest
2186
+
2187
+ # Converts hash and nil to an options object
2188
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2189
+
2190
+ # Customize the options with defaults
2191
+ call_metadata = @config.rpcs.list_big_query_exports.metadata.to_h
2192
+
2193
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2194
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2195
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2196
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2197
+ transports_version_send: [:rest]
2198
+
2199
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2200
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2201
+
2202
+ options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout,
2203
+ metadata: call_metadata,
2204
+ retry_policy: @config.rpcs.list_big_query_exports.retry_policy
2205
+
2206
+ options.apply_defaults timeout: @config.timeout,
2207
+ metadata: @config.metadata,
2208
+ retry_policy: @config.retry_policy
2209
+
2210
+ @security_center_stub.list_big_query_exports request, options do |result, operation|
2211
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_big_query_exports, "big_query_exports", request, result, options
2212
+ yield result, operation if block_given?
2213
+ return result
2214
+ end
2215
+ rescue ::Gapic::Rest::Error => e
2216
+ raise ::Google::Cloud::Error.from_error(e)
2217
+ end
2218
+
2219
+ ##
2220
+ # Lists an organization or source's findings.
2221
+ #
2222
+ # To list across all sources for a given location provide a `-` as the source
2223
+ # id. If no location is specified, finding are assumed to be in global.
2224
+ # The following list shows some examples:
2225
+ #
2226
+ # + `/v2/organizations/{organization_id}/sources/-/findings`
2227
+ # +
2228
+ # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings`
2229
+ #
2230
+ # @overload list_findings(request, options = nil)
2231
+ # Pass arguments to `list_findings` via a request object, either of type
2232
+ # {::Google::Cloud::SecurityCenter::V2::ListFindingsRequest} or an equivalent Hash.
2233
+ #
2234
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Hash]
2235
+ # A request object representing the call parameters. Required. To specify no
2236
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2237
+ # @param options [::Gapic::CallOptions, ::Hash]
2238
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2239
+ #
2240
+ # @overload list_findings(parent: nil, filter: nil, order_by: nil, field_mask: nil, page_token: nil, page_size: nil)
2241
+ # Pass arguments to `list_findings` via keyword arguments. Note that at
2242
+ # least one keyword argument is required. To specify no parameters, or to keep all
2243
+ # the default parameter values, pass an empty Hash as a request object (see above).
2244
+ #
2245
+ # @param parent [::String]
2246
+ # Required. Name of the source the findings belong to. If no location is
2247
+ # specified, the default is global. The following list shows some examples:
2248
+ #
2249
+ # + `organizations/[organization_id]/sources/[source_id]`
2250
+ # +
2251
+ # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
2252
+ # + `folders/[folder_id]/sources/[source_id]`
2253
+ # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
2254
+ # + `projects/[project_id]/sources/[source_id]`
2255
+ # + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
2256
+ #
2257
+ # To list across all sources provide a source_id of `-`. The following
2258
+ # list shows some examples:
2259
+ #
2260
+ # + `organizations/{organization_id}/sources/-`
2261
+ # + `organizations/{organization_id}/sources/-/locations/{location_id}`
2262
+ # + `folders/{folder_id}/sources/-`
2263
+ # + `folders/{folder_id}/sources/-locations/{location_id}`
2264
+ # + `projects/{projects_id}/sources/-`
2265
+ # + `projects/{projects_id}/sources/-/locations/{location_id}`
2266
+ # @param filter [::String]
2267
+ # Expression that defines the filter to apply across findings.
2268
+ # The expression is a list of one or more restrictions combined via logical
2269
+ # operators `AND` and `OR`.
2270
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
2271
+ #
2272
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
2273
+ # character in front of them to indicate negation. Examples include:
2274
+ #
2275
+ # * name
2276
+ # * security_marks.marks.marka
2277
+ #
2278
+ # The supported operators are:
2279
+ #
2280
+ # * `=` for all value types.
2281
+ # * `>`, `<`, `>=`, `<=` for integer values.
2282
+ # * `:`, meaning substring matching, for strings.
2283
+ #
2284
+ # The supported value types are:
2285
+ #
2286
+ # * string literals in quotes.
2287
+ # * integer literals without quotes.
2288
+ # * boolean literals `true` and `false` without quotes.
2289
+ #
2290
+ # The following field and operator combinations are supported:
2291
+ #
2292
+ # * name: `=`
2293
+ # * parent: `=`, `:`
2294
+ # * resource_name: `=`, `:`
2295
+ # * state: `=`, `:`
2296
+ # * category: `=`, `:`
2297
+ # * external_uri: `=`, `:`
2298
+ # * event_time: `=`, `>`, `<`, `>=`, `<=`
2299
+ #
2300
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
2301
+ # Examples:
2302
+ # `event_time = "2019-06-10T16:07:18-07:00"`
2303
+ # `event_time = 1560208038000`
2304
+ #
2305
+ # * severity: `=`, `:`
2306
+ # * security_marks.marks: `=`, `:`
2307
+ # * resource:
2308
+ # * resource.name: `=`, `:`
2309
+ # * resource.parent_name: `=`, `:`
2310
+ # * resource.parent_display_name: `=`, `:`
2311
+ # * resource.project_name: `=`, `:`
2312
+ # * resource.project_display_name: `=`, `:`
2313
+ # * resource.type: `=`, `:`
2314
+ # * resource.folders.resource_folder: `=`, `:`
2315
+ # * resource.display_name: `=`, `:`
2316
+ # @param order_by [::String]
2317
+ # Expression that defines what fields and order to use for sorting. The
2318
+ # string value should follow SQL syntax: comma separated list of fields. For
2319
+ # example: "name,parent". The default sorting order
2320
+ # is ascending. To specify descending order for a field, a suffix " desc"
2321
+ # should be appended to the field name. For example: "name
2322
+ # desc,parent". Redundant space characters in the
2323
+ # syntax are insignificant. "name desc,parent" and "
2324
+ # name desc , parent " are equivalent.
2325
+ #
2326
+ # The following fields are supported:
2327
+ # name
2328
+ # parent
2329
+ # state
2330
+ # category
2331
+ # resource_name
2332
+ # event_time
2333
+ # security_marks.marks
2334
+ # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
2335
+ # A field mask to specify the Finding fields to be listed in the response.
2336
+ # An empty field mask will list all fields.
2337
+ # @param page_token [::String]
2338
+ # The value returned by the last `ListFindingsResponse`; indicates
2339
+ # that this is a continuation of a prior `ListFindings` call, and
2340
+ # that the system should return the next page of data.
2341
+ # @param page_size [::Integer]
2342
+ # The maximum number of results to return in a single response. Default is
2343
+ # 10, minimum is 1, maximum is 1000.
2344
+ # @yield [result, operation] Access the result along with the TransportOperation object
2345
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>]
2346
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2347
+ #
2348
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>]
2349
+ #
2350
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2351
+ #
2352
+ # @example Basic example
2353
+ # require "google/cloud/security_center/v2"
2354
+ #
2355
+ # # Create a client object. The client can be reused for multiple calls.
2356
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2357
+ #
2358
+ # # Create a request. To set request fields, pass in keyword arguments.
2359
+ # request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new
2360
+ #
2361
+ # # Call the list_findings method.
2362
+ # result = client.list_findings request
2363
+ #
2364
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2365
+ # # over elements, and API calls will be issued to fetch pages as needed.
2366
+ # result.each do |item|
2367
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult.
2368
+ # p item
2369
+ # end
2370
+ #
2371
+ def list_findings request, options = nil
2372
+ raise ::ArgumentError, "request must be provided" if request.nil?
2373
+
2374
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest
2375
+
2376
+ # Converts hash and nil to an options object
2377
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2378
+
2379
+ # Customize the options with defaults
2380
+ call_metadata = @config.rpcs.list_findings.metadata.to_h
2381
+
2382
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2383
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2384
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2385
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2386
+ transports_version_send: [:rest]
2387
+
2388
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2389
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2390
+
2391
+ options.apply_defaults timeout: @config.rpcs.list_findings.timeout,
2392
+ metadata: call_metadata,
2393
+ retry_policy: @config.rpcs.list_findings.retry_policy
2394
+
2395
+ options.apply_defaults timeout: @config.timeout,
2396
+ metadata: @config.metadata,
2397
+ retry_policy: @config.retry_policy
2398
+
2399
+ @security_center_stub.list_findings request, options do |result, operation|
2400
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", request, result, options
2401
+ yield result, operation if block_given?
2402
+ return result
2403
+ end
2404
+ rescue ::Gapic::Rest::Error => e
2405
+ raise ::Google::Cloud::Error.from_error(e)
2406
+ end
2407
+
2408
+ ##
2409
+ # Lists mute configs. If no location is specified, default is
2410
+ # global.
2411
+ #
2412
+ # @overload list_mute_configs(request, options = nil)
2413
+ # Pass arguments to `list_mute_configs` via a request object, either of type
2414
+ # {::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest} or an equivalent Hash.
2415
+ #
2416
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Hash]
2417
+ # A request object representing the call parameters. Required. To specify no
2418
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2419
+ # @param options [::Gapic::CallOptions, ::Hash]
2420
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2421
+ #
2422
+ # @overload list_mute_configs(parent: nil, page_size: nil, page_token: nil)
2423
+ # Pass arguments to `list_mute_configs` via keyword arguments. Note that at
2424
+ # least one keyword argument is required. To specify no parameters, or to keep all
2425
+ # the default parameter values, pass an empty Hash as a request object (see above).
2426
+ #
2427
+ # @param parent [::String]
2428
+ # Required. The parent, which owns the collection of mute configs. Its format
2429
+ # is "organizations/[organization_id]", "folders/[folder_id]",
2430
+ # "projects/[project_id]",
2431
+ # "organizations/[organization_id]/locations/[location_id]",
2432
+ # "folders/[folder_id]/locations/[location_id]",
2433
+ # "projects/[project_id]/locations/[location_id]".
2434
+ # @param page_size [::Integer]
2435
+ # The maximum number of configs to return. The service may return fewer than
2436
+ # this value.
2437
+ # If unspecified, at most 10 configs will be returned.
2438
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2439
+ # @param page_token [::String]
2440
+ # A page token, received from a previous `ListMuteConfigs` call.
2441
+ # Provide this to retrieve the subsequent page.
2442
+ #
2443
+ # When paginating, all other parameters provided to `ListMuteConfigs` must
2444
+ # match the call that provided the page token.
2445
+ # @yield [result, operation] Access the result along with the TransportOperation object
2446
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>]
2447
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2448
+ #
2449
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>]
2450
+ #
2451
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2452
+ #
2453
+ # @example Basic example
2454
+ # require "google/cloud/security_center/v2"
2455
+ #
2456
+ # # Create a client object. The client can be reused for multiple calls.
2457
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2458
+ #
2459
+ # # Create a request. To set request fields, pass in keyword arguments.
2460
+ # request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new
2461
+ #
2462
+ # # Call the list_mute_configs method.
2463
+ # result = client.list_mute_configs request
2464
+ #
2465
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2466
+ # # over elements, and API calls will be issued to fetch pages as needed.
2467
+ # result.each do |item|
2468
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig.
2469
+ # p item
2470
+ # end
2471
+ #
2472
+ def list_mute_configs request, options = nil
2473
+ raise ::ArgumentError, "request must be provided" if request.nil?
2474
+
2475
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest
2476
+
2477
+ # Converts hash and nil to an options object
2478
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2479
+
2480
+ # Customize the options with defaults
2481
+ call_metadata = @config.rpcs.list_mute_configs.metadata.to_h
2482
+
2483
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2484
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2485
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2486
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2487
+ transports_version_send: [:rest]
2488
+
2489
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2490
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2491
+
2492
+ options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout,
2493
+ metadata: call_metadata,
2494
+ retry_policy: @config.rpcs.list_mute_configs.retry_policy
2495
+
2496
+ options.apply_defaults timeout: @config.timeout,
2497
+ metadata: @config.metadata,
2498
+ retry_policy: @config.retry_policy
2499
+
2500
+ @security_center_stub.list_mute_configs request, options do |result, operation|
2501
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_mute_configs, "mute_configs", request, result, options
2502
+ yield result, operation if block_given?
2503
+ return result
2504
+ end
2505
+ rescue ::Gapic::Rest::Error => e
2506
+ raise ::Google::Cloud::Error.from_error(e)
2507
+ end
2508
+
2509
+ ##
2510
+ # Lists notification configs.
2511
+ #
2512
+ # @overload list_notification_configs(request, options = nil)
2513
+ # Pass arguments to `list_notification_configs` via a request object, either of type
2514
+ # {::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest} or an equivalent Hash.
2515
+ #
2516
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Hash]
2517
+ # A request object representing the call parameters. Required. To specify no
2518
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2519
+ # @param options [::Gapic::CallOptions, ::Hash]
2520
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2521
+ #
2522
+ # @overload list_notification_configs(parent: nil, page_token: nil, page_size: nil)
2523
+ # Pass arguments to `list_notification_configs` via keyword arguments. Note that at
2524
+ # least one keyword argument is required. To specify no parameters, or to keep all
2525
+ # the default parameter values, pass an empty Hash as a request object (see above).
2526
+ #
2527
+ # @param parent [::String]
2528
+ # Required. The name of the parent in which to list the notification
2529
+ # configurations. Its format is
2530
+ # "organizations/[organization_id]/locations/[location_id]",
2531
+ # "folders/[folder_id]/locations/[location_id]", or
2532
+ # "projects/[project_id]/locations/[location_id]".
2533
+ # @param page_token [::String]
2534
+ # The value returned by the last `ListNotificationConfigsResponse`; indicates
2535
+ # that this is a continuation of a prior `ListNotificationConfigs` call, and
2536
+ # that the system should return the next page of data.
2537
+ # @param page_size [::Integer]
2538
+ # The maximum number of results to return in a single response. Default is
2539
+ # 10, minimum is 1, maximum is 1000.
2540
+ # @yield [result, operation] Access the result along with the TransportOperation object
2541
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>]
2542
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2543
+ #
2544
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>]
2545
+ #
2546
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2547
+ #
2548
+ # @example Basic example
2549
+ # require "google/cloud/security_center/v2"
2550
+ #
2551
+ # # Create a client object. The client can be reused for multiple calls.
2552
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2553
+ #
2554
+ # # Create a request. To set request fields, pass in keyword arguments.
2555
+ # request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new
2556
+ #
2557
+ # # Call the list_notification_configs method.
2558
+ # result = client.list_notification_configs request
2559
+ #
2560
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2561
+ # # over elements, and API calls will be issued to fetch pages as needed.
2562
+ # result.each do |item|
2563
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig.
2564
+ # p item
2565
+ # end
2566
+ #
2567
+ def list_notification_configs request, options = nil
2568
+ raise ::ArgumentError, "request must be provided" if request.nil?
2569
+
2570
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest
2571
+
2572
+ # Converts hash and nil to an options object
2573
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2574
+
2575
+ # Customize the options with defaults
2576
+ call_metadata = @config.rpcs.list_notification_configs.metadata.to_h
2577
+
2578
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2579
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2581
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2582
+ transports_version_send: [:rest]
2583
+
2584
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2585
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2586
+
2587
+ options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout,
2588
+ metadata: call_metadata,
2589
+ retry_policy: @config.rpcs.list_notification_configs.retry_policy
2590
+
2591
+ options.apply_defaults timeout: @config.timeout,
2592
+ metadata: @config.metadata,
2593
+ retry_policy: @config.retry_policy
2594
+
2595
+ @security_center_stub.list_notification_configs request, options do |result, operation|
2596
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", request, result, options
2597
+ yield result, operation if block_given?
2598
+ return result
2599
+ end
2600
+ rescue ::Gapic::Rest::Error => e
2601
+ raise ::Google::Cloud::Error.from_error(e)
2602
+ end
2603
+
2604
+ ##
2605
+ # Lists all ResourceValueConfigs.
2606
+ #
2607
+ # @overload list_resource_value_configs(request, options = nil)
2608
+ # Pass arguments to `list_resource_value_configs` via a request object, either of type
2609
+ # {::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest} or an equivalent Hash.
2610
+ #
2611
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Hash]
2612
+ # A request object representing the call parameters. Required. To specify no
2613
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2614
+ # @param options [::Gapic::CallOptions, ::Hash]
2615
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2616
+ #
2617
+ # @overload list_resource_value_configs(parent: nil, page_size: nil, page_token: nil)
2618
+ # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at
2619
+ # least one keyword argument is required. To specify no parameters, or to keep all
2620
+ # the default parameter values, pass an empty Hash as a request object (see above).
2621
+ #
2622
+ # @param parent [::String]
2623
+ # Required. The parent, which owns the collection of resource value configs.
2624
+ # Its format is
2625
+ # "organizations/[organization_id]"
2626
+ # @param page_size [::Integer]
2627
+ # The maximum number of configs to return. The service may return fewer than
2628
+ # this value.
2629
+ # If unspecified, at most 10 configs will be returned.
2630
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2631
+ # @param page_token [::String]
2632
+ # A page token, received from a previous `ListResourceValueConfigs` call.
2633
+ # Provide this to retrieve the subsequent page.
2634
+ #
2635
+ # When paginating, all other parameters provided to
2636
+ # `ListResourceValueConfigs` must match the call that provided the
2637
+ # page token.
2638
+ #
2639
+ # page_size can be specified, and the new page_size will be used.
2640
+ # @yield [result, operation] Access the result along with the TransportOperation object
2641
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>]
2642
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2643
+ #
2644
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>]
2645
+ #
2646
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2647
+ #
2648
+ # @example Basic example
2649
+ # require "google/cloud/security_center/v2"
2650
+ #
2651
+ # # Create a client object. The client can be reused for multiple calls.
2652
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2653
+ #
2654
+ # # Create a request. To set request fields, pass in keyword arguments.
2655
+ # request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new
2656
+ #
2657
+ # # Call the list_resource_value_configs method.
2658
+ # result = client.list_resource_value_configs request
2659
+ #
2660
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2661
+ # # over elements, and API calls will be issued to fetch pages as needed.
2662
+ # result.each do |item|
2663
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.
2664
+ # p item
2665
+ # end
2666
+ #
2667
+ def list_resource_value_configs request, options = nil
2668
+ raise ::ArgumentError, "request must be provided" if request.nil?
2669
+
2670
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest
2671
+
2672
+ # Converts hash and nil to an options object
2673
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2674
+
2675
+ # Customize the options with defaults
2676
+ call_metadata = @config.rpcs.list_resource_value_configs.metadata.to_h
2677
+
2678
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2679
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2680
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2681
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2682
+ transports_version_send: [:rest]
2683
+
2684
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2685
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2686
+
2687
+ options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout,
2688
+ metadata: call_metadata,
2689
+ retry_policy: @config.rpcs.list_resource_value_configs.retry_policy
2690
+
2691
+ options.apply_defaults timeout: @config.timeout,
2692
+ metadata: @config.metadata,
2693
+ retry_policy: @config.retry_policy
2694
+
2695
+ @security_center_stub.list_resource_value_configs request, options do |result, operation|
2696
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, "resource_value_configs", request, result, options
2697
+ yield result, operation if block_given?
2698
+ return result
2699
+ end
2700
+ rescue ::Gapic::Rest::Error => e
2701
+ raise ::Google::Cloud::Error.from_error(e)
2702
+ end
2703
+
2704
+ ##
2705
+ # Lists all sources belonging to an organization.
2706
+ #
2707
+ # @overload list_sources(request, options = nil)
2708
+ # Pass arguments to `list_sources` via a request object, either of type
2709
+ # {::Google::Cloud::SecurityCenter::V2::ListSourcesRequest} or an equivalent Hash.
2710
+ #
2711
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Hash]
2712
+ # A request object representing the call parameters. Required. To specify no
2713
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2714
+ # @param options [::Gapic::CallOptions, ::Hash]
2715
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2716
+ #
2717
+ # @overload list_sources(parent: nil, page_token: nil, page_size: nil)
2718
+ # Pass arguments to `list_sources` via keyword arguments. Note that at
2719
+ # least one keyword argument is required. To specify no parameters, or to keep all
2720
+ # the default parameter values, pass an empty Hash as a request object (see above).
2721
+ #
2722
+ # @param parent [::String]
2723
+ # Required. Resource name of the parent of sources to list. Its format should
2724
+ # be "organizations/[organization_id]", "folders/[folder_id]", or
2725
+ # "projects/[project_id]".
2726
+ # @param page_token [::String]
2727
+ # The value returned by the last `ListSourcesResponse`; indicates
2728
+ # that this is a continuation of a prior `ListSources` call, and
2729
+ # that the system should return the next page of data.
2730
+ # @param page_size [::Integer]
2731
+ # The maximum number of results to return in a single response. Default is
2732
+ # 10, minimum is 1, maximum is 1000.
2733
+ # @yield [result, operation] Access the result along with the TransportOperation object
2734
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>]
2735
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2736
+ #
2737
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>]
2738
+ #
2739
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2740
+ #
2741
+ # @example Basic example
2742
+ # require "google/cloud/security_center/v2"
2743
+ #
2744
+ # # Create a client object. The client can be reused for multiple calls.
2745
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2746
+ #
2747
+ # # Create a request. To set request fields, pass in keyword arguments.
2748
+ # request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new
2749
+ #
2750
+ # # Call the list_sources method.
2751
+ # result = client.list_sources request
2752
+ #
2753
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2754
+ # # over elements, and API calls will be issued to fetch pages as needed.
2755
+ # result.each do |item|
2756
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source.
2757
+ # p item
2758
+ # end
2759
+ #
2760
+ def list_sources request, options = nil
2761
+ raise ::ArgumentError, "request must be provided" if request.nil?
2762
+
2763
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest
2764
+
2765
+ # Converts hash and nil to an options object
2766
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2767
+
2768
+ # Customize the options with defaults
2769
+ call_metadata = @config.rpcs.list_sources.metadata.to_h
2770
+
2771
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2772
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2773
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2774
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2775
+ transports_version_send: [:rest]
2776
+
2777
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2778
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2779
+
2780
+ options.apply_defaults timeout: @config.rpcs.list_sources.timeout,
2781
+ metadata: call_metadata,
2782
+ retry_policy: @config.rpcs.list_sources.retry_policy
2783
+
2784
+ options.apply_defaults timeout: @config.timeout,
2785
+ metadata: @config.metadata,
2786
+ retry_policy: @config.retry_policy
2787
+
2788
+ @security_center_stub.list_sources request, options do |result, operation|
2789
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", request, result, options
2790
+ yield result, operation if block_given?
2791
+ return result
2792
+ end
2793
+ rescue ::Gapic::Rest::Error => e
2794
+ raise ::Google::Cloud::Error.from_error(e)
2795
+ end
2796
+
2797
+ ##
2798
+ # Lists the valued resources for a set of simulation results and filter.
2799
+ #
2800
+ # @overload list_valued_resources(request, options = nil)
2801
+ # Pass arguments to `list_valued_resources` via a request object, either of type
2802
+ # {::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest} or an equivalent Hash.
2803
+ #
2804
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Hash]
2805
+ # A request object representing the call parameters. Required. To specify no
2806
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2807
+ # @param options [::Gapic::CallOptions, ::Hash]
2808
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2809
+ #
2810
+ # @overload list_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil)
2811
+ # Pass arguments to `list_valued_resources` via keyword arguments. Note that at
2812
+ # least one keyword argument is required. To specify no parameters, or to keep all
2813
+ # the default parameter values, pass an empty Hash as a request object (see above).
2814
+ #
2815
+ # @param parent [::String]
2816
+ # Required. Name of parent to list exposed resources.
2817
+ #
2818
+ # Valid formats:
2819
+ # "organizations/\\{organization}",
2820
+ # "organizations/\\{organization}/simulations/\\{simulation}"
2821
+ # "organizations/\\{organization}/simulations/\\{simulation}/attackExposureResults/\\{attack_exposure_result_v2}"
2822
+ # @param filter [::String]
2823
+ # The filter expression that filters the valued resources in the response.
2824
+ # Supported fields:
2825
+ #
2826
+ # * `resource_value` supports =
2827
+ # * `resource_type` supports =
2828
+ # @param page_token [::String]
2829
+ # The value returned by the last `ListValuedResourcesResponse`; indicates
2830
+ # that this is a continuation of a prior `ListValuedResources` call, and
2831
+ # that the system should return the next page of data.
2832
+ # @param page_size [::Integer]
2833
+ # The maximum number of results to return in a single response. Default is
2834
+ # 10, minimum is 1, maximum is 1000.
2835
+ # @param order_by [::String]
2836
+ # Optional. The fields by which to order the valued resources response.
2837
+ #
2838
+ # Supported fields:
2839
+ #
2840
+ # * `exposed_score`
2841
+ #
2842
+ # * `resource_value`
2843
+ #
2844
+ # * `resource_type`
2845
+ #
2846
+ # Values should be a comma separated list of fields. For example:
2847
+ # `exposed_score,resource_value`.
2848
+ #
2849
+ # The default sorting order is descending. To specify ascending or descending
2850
+ # order for a field, append a " ASC" or a " DESC" suffix, respectively; for
2851
+ # example: `exposed_score DESC`.
2852
+ # @yield [result, operation] Access the result along with the TransportOperation object
2853
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>]
2854
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2855
+ #
2856
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>]
2857
+ #
2858
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2859
+ #
2860
+ # @example Basic example
2861
+ # require "google/cloud/security_center/v2"
2862
+ #
2863
+ # # Create a client object. The client can be reused for multiple calls.
2864
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2865
+ #
2866
+ # # Create a request. To set request fields, pass in keyword arguments.
2867
+ # request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new
2868
+ #
2869
+ # # Call the list_valued_resources method.
2870
+ # result = client.list_valued_resources request
2871
+ #
2872
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2873
+ # # over elements, and API calls will be issued to fetch pages as needed.
2874
+ # result.each do |item|
2875
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource.
2876
+ # p item
2877
+ # end
2878
+ #
2879
+ def list_valued_resources request, options = nil
2880
+ raise ::ArgumentError, "request must be provided" if request.nil?
2881
+
2882
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest
2883
+
2884
+ # Converts hash and nil to an options object
2885
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2886
+
2887
+ # Customize the options with defaults
2888
+ call_metadata = @config.rpcs.list_valued_resources.metadata.to_h
2889
+
2890
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2891
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2892
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2893
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2894
+ transports_version_send: [:rest]
2895
+
2896
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2897
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2898
+
2899
+ options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout,
2900
+ metadata: call_metadata,
2901
+ retry_policy: @config.rpcs.list_valued_resources.retry_policy
2902
+
2903
+ options.apply_defaults timeout: @config.timeout,
2904
+ metadata: @config.metadata,
2905
+ retry_policy: @config.retry_policy
2906
+
2907
+ @security_center_stub.list_valued_resources request, options do |result, operation|
2908
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_valued_resources, "valued_resources", request, result, options
2909
+ yield result, operation if block_given?
2910
+ return result
2911
+ end
2912
+ rescue ::Gapic::Rest::Error => e
2913
+ raise ::Google::Cloud::Error.from_error(e)
2914
+ end
2915
+
2916
+ ##
2917
+ # Updates the state of a finding. If no location is specified, finding is
2918
+ # assumed to be in global
2919
+ #
2920
+ # @overload set_finding_state(request, options = nil)
2921
+ # Pass arguments to `set_finding_state` via a request object, either of type
2922
+ # {::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest} or an equivalent Hash.
2923
+ #
2924
+ # @param request [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Hash]
2925
+ # A request object representing the call parameters. Required. To specify no
2926
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2927
+ # @param options [::Gapic::CallOptions, ::Hash]
2928
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2929
+ #
2930
+ # @overload set_finding_state(name: nil, state: nil)
2931
+ # Pass arguments to `set_finding_state` via keyword arguments. Note that at
2932
+ # least one keyword argument is required. To specify no parameters, or to keep all
2933
+ # the default parameter values, pass an empty Hash as a request object (see above).
2934
+ #
2935
+ # @param name [::String]
2936
+ # Required. The [relative resource
2937
+ # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
2938
+ # of the finding. If no location is specified, finding is assumed to be in
2939
+ # global. The following list shows some examples:
2940
+ #
2941
+ # +
2942
+ # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
2943
+ # +
2944
+ # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
2945
+ # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
2946
+ # +
2947
+ # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
2948
+ # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
2949
+ # +
2950
+ # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
2951
+ # @param state [::Google::Cloud::SecurityCenter::V2::Finding::State]
2952
+ # Required. The desired State of the finding.
2953
+ # @yield [result, operation] Access the result along with the TransportOperation object
2954
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding]
2955
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2956
+ #
2957
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
2958
+ #
2959
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2960
+ #
2961
+ # @example Basic example
2962
+ # require "google/cloud/security_center/v2"
2963
+ #
2964
+ # # Create a client object. The client can be reused for multiple calls.
2965
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
2966
+ #
2967
+ # # Create a request. To set request fields, pass in keyword arguments.
2968
+ # request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new
2969
+ #
2970
+ # # Call the set_finding_state method.
2971
+ # result = client.set_finding_state request
2972
+ #
2973
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
2974
+ # p result
2975
+ #
2976
+ def set_finding_state request, options = nil
2977
+ raise ::ArgumentError, "request must be provided" if request.nil?
2978
+
2979
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest
2980
+
2981
+ # Converts hash and nil to an options object
2982
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2983
+
2984
+ # Customize the options with defaults
2985
+ call_metadata = @config.rpcs.set_finding_state.metadata.to_h
2986
+
2987
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2988
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2989
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2990
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
2991
+ transports_version_send: [:rest]
2992
+
2993
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2994
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2995
+
2996
+ options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout,
2997
+ metadata: call_metadata,
2998
+ retry_policy: @config.rpcs.set_finding_state.retry_policy
2999
+
3000
+ options.apply_defaults timeout: @config.timeout,
3001
+ metadata: @config.metadata,
3002
+ retry_policy: @config.retry_policy
3003
+
3004
+ @security_center_stub.set_finding_state request, options do |result, operation|
3005
+ yield result, operation if block_given?
3006
+ return result
3007
+ end
3008
+ rescue ::Gapic::Rest::Error => e
3009
+ raise ::Google::Cloud::Error.from_error(e)
3010
+ end
3011
+
3012
+ ##
3013
+ # Sets the access control policy on the specified Source.
3014
+ #
3015
+ # @overload set_iam_policy(request, options = nil)
3016
+ # Pass arguments to `set_iam_policy` via a request object, either of type
3017
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
3018
+ #
3019
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
3020
+ # A request object representing the call parameters. Required. To specify no
3021
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3022
+ # @param options [::Gapic::CallOptions, ::Hash]
3023
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3024
+ #
3025
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
3026
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
3027
+ # least one keyword argument is required. To specify no parameters, or to keep all
3028
+ # the default parameter values, pass an empty Hash as a request object (see above).
3029
+ #
3030
+ # @param resource [::String]
3031
+ # REQUIRED: The resource for which the policy is being specified.
3032
+ # See the operation documentation for the appropriate value for this field.
3033
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
3034
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
3035
+ # the policy is limited to a few 10s of KB. An empty policy is a
3036
+ # valid policy but certain Cloud Platform services (such as Projects)
3037
+ # might reject them.
3038
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3039
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
3040
+ # the fields in the mask will be modified. If no mask is provided, the
3041
+ # following default mask is used:
3042
+ #
3043
+ # `paths: "bindings, etag"`
3044
+ # @yield [result, operation] Access the result along with the TransportOperation object
3045
+ # @yieldparam result [::Google::Iam::V1::Policy]
3046
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3047
+ #
3048
+ # @return [::Google::Iam::V1::Policy]
3049
+ #
3050
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3051
+ #
3052
+ # @example Basic example
3053
+ # require "google/cloud/security_center/v2"
3054
+ #
3055
+ # # Create a client object. The client can be reused for multiple calls.
3056
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3057
+ #
3058
+ # # Create a request. To set request fields, pass in keyword arguments.
3059
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
3060
+ #
3061
+ # # Call the set_iam_policy method.
3062
+ # result = client.set_iam_policy request
3063
+ #
3064
+ # # The returned object is of type Google::Iam::V1::Policy.
3065
+ # p result
3066
+ #
3067
+ def set_iam_policy request, options = nil
3068
+ raise ::ArgumentError, "request must be provided" if request.nil?
3069
+
3070
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
3071
+
3072
+ # Converts hash and nil to an options object
3073
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3074
+
3075
+ # Customize the options with defaults
3076
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
3077
+
3078
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3079
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3080
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3081
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3082
+ transports_version_send: [:rest]
3083
+
3084
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3085
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3086
+
3087
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
3088
+ metadata: call_metadata,
3089
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
3090
+
3091
+ options.apply_defaults timeout: @config.timeout,
3092
+ metadata: @config.metadata,
3093
+ retry_policy: @config.retry_policy
3094
+
3095
+ @security_center_stub.set_iam_policy request, options do |result, operation|
3096
+ yield result, operation if block_given?
3097
+ return result
3098
+ end
3099
+ rescue ::Gapic::Rest::Error => e
3100
+ raise ::Google::Cloud::Error.from_error(e)
3101
+ end
3102
+
3103
+ ##
3104
+ # Updates the mute state of a finding. If no location is specified, finding
3105
+ # is assumed to be in global
3106
+ #
3107
+ # @overload set_mute(request, options = nil)
3108
+ # Pass arguments to `set_mute` via a request object, either of type
3109
+ # {::Google::Cloud::SecurityCenter::V2::SetMuteRequest} or an equivalent Hash.
3110
+ #
3111
+ # @param request [::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Hash]
3112
+ # A request object representing the call parameters. Required. To specify no
3113
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3114
+ # @param options [::Gapic::CallOptions, ::Hash]
3115
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3116
+ #
3117
+ # @overload set_mute(name: nil, mute: nil)
3118
+ # Pass arguments to `set_mute` via keyword arguments. Note that at
3119
+ # least one keyword argument is required. To specify no parameters, or to keep all
3120
+ # the default parameter values, pass an empty Hash as a request object (see above).
3121
+ #
3122
+ # @param name [::String]
3123
+ # Required. The [relative resource
3124
+ # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
3125
+ # of the finding. If no location is specified, finding is assumed to be in
3126
+ # global. The following list shows some examples:
3127
+ #
3128
+ # +
3129
+ # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
3130
+ # +
3131
+ # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3132
+ # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
3133
+ # +
3134
+ # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3135
+ # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
3136
+ # +
3137
+ # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3138
+ # @param mute [::Google::Cloud::SecurityCenter::V2::Finding::Mute]
3139
+ # Required. The desired state of the Mute.
3140
+ # @yield [result, operation] Access the result along with the TransportOperation object
3141
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding]
3142
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3143
+ #
3144
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
3145
+ #
3146
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3147
+ #
3148
+ # @example Basic example
3149
+ # require "google/cloud/security_center/v2"
3150
+ #
3151
+ # # Create a client object. The client can be reused for multiple calls.
3152
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3153
+ #
3154
+ # # Create a request. To set request fields, pass in keyword arguments.
3155
+ # request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new
3156
+ #
3157
+ # # Call the set_mute method.
3158
+ # result = client.set_mute request
3159
+ #
3160
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
3161
+ # p result
3162
+ #
3163
+ def set_mute request, options = nil
3164
+ raise ::ArgumentError, "request must be provided" if request.nil?
3165
+
3166
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetMuteRequest
3167
+
3168
+ # Converts hash and nil to an options object
3169
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3170
+
3171
+ # Customize the options with defaults
3172
+ call_metadata = @config.rpcs.set_mute.metadata.to_h
3173
+
3174
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3175
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3176
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3177
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3178
+ transports_version_send: [:rest]
3179
+
3180
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3181
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3182
+
3183
+ options.apply_defaults timeout: @config.rpcs.set_mute.timeout,
3184
+ metadata: call_metadata,
3185
+ retry_policy: @config.rpcs.set_mute.retry_policy
3186
+
3187
+ options.apply_defaults timeout: @config.timeout,
3188
+ metadata: @config.metadata,
3189
+ retry_policy: @config.retry_policy
3190
+
3191
+ @security_center_stub.set_mute request, options do |result, operation|
3192
+ yield result, operation if block_given?
3193
+ return result
3194
+ end
3195
+ rescue ::Gapic::Rest::Error => e
3196
+ raise ::Google::Cloud::Error.from_error(e)
3197
+ end
3198
+
3199
+ ##
3200
+ # Returns the permissions that a caller has on the specified source.
3201
+ #
3202
+ # @overload test_iam_permissions(request, options = nil)
3203
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
3204
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
3205
+ #
3206
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
3207
+ # A request object representing the call parameters. Required. To specify no
3208
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3209
+ # @param options [::Gapic::CallOptions, ::Hash]
3210
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3211
+ #
3212
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
3213
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
3214
+ # least one keyword argument is required. To specify no parameters, or to keep all
3215
+ # the default parameter values, pass an empty Hash as a request object (see above).
3216
+ #
3217
+ # @param resource [::String]
3218
+ # REQUIRED: The resource for which the policy detail is being requested.
3219
+ # See the operation documentation for the appropriate value for this field.
3220
+ # @param permissions [::Array<::String>]
3221
+ # The set of permissions to check for the `resource`. Permissions with
3222
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
3223
+ # information see
3224
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
3225
+ # @yield [result, operation] Access the result along with the TransportOperation object
3226
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
3227
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3228
+ #
3229
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
3230
+ #
3231
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3232
+ #
3233
+ # @example Basic example
3234
+ # require "google/cloud/security_center/v2"
3235
+ #
3236
+ # # Create a client object. The client can be reused for multiple calls.
3237
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3238
+ #
3239
+ # # Create a request. To set request fields, pass in keyword arguments.
3240
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
3241
+ #
3242
+ # # Call the test_iam_permissions method.
3243
+ # result = client.test_iam_permissions request
3244
+ #
3245
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
3246
+ # p result
3247
+ #
3248
+ def test_iam_permissions request, options = nil
3249
+ raise ::ArgumentError, "request must be provided" if request.nil?
3250
+
3251
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
3252
+
3253
+ # Converts hash and nil to an options object
3254
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3255
+
3256
+ # Customize the options with defaults
3257
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
3258
+
3259
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3260
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3261
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3262
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3263
+ transports_version_send: [:rest]
3264
+
3265
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3266
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3267
+
3268
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
3269
+ metadata: call_metadata,
3270
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
3271
+
3272
+ options.apply_defaults timeout: @config.timeout,
3273
+ metadata: @config.metadata,
3274
+ retry_policy: @config.retry_policy
3275
+
3276
+ @security_center_stub.test_iam_permissions request, options do |result, operation|
3277
+ yield result, operation if block_given?
3278
+ return result
3279
+ end
3280
+ rescue ::Gapic::Rest::Error => e
3281
+ raise ::Google::Cloud::Error.from_error(e)
3282
+ end
3283
+
3284
+ ##
3285
+ # Updates a BigQuery export.
3286
+ #
3287
+ # @overload update_big_query_export(request, options = nil)
3288
+ # Pass arguments to `update_big_query_export` via a request object, either of type
3289
+ # {::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest} or an equivalent Hash.
3290
+ #
3291
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Hash]
3292
+ # A request object representing the call parameters. Required. To specify no
3293
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3294
+ # @param options [::Gapic::CallOptions, ::Hash]
3295
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3296
+ #
3297
+ # @overload update_big_query_export(big_query_export: nil, update_mask: nil)
3298
+ # Pass arguments to `update_big_query_export` via keyword arguments. Note that at
3299
+ # least one keyword argument is required. To specify no parameters, or to keep all
3300
+ # the default parameter values, pass an empty Hash as a request object (see above).
3301
+ #
3302
+ # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash]
3303
+ # Required. The BigQuery export being updated.
3304
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3305
+ # The list of fields to be updated.
3306
+ # If empty all mutable fields will be updated.
3307
+ # @yield [result, operation] Access the result along with the TransportOperation object
3308
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
3309
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3310
+ #
3311
+ # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
3312
+ #
3313
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3314
+ #
3315
+ # @example Basic example
3316
+ # require "google/cloud/security_center/v2"
3317
+ #
3318
+ # # Create a client object. The client can be reused for multiple calls.
3319
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3320
+ #
3321
+ # # Create a request. To set request fields, pass in keyword arguments.
3322
+ # request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new
3323
+ #
3324
+ # # Call the update_big_query_export method.
3325
+ # result = client.update_big_query_export request
3326
+ #
3327
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport.
3328
+ # p result
3329
+ #
3330
+ def update_big_query_export request, options = nil
3331
+ raise ::ArgumentError, "request must be provided" if request.nil?
3332
+
3333
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest
3334
+
3335
+ # Converts hash and nil to an options object
3336
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3337
+
3338
+ # Customize the options with defaults
3339
+ call_metadata = @config.rpcs.update_big_query_export.metadata.to_h
3340
+
3341
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3342
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3343
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3344
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3345
+ transports_version_send: [:rest]
3346
+
3347
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3348
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3349
+
3350
+ options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout,
3351
+ metadata: call_metadata,
3352
+ retry_policy: @config.rpcs.update_big_query_export.retry_policy
3353
+
3354
+ options.apply_defaults timeout: @config.timeout,
3355
+ metadata: @config.metadata,
3356
+ retry_policy: @config.retry_policy
3357
+
3358
+ @security_center_stub.update_big_query_export request, options do |result, operation|
3359
+ yield result, operation if block_given?
3360
+ return result
3361
+ end
3362
+ rescue ::Gapic::Rest::Error => e
3363
+ raise ::Google::Cloud::Error.from_error(e)
3364
+ end
3365
+
3366
+ ##
3367
+ # Updates external system. This is for a given finding. If no location is
3368
+ # specified, finding is assumed to be in global
3369
+ #
3370
+ # @overload update_external_system(request, options = nil)
3371
+ # Pass arguments to `update_external_system` via a request object, either of type
3372
+ # {::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest} or an equivalent Hash.
3373
+ #
3374
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Hash]
3375
+ # A request object representing the call parameters. Required. To specify no
3376
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3377
+ # @param options [::Gapic::CallOptions, ::Hash]
3378
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3379
+ #
3380
+ # @overload update_external_system(external_system: nil, update_mask: nil)
3381
+ # Pass arguments to `update_external_system` via keyword arguments. Note that at
3382
+ # least one keyword argument is required. To specify no parameters, or to keep all
3383
+ # the default parameter values, pass an empty Hash as a request object (see above).
3384
+ #
3385
+ # @param external_system [::Google::Cloud::SecurityCenter::V2::ExternalSystem, ::Hash]
3386
+ # Required. The external system resource to update.
3387
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3388
+ # The FieldMask to use when updating the external system resource.
3389
+ #
3390
+ # If empty all mutable fields will be updated.
3391
+ # @yield [result, operation] Access the result along with the TransportOperation object
3392
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ExternalSystem]
3393
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3394
+ #
3395
+ # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem]
3396
+ #
3397
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3398
+ #
3399
+ # @example Basic example
3400
+ # require "google/cloud/security_center/v2"
3401
+ #
3402
+ # # Create a client object. The client can be reused for multiple calls.
3403
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3404
+ #
3405
+ # # Create a request. To set request fields, pass in keyword arguments.
3406
+ # request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new
3407
+ #
3408
+ # # Call the update_external_system method.
3409
+ # result = client.update_external_system request
3410
+ #
3411
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem.
3412
+ # p result
3413
+ #
3414
+ def update_external_system request, options = nil
3415
+ raise ::ArgumentError, "request must be provided" if request.nil?
3416
+
3417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest
3418
+
3419
+ # Converts hash and nil to an options object
3420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3421
+
3422
+ # Customize the options with defaults
3423
+ call_metadata = @config.rpcs.update_external_system.metadata.to_h
3424
+
3425
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3426
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3428
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3429
+ transports_version_send: [:rest]
3430
+
3431
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3432
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3433
+
3434
+ options.apply_defaults timeout: @config.rpcs.update_external_system.timeout,
3435
+ metadata: call_metadata,
3436
+ retry_policy: @config.rpcs.update_external_system.retry_policy
3437
+
3438
+ options.apply_defaults timeout: @config.timeout,
3439
+ metadata: @config.metadata,
3440
+ retry_policy: @config.retry_policy
3441
+
3442
+ @security_center_stub.update_external_system request, options do |result, operation|
3443
+ yield result, operation if block_given?
3444
+ return result
3445
+ end
3446
+ rescue ::Gapic::Rest::Error => e
3447
+ raise ::Google::Cloud::Error.from_error(e)
3448
+ end
3449
+
3450
+ ##
3451
+ # Creates or updates a finding. If no location is specified, finding is
3452
+ # assumed to be in global. The corresponding source must exist for a finding
3453
+ # creation to succeed.
3454
+ #
3455
+ # @overload update_finding(request, options = nil)
3456
+ # Pass arguments to `update_finding` via a request object, either of type
3457
+ # {::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest} or an equivalent Hash.
3458
+ #
3459
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Hash]
3460
+ # A request object representing the call parameters. Required. To specify no
3461
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3462
+ # @param options [::Gapic::CallOptions, ::Hash]
3463
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3464
+ #
3465
+ # @overload update_finding(finding: nil, update_mask: nil)
3466
+ # Pass arguments to `update_finding` via keyword arguments. Note that at
3467
+ # least one keyword argument is required. To specify no parameters, or to keep all
3468
+ # the default parameter values, pass an empty Hash as a request object (see above).
3469
+ #
3470
+ # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash]
3471
+ # Required. The finding resource to update or create if it does not already
3472
+ # exist. parent, security_marks, and update_time will be ignored.
3473
+ #
3474
+ # In the case of creation, the finding id portion of the name must be
3475
+ # alphanumeric and less than or equal to 32 characters and greater than 0
3476
+ # characters in length.
3477
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3478
+ # The FieldMask to use when updating the finding resource. This field should
3479
+ # not be specified when creating a finding.
3480
+ #
3481
+ # When updating a finding, an empty mask is treated as updating all mutable
3482
+ # fields and replacing source_properties. Individual source_properties can
3483
+ # be added/updated by using "source_properties.<property key>" in the field
3484
+ # mask.
3485
+ # @yield [result, operation] Access the result along with the TransportOperation object
3486
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding]
3487
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3488
+ #
3489
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
3490
+ #
3491
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3492
+ #
3493
+ # @example Basic example
3494
+ # require "google/cloud/security_center/v2"
3495
+ #
3496
+ # # Create a client object. The client can be reused for multiple calls.
3497
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3498
+ #
3499
+ # # Create a request. To set request fields, pass in keyword arguments.
3500
+ # request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new
3501
+ #
3502
+ # # Call the update_finding method.
3503
+ # result = client.update_finding request
3504
+ #
3505
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
3506
+ # p result
3507
+ #
3508
+ def update_finding request, options = nil
3509
+ raise ::ArgumentError, "request must be provided" if request.nil?
3510
+
3511
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest
3512
+
3513
+ # Converts hash and nil to an options object
3514
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3515
+
3516
+ # Customize the options with defaults
3517
+ call_metadata = @config.rpcs.update_finding.metadata.to_h
3518
+
3519
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3520
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3521
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3522
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3523
+ transports_version_send: [:rest]
3524
+
3525
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3526
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3527
+
3528
+ options.apply_defaults timeout: @config.rpcs.update_finding.timeout,
3529
+ metadata: call_metadata,
3530
+ retry_policy: @config.rpcs.update_finding.retry_policy
3531
+
3532
+ options.apply_defaults timeout: @config.timeout,
3533
+ metadata: @config.metadata,
3534
+ retry_policy: @config.retry_policy
3535
+
3536
+ @security_center_stub.update_finding request, options do |result, operation|
3537
+ yield result, operation if block_given?
3538
+ return result
3539
+ end
3540
+ rescue ::Gapic::Rest::Error => e
3541
+ raise ::Google::Cloud::Error.from_error(e)
3542
+ end
3543
+
3544
+ ##
3545
+ # Updates a mute config. If no location is specified, default is
3546
+ # global.
3547
+ #
3548
+ # @overload update_mute_config(request, options = nil)
3549
+ # Pass arguments to `update_mute_config` via a request object, either of type
3550
+ # {::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest} or an equivalent Hash.
3551
+ #
3552
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Hash]
3553
+ # A request object representing the call parameters. Required. To specify no
3554
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3555
+ # @param options [::Gapic::CallOptions, ::Hash]
3556
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3557
+ #
3558
+ # @overload update_mute_config(mute_config: nil, update_mask: nil)
3559
+ # Pass arguments to `update_mute_config` via keyword arguments. Note that at
3560
+ # least one keyword argument is required. To specify no parameters, or to keep all
3561
+ # the default parameter values, pass an empty Hash as a request object (see above).
3562
+ #
3563
+ # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash]
3564
+ # Required. The mute config being updated.
3565
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3566
+ # The list of fields to be updated.
3567
+ # If empty all mutable fields will be updated.
3568
+ # @yield [result, operation] Access the result along with the TransportOperation object
3569
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig]
3570
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3571
+ #
3572
+ # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig]
3573
+ #
3574
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3575
+ #
3576
+ # @example Basic example
3577
+ # require "google/cloud/security_center/v2"
3578
+ #
3579
+ # # Create a client object. The client can be reused for multiple calls.
3580
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3581
+ #
3582
+ # # Create a request. To set request fields, pass in keyword arguments.
3583
+ # request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new
3584
+ #
3585
+ # # Call the update_mute_config method.
3586
+ # result = client.update_mute_config request
3587
+ #
3588
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig.
3589
+ # p result
3590
+ #
3591
+ def update_mute_config request, options = nil
3592
+ raise ::ArgumentError, "request must be provided" if request.nil?
3593
+
3594
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest
3595
+
3596
+ # Converts hash and nil to an options object
3597
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3598
+
3599
+ # Customize the options with defaults
3600
+ call_metadata = @config.rpcs.update_mute_config.metadata.to_h
3601
+
3602
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3603
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3604
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3605
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3606
+ transports_version_send: [:rest]
3607
+
3608
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3609
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3610
+
3611
+ options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout,
3612
+ metadata: call_metadata,
3613
+ retry_policy: @config.rpcs.update_mute_config.retry_policy
3614
+
3615
+ options.apply_defaults timeout: @config.timeout,
3616
+ metadata: @config.metadata,
3617
+ retry_policy: @config.retry_policy
3618
+
3619
+ @security_center_stub.update_mute_config request, options do |result, operation|
3620
+ yield result, operation if block_given?
3621
+ return result
3622
+ end
3623
+ rescue ::Gapic::Rest::Error => e
3624
+ raise ::Google::Cloud::Error.from_error(e)
3625
+ end
3626
+
3627
+ ##
3628
+ # Updates a notification config. The following update
3629
+ # fields are allowed: description, pubsub_topic, streaming_config.filter
3630
+ #
3631
+ # @overload update_notification_config(request, options = nil)
3632
+ # Pass arguments to `update_notification_config` via a request object, either of type
3633
+ # {::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest} or an equivalent Hash.
3634
+ #
3635
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Hash]
3636
+ # A request object representing the call parameters. Required. To specify no
3637
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3638
+ # @param options [::Gapic::CallOptions, ::Hash]
3639
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3640
+ #
3641
+ # @overload update_notification_config(notification_config: nil, update_mask: nil)
3642
+ # Pass arguments to `update_notification_config` via keyword arguments. Note that at
3643
+ # least one keyword argument is required. To specify no parameters, or to keep all
3644
+ # the default parameter values, pass an empty Hash as a request object (see above).
3645
+ #
3646
+ # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash]
3647
+ # Required. The notification config to update.
3648
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3649
+ # The FieldMask to use when updating the notification config.
3650
+ #
3651
+ # If empty all mutable fields will be updated.
3652
+ # @yield [result, operation] Access the result along with the TransportOperation object
3653
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
3654
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3655
+ #
3656
+ # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
3657
+ #
3658
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3659
+ #
3660
+ # @example Basic example
3661
+ # require "google/cloud/security_center/v2"
3662
+ #
3663
+ # # Create a client object. The client can be reused for multiple calls.
3664
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3665
+ #
3666
+ # # Create a request. To set request fields, pass in keyword arguments.
3667
+ # request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new
3668
+ #
3669
+ # # Call the update_notification_config method.
3670
+ # result = client.update_notification_config request
3671
+ #
3672
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig.
3673
+ # p result
3674
+ #
3675
+ def update_notification_config request, options = nil
3676
+ raise ::ArgumentError, "request must be provided" if request.nil?
3677
+
3678
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest
3679
+
3680
+ # Converts hash and nil to an options object
3681
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3682
+
3683
+ # Customize the options with defaults
3684
+ call_metadata = @config.rpcs.update_notification_config.metadata.to_h
3685
+
3686
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3687
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3688
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3689
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3690
+ transports_version_send: [:rest]
3691
+
3692
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3693
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3694
+
3695
+ options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout,
3696
+ metadata: call_metadata,
3697
+ retry_policy: @config.rpcs.update_notification_config.retry_policy
3698
+
3699
+ options.apply_defaults timeout: @config.timeout,
3700
+ metadata: @config.metadata,
3701
+ retry_policy: @config.retry_policy
3702
+
3703
+ @security_center_stub.update_notification_config request, options do |result, operation|
3704
+ yield result, operation if block_given?
3705
+ return result
3706
+ end
3707
+ rescue ::Gapic::Rest::Error => e
3708
+ raise ::Google::Cloud::Error.from_error(e)
3709
+ end
3710
+
3711
+ ##
3712
+ # Updates an existing ResourceValueConfigs with new rules.
3713
+ #
3714
+ # @overload update_resource_value_config(request, options = nil)
3715
+ # Pass arguments to `update_resource_value_config` via a request object, either of type
3716
+ # {::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest} or an equivalent Hash.
3717
+ #
3718
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Hash]
3719
+ # A request object representing the call parameters. Required. To specify no
3720
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3721
+ # @param options [::Gapic::CallOptions, ::Hash]
3722
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3723
+ #
3724
+ # @overload update_resource_value_config(resource_value_config: nil, update_mask: nil)
3725
+ # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at
3726
+ # least one keyword argument is required. To specify no parameters, or to keep all
3727
+ # the default parameter values, pass an empty Hash as a request object (see above).
3728
+ #
3729
+ # @param resource_value_config [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig, ::Hash]
3730
+ # Required. The resource value config being updated.
3731
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3732
+ # The list of fields to be updated.
3733
+ # If empty all mutable fields will be updated.
3734
+ # @yield [result, operation] Access the result along with the TransportOperation object
3735
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
3736
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3737
+ #
3738
+ # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
3739
+ #
3740
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3741
+ #
3742
+ # @example Basic example
3743
+ # require "google/cloud/security_center/v2"
3744
+ #
3745
+ # # Create a client object. The client can be reused for multiple calls.
3746
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3747
+ #
3748
+ # # Create a request. To set request fields, pass in keyword arguments.
3749
+ # request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new
3750
+ #
3751
+ # # Call the update_resource_value_config method.
3752
+ # result = client.update_resource_value_config request
3753
+ #
3754
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig.
3755
+ # p result
3756
+ #
3757
+ def update_resource_value_config request, options = nil
3758
+ raise ::ArgumentError, "request must be provided" if request.nil?
3759
+
3760
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest
3761
+
3762
+ # Converts hash and nil to an options object
3763
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3764
+
3765
+ # Customize the options with defaults
3766
+ call_metadata = @config.rpcs.update_resource_value_config.metadata.to_h
3767
+
3768
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3769
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3770
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3771
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3772
+ transports_version_send: [:rest]
3773
+
3774
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3775
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3776
+
3777
+ options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout,
3778
+ metadata: call_metadata,
3779
+ retry_policy: @config.rpcs.update_resource_value_config.retry_policy
3780
+
3781
+ options.apply_defaults timeout: @config.timeout,
3782
+ metadata: @config.metadata,
3783
+ retry_policy: @config.retry_policy
3784
+
3785
+ @security_center_stub.update_resource_value_config request, options do |result, operation|
3786
+ yield result, operation if block_given?
3787
+ return result
3788
+ end
3789
+ rescue ::Gapic::Rest::Error => e
3790
+ raise ::Google::Cloud::Error.from_error(e)
3791
+ end
3792
+
3793
+ ##
3794
+ # Updates security marks. For Finding Security marks, if no location is
3795
+ # specified, finding is assumed to be in global. Assets Security Marks can
3796
+ # only be accessed through global endpoint.
3797
+ #
3798
+ # @overload update_security_marks(request, options = nil)
3799
+ # Pass arguments to `update_security_marks` via a request object, either of type
3800
+ # {::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest} or an equivalent Hash.
3801
+ #
3802
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Hash]
3803
+ # A request object representing the call parameters. Required. To specify no
3804
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3805
+ # @param options [::Gapic::CallOptions, ::Hash]
3806
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3807
+ #
3808
+ # @overload update_security_marks(security_marks: nil, update_mask: nil)
3809
+ # Pass arguments to `update_security_marks` via keyword arguments. Note that at
3810
+ # least one keyword argument is required. To specify no parameters, or to keep all
3811
+ # the default parameter values, pass an empty Hash as a request object (see above).
3812
+ #
3813
+ # @param security_marks [::Google::Cloud::SecurityCenter::V2::SecurityMarks, ::Hash]
3814
+ # Required. The security marks resource to update.
3815
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3816
+ # The FieldMask to use when updating the security marks resource.
3817
+ #
3818
+ # The field mask must not contain duplicate fields.
3819
+ # If empty or set to "marks", all marks will be replaced. Individual
3820
+ # marks can be updated using "marks.<mark_key>".
3821
+ # @yield [result, operation] Access the result along with the TransportOperation object
3822
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::SecurityMarks]
3823
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3824
+ #
3825
+ # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks]
3826
+ #
3827
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3828
+ #
3829
+ # @example Basic example
3830
+ # require "google/cloud/security_center/v2"
3831
+ #
3832
+ # # Create a client object. The client can be reused for multiple calls.
3833
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3834
+ #
3835
+ # # Create a request. To set request fields, pass in keyword arguments.
3836
+ # request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new
3837
+ #
3838
+ # # Call the update_security_marks method.
3839
+ # result = client.update_security_marks request
3840
+ #
3841
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks.
3842
+ # p result
3843
+ #
3844
+ def update_security_marks request, options = nil
3845
+ raise ::ArgumentError, "request must be provided" if request.nil?
3846
+
3847
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest
3848
+
3849
+ # Converts hash and nil to an options object
3850
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3851
+
3852
+ # Customize the options with defaults
3853
+ call_metadata = @config.rpcs.update_security_marks.metadata.to_h
3854
+
3855
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3856
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3857
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3858
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3859
+ transports_version_send: [:rest]
3860
+
3861
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3862
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3863
+
3864
+ options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout,
3865
+ metadata: call_metadata,
3866
+ retry_policy: @config.rpcs.update_security_marks.retry_policy
3867
+
3868
+ options.apply_defaults timeout: @config.timeout,
3869
+ metadata: @config.metadata,
3870
+ retry_policy: @config.retry_policy
3871
+
3872
+ @security_center_stub.update_security_marks request, options do |result, operation|
3873
+ yield result, operation if block_given?
3874
+ return result
3875
+ end
3876
+ rescue ::Gapic::Rest::Error => e
3877
+ raise ::Google::Cloud::Error.from_error(e)
3878
+ end
3879
+
3880
+ ##
3881
+ # Updates a source.
3882
+ #
3883
+ # @overload update_source(request, options = nil)
3884
+ # Pass arguments to `update_source` via a request object, either of type
3885
+ # {::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest} or an equivalent Hash.
3886
+ #
3887
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Hash]
3888
+ # A request object representing the call parameters. Required. To specify no
3889
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3890
+ # @param options [::Gapic::CallOptions, ::Hash]
3891
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3892
+ #
3893
+ # @overload update_source(source: nil, update_mask: nil)
3894
+ # Pass arguments to `update_source` via keyword arguments. Note that at
3895
+ # least one keyword argument is required. To specify no parameters, or to keep all
3896
+ # the default parameter values, pass an empty Hash as a request object (see above).
3897
+ #
3898
+ # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash]
3899
+ # Required. The source resource to update.
3900
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3901
+ # The FieldMask to use when updating the source resource.
3902
+ #
3903
+ # If empty all mutable fields will be updated.
3904
+ # @yield [result, operation] Access the result along with the TransportOperation object
3905
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source]
3906
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3907
+ #
3908
+ # @return [::Google::Cloud::SecurityCenter::V2::Source]
3909
+ #
3910
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3911
+ #
3912
+ # @example Basic example
3913
+ # require "google/cloud/security_center/v2"
3914
+ #
3915
+ # # Create a client object. The client can be reused for multiple calls.
3916
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new
3917
+ #
3918
+ # # Create a request. To set request fields, pass in keyword arguments.
3919
+ # request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new
3920
+ #
3921
+ # # Call the update_source method.
3922
+ # result = client.update_source request
3923
+ #
3924
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source.
3925
+ # p result
3926
+ #
3927
+ def update_source request, options = nil
3928
+ raise ::ArgumentError, "request must be provided" if request.nil?
3929
+
3930
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest
3931
+
3932
+ # Converts hash and nil to an options object
3933
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3934
+
3935
+ # Customize the options with defaults
3936
+ call_metadata = @config.rpcs.update_source.metadata.to_h
3937
+
3938
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3939
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3940
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3941
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION,
3942
+ transports_version_send: [:rest]
3943
+
3944
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3945
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3946
+
3947
+ options.apply_defaults timeout: @config.rpcs.update_source.timeout,
3948
+ metadata: call_metadata,
3949
+ retry_policy: @config.rpcs.update_source.retry_policy
3950
+
3951
+ options.apply_defaults timeout: @config.timeout,
3952
+ metadata: @config.metadata,
3953
+ retry_policy: @config.retry_policy
3954
+
3955
+ @security_center_stub.update_source request, options do |result, operation|
3956
+ yield result, operation if block_given?
3957
+ return result
3958
+ end
3959
+ rescue ::Gapic::Rest::Error => e
3960
+ raise ::Google::Cloud::Error.from_error(e)
3961
+ end
3962
+
3963
+ ##
3964
+ # Configuration class for the SecurityCenter REST API.
3965
+ #
3966
+ # This class represents the configuration for SecurityCenter REST,
3967
+ # providing control over timeouts, retry behavior, logging, transport
3968
+ # parameters, and other low-level controls. Certain parameters can also be
3969
+ # applied individually to specific RPCs. See
3970
+ # {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client::Configuration::Rpcs}
3971
+ # for a list of RPCs that can be configured independently.
3972
+ #
3973
+ # Configuration can be applied globally to all clients, or to a single client
3974
+ # on construction.
3975
+ #
3976
+ # @example
3977
+ #
3978
+ # # Modify the global config, setting the timeout for
3979
+ # # batch_create_resource_value_configs to 20 seconds,
3980
+ # # and all remaining timeouts to 10 seconds.
3981
+ # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.configure do |config|
3982
+ # config.timeout = 10.0
3983
+ # config.rpcs.batch_create_resource_value_configs.timeout = 20.0
3984
+ # end
3985
+ #
3986
+ # # Apply the above configuration only to a new client.
3987
+ # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config|
3988
+ # config.timeout = 10.0
3989
+ # config.rpcs.batch_create_resource_value_configs.timeout = 20.0
3990
+ # end
3991
+ #
3992
+ # @!attribute [rw] endpoint
3993
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3994
+ # nil, indicating to use the default endpoint in the current universe domain.
3995
+ # @return [::String,nil]
3996
+ # @!attribute [rw] credentials
3997
+ # Credentials to send with calls. You may provide any of the following types:
3998
+ # * (`String`) The path to a service account key file in JSON format
3999
+ # * (`Hash`) A service account key as a Hash
4000
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
4001
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
4002
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
4003
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
4004
+ # * (`nil`) indicating no credentials
4005
+ # @return [::Object]
4006
+ # @!attribute [rw] scope
4007
+ # The OAuth scopes
4008
+ # @return [::Array<::String>]
4009
+ # @!attribute [rw] lib_name
4010
+ # The library name as recorded in instrumentation and logging
4011
+ # @return [::String]
4012
+ # @!attribute [rw] lib_version
4013
+ # The library version as recorded in instrumentation and logging
4014
+ # @return [::String]
4015
+ # @!attribute [rw] timeout
4016
+ # The call timeout in seconds.
4017
+ # @return [::Numeric]
4018
+ # @!attribute [rw] metadata
4019
+ # Additional headers to be sent with the call.
4020
+ # @return [::Hash{::Symbol=>::String}]
4021
+ # @!attribute [rw] retry_policy
4022
+ # The retry policy. The value is a hash with the following keys:
4023
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4024
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4025
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4026
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4027
+ # trigger a retry.
4028
+ # @return [::Hash]
4029
+ # @!attribute [rw] quota_project
4030
+ # A separate project against which to charge quota.
4031
+ # @return [::String]
4032
+ # @!attribute [rw] universe_domain
4033
+ # The universe domain within which to make requests. This determines the
4034
+ # default endpoint URL. The default value of nil uses the environment
4035
+ # universe (usually the default "googleapis.com" universe).
4036
+ # @return [::String,nil]
4037
+ #
4038
+ class Configuration
4039
+ extend ::Gapic::Config
4040
+
4041
+ # @private
4042
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
4043
+ DEFAULT_ENDPOINT = "securitycenter.googleapis.com"
4044
+
4045
+ config_attr :endpoint, nil, ::String, nil
4046
+ config_attr :credentials, nil do |value|
4047
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
4048
+ allowed.any? { |klass| klass === value }
4049
+ end
4050
+ config_attr :scope, nil, ::String, ::Array, nil
4051
+ config_attr :lib_name, nil, ::String, nil
4052
+ config_attr :lib_version, nil, ::String, nil
4053
+ config_attr :timeout, nil, ::Numeric, nil
4054
+ config_attr :metadata, nil, ::Hash, nil
4055
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4056
+ config_attr :quota_project, nil, ::String, nil
4057
+ config_attr :universe_domain, nil, ::String, nil
4058
+
4059
+ # @private
4060
+ def initialize parent_config = nil
4061
+ @parent_config = parent_config unless parent_config.nil?
4062
+
4063
+ yield self if block_given?
4064
+ end
4065
+
4066
+ ##
4067
+ # Configurations for individual RPCs
4068
+ # @return [Rpcs]
4069
+ #
4070
+ def rpcs
4071
+ @rpcs ||= begin
4072
+ parent_rpcs = nil
4073
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
4074
+ Rpcs.new parent_rpcs
4075
+ end
4076
+ end
4077
+
4078
+ ##
4079
+ # Configuration RPC class for the SecurityCenter API.
4080
+ #
4081
+ # Includes fields providing the configuration for each RPC in this service.
4082
+ # Each configuration object is of type `Gapic::Config::Method` and includes
4083
+ # the following configuration fields:
4084
+ #
4085
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
4086
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
4087
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
4088
+ # include the following keys:
4089
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4090
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4091
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4092
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4093
+ # trigger a retry.
4094
+ #
4095
+ class Rpcs
4096
+ ##
4097
+ # RPC-specific configuration for `batch_create_resource_value_configs`
4098
+ # @return [::Gapic::Config::Method]
4099
+ #
4100
+ attr_reader :batch_create_resource_value_configs
4101
+ ##
4102
+ # RPC-specific configuration for `bulk_mute_findings`
4103
+ # @return [::Gapic::Config::Method]
4104
+ #
4105
+ attr_reader :bulk_mute_findings
4106
+ ##
4107
+ # RPC-specific configuration for `create_big_query_export`
4108
+ # @return [::Gapic::Config::Method]
4109
+ #
4110
+ attr_reader :create_big_query_export
4111
+ ##
4112
+ # RPC-specific configuration for `create_finding`
4113
+ # @return [::Gapic::Config::Method]
4114
+ #
4115
+ attr_reader :create_finding
4116
+ ##
4117
+ # RPC-specific configuration for `create_mute_config`
4118
+ # @return [::Gapic::Config::Method]
4119
+ #
4120
+ attr_reader :create_mute_config
4121
+ ##
4122
+ # RPC-specific configuration for `create_notification_config`
4123
+ # @return [::Gapic::Config::Method]
4124
+ #
4125
+ attr_reader :create_notification_config
4126
+ ##
4127
+ # RPC-specific configuration for `create_source`
4128
+ # @return [::Gapic::Config::Method]
4129
+ #
4130
+ attr_reader :create_source
4131
+ ##
4132
+ # RPC-specific configuration for `delete_big_query_export`
4133
+ # @return [::Gapic::Config::Method]
4134
+ #
4135
+ attr_reader :delete_big_query_export
4136
+ ##
4137
+ # RPC-specific configuration for `delete_mute_config`
4138
+ # @return [::Gapic::Config::Method]
4139
+ #
4140
+ attr_reader :delete_mute_config
4141
+ ##
4142
+ # RPC-specific configuration for `delete_notification_config`
4143
+ # @return [::Gapic::Config::Method]
4144
+ #
4145
+ attr_reader :delete_notification_config
4146
+ ##
4147
+ # RPC-specific configuration for `delete_resource_value_config`
4148
+ # @return [::Gapic::Config::Method]
4149
+ #
4150
+ attr_reader :delete_resource_value_config
4151
+ ##
4152
+ # RPC-specific configuration for `get_big_query_export`
4153
+ # @return [::Gapic::Config::Method]
4154
+ #
4155
+ attr_reader :get_big_query_export
4156
+ ##
4157
+ # RPC-specific configuration for `get_simulation`
4158
+ # @return [::Gapic::Config::Method]
4159
+ #
4160
+ attr_reader :get_simulation
4161
+ ##
4162
+ # RPC-specific configuration for `get_valued_resource`
4163
+ # @return [::Gapic::Config::Method]
4164
+ #
4165
+ attr_reader :get_valued_resource
4166
+ ##
4167
+ # RPC-specific configuration for `get_iam_policy`
4168
+ # @return [::Gapic::Config::Method]
4169
+ #
4170
+ attr_reader :get_iam_policy
4171
+ ##
4172
+ # RPC-specific configuration for `get_mute_config`
4173
+ # @return [::Gapic::Config::Method]
4174
+ #
4175
+ attr_reader :get_mute_config
4176
+ ##
4177
+ # RPC-specific configuration for `get_notification_config`
4178
+ # @return [::Gapic::Config::Method]
4179
+ #
4180
+ attr_reader :get_notification_config
4181
+ ##
4182
+ # RPC-specific configuration for `get_resource_value_config`
4183
+ # @return [::Gapic::Config::Method]
4184
+ #
4185
+ attr_reader :get_resource_value_config
4186
+ ##
4187
+ # RPC-specific configuration for `get_source`
4188
+ # @return [::Gapic::Config::Method]
4189
+ #
4190
+ attr_reader :get_source
4191
+ ##
4192
+ # RPC-specific configuration for `group_findings`
4193
+ # @return [::Gapic::Config::Method]
4194
+ #
4195
+ attr_reader :group_findings
4196
+ ##
4197
+ # RPC-specific configuration for `list_attack_paths`
4198
+ # @return [::Gapic::Config::Method]
4199
+ #
4200
+ attr_reader :list_attack_paths
4201
+ ##
4202
+ # RPC-specific configuration for `list_big_query_exports`
4203
+ # @return [::Gapic::Config::Method]
4204
+ #
4205
+ attr_reader :list_big_query_exports
4206
+ ##
4207
+ # RPC-specific configuration for `list_findings`
4208
+ # @return [::Gapic::Config::Method]
4209
+ #
4210
+ attr_reader :list_findings
4211
+ ##
4212
+ # RPC-specific configuration for `list_mute_configs`
4213
+ # @return [::Gapic::Config::Method]
4214
+ #
4215
+ attr_reader :list_mute_configs
4216
+ ##
4217
+ # RPC-specific configuration for `list_notification_configs`
4218
+ # @return [::Gapic::Config::Method]
4219
+ #
4220
+ attr_reader :list_notification_configs
4221
+ ##
4222
+ # RPC-specific configuration for `list_resource_value_configs`
4223
+ # @return [::Gapic::Config::Method]
4224
+ #
4225
+ attr_reader :list_resource_value_configs
4226
+ ##
4227
+ # RPC-specific configuration for `list_sources`
4228
+ # @return [::Gapic::Config::Method]
4229
+ #
4230
+ attr_reader :list_sources
4231
+ ##
4232
+ # RPC-specific configuration for `list_valued_resources`
4233
+ # @return [::Gapic::Config::Method]
4234
+ #
4235
+ attr_reader :list_valued_resources
4236
+ ##
4237
+ # RPC-specific configuration for `set_finding_state`
4238
+ # @return [::Gapic::Config::Method]
4239
+ #
4240
+ attr_reader :set_finding_state
4241
+ ##
4242
+ # RPC-specific configuration for `set_iam_policy`
4243
+ # @return [::Gapic::Config::Method]
4244
+ #
4245
+ attr_reader :set_iam_policy
4246
+ ##
4247
+ # RPC-specific configuration for `set_mute`
4248
+ # @return [::Gapic::Config::Method]
4249
+ #
4250
+ attr_reader :set_mute
4251
+ ##
4252
+ # RPC-specific configuration for `test_iam_permissions`
4253
+ # @return [::Gapic::Config::Method]
4254
+ #
4255
+ attr_reader :test_iam_permissions
4256
+ ##
4257
+ # RPC-specific configuration for `update_big_query_export`
4258
+ # @return [::Gapic::Config::Method]
4259
+ #
4260
+ attr_reader :update_big_query_export
4261
+ ##
4262
+ # RPC-specific configuration for `update_external_system`
4263
+ # @return [::Gapic::Config::Method]
4264
+ #
4265
+ attr_reader :update_external_system
4266
+ ##
4267
+ # RPC-specific configuration for `update_finding`
4268
+ # @return [::Gapic::Config::Method]
4269
+ #
4270
+ attr_reader :update_finding
4271
+ ##
4272
+ # RPC-specific configuration for `update_mute_config`
4273
+ # @return [::Gapic::Config::Method]
4274
+ #
4275
+ attr_reader :update_mute_config
4276
+ ##
4277
+ # RPC-specific configuration for `update_notification_config`
4278
+ # @return [::Gapic::Config::Method]
4279
+ #
4280
+ attr_reader :update_notification_config
4281
+ ##
4282
+ # RPC-specific configuration for `update_resource_value_config`
4283
+ # @return [::Gapic::Config::Method]
4284
+ #
4285
+ attr_reader :update_resource_value_config
4286
+ ##
4287
+ # RPC-specific configuration for `update_security_marks`
4288
+ # @return [::Gapic::Config::Method]
4289
+ #
4290
+ attr_reader :update_security_marks
4291
+ ##
4292
+ # RPC-specific configuration for `update_source`
4293
+ # @return [::Gapic::Config::Method]
4294
+ #
4295
+ attr_reader :update_source
4296
+
4297
+ # @private
4298
+ def initialize parent_rpcs = nil
4299
+ batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs
4300
+ @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config
4301
+ bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings
4302
+ @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config
4303
+ create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export
4304
+ @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config
4305
+ create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding
4306
+ @create_finding = ::Gapic::Config::Method.new create_finding_config
4307
+ create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config
4308
+ @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config
4309
+ create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config
4310
+ @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config
4311
+ create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source
4312
+ @create_source = ::Gapic::Config::Method.new create_source_config
4313
+ delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export
4314
+ @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config
4315
+ delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config
4316
+ @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config
4317
+ delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config
4318
+ @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config
4319
+ delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config
4320
+ @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config
4321
+ get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export
4322
+ @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config
4323
+ get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation
4324
+ @get_simulation = ::Gapic::Config::Method.new get_simulation_config
4325
+ get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource
4326
+ @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config
4327
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
4328
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
4329
+ get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config
4330
+ @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config
4331
+ get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config
4332
+ @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config
4333
+ get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config
4334
+ @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config
4335
+ get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source
4336
+ @get_source = ::Gapic::Config::Method.new get_source_config
4337
+ group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings
4338
+ @group_findings = ::Gapic::Config::Method.new group_findings_config
4339
+ list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths
4340
+ @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config
4341
+ list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports
4342
+ @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config
4343
+ list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings
4344
+ @list_findings = ::Gapic::Config::Method.new list_findings_config
4345
+ list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs
4346
+ @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config
4347
+ list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs
4348
+ @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config
4349
+ list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs
4350
+ @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config
4351
+ list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources
4352
+ @list_sources = ::Gapic::Config::Method.new list_sources_config
4353
+ list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources
4354
+ @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config
4355
+ set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state
4356
+ @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config
4357
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
4358
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
4359
+ set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute
4360
+ @set_mute = ::Gapic::Config::Method.new set_mute_config
4361
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
4362
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
4363
+ update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export
4364
+ @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config
4365
+ update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system
4366
+ @update_external_system = ::Gapic::Config::Method.new update_external_system_config
4367
+ update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding
4368
+ @update_finding = ::Gapic::Config::Method.new update_finding_config
4369
+ update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config
4370
+ @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config
4371
+ update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config
4372
+ @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config
4373
+ update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config
4374
+ @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config
4375
+ update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks
4376
+ @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config
4377
+ update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source
4378
+ @update_source = ::Gapic::Config::Method.new update_source_config
4379
+
4380
+ yield self if block_given?
4381
+ end
4382
+ end
4383
+ end
4384
+ end
4385
+ end
4386
+ end
4387
+ end
4388
+ end
4389
+ end
4390
+ end