google-cloud-dlp-v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,795 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Cloud
22
+ module Dlp
23
+ module V2
24
+ # Type of information detected by the API.
25
+ # @!attribute [rw] name
26
+ # @return [String]
27
+ # Name of the information type. Either a name of your choosing when
28
+ # creating a CustomInfoType, or one of the names listed
29
+ # at https://cloud.google.com/dlp/docs/infotypes-reference when specifying
30
+ # a built-in type. InfoType names should conform to the pattern
31
+ # `[a-zA-Z0-9_]{1,64}`.
32
+ class InfoType
33
+ include Google::Protobuf::MessageExts
34
+ extend Google::Protobuf::MessageExts::ClassMethods
35
+ end
36
+
37
+ # A reference to a StoredInfoType to use with scanning.
38
+ # @!attribute [rw] name
39
+ # @return [String]
40
+ # Resource name of the requested `StoredInfoType`, for example
41
+ # `organizations/433245324/storedInfoTypes/432452342` or
42
+ # `projects/project-id/storedInfoTypes/432452342`.
43
+ # @!attribute [rw] create_time
44
+ # @return [Google::Protobuf::Timestamp]
45
+ # Timestamp indicating when the version of the `StoredInfoType` used for
46
+ # inspection was created. Output-only field, populated by the system.
47
+ class StoredType
48
+ include Google::Protobuf::MessageExts
49
+ extend Google::Protobuf::MessageExts::ClassMethods
50
+ end
51
+
52
+ # Custom information type provided by the user. Used to find domain-specific
53
+ # sensitive information configurable to the data in question.
54
+ # @!attribute [rw] info_type
55
+ # @return [Google::Cloud::Dlp::V2::InfoType]
56
+ # CustomInfoType can either be a new infoType, or an extension of built-in
57
+ # infoType, when the name matches one of existing infoTypes and that infoType
58
+ # is specified in `InspectContent.info_types` field. Specifying the latter
59
+ # adds findings to the one detected by the system. If built-in info type is
60
+ # not specified in `InspectContent.info_types` list then the name is treated
61
+ # as a custom info type.
62
+ # @!attribute [rw] likelihood
63
+ # @return [Google::Cloud::Dlp::V2::Likelihood]
64
+ # Likelihood to return for this CustomInfoType. This base value can be
65
+ # altered by a detection rule if the finding meets the criteria specified by
66
+ # the rule. Defaults to `VERY_LIKELY` if not specified.
67
+ # @!attribute [rw] dictionary
68
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::Dictionary]
69
+ # A list of phrases to detect as a CustomInfoType.
70
+ # @!attribute [rw] regex
71
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::Regex]
72
+ # Regular expression based CustomInfoType.
73
+ # @!attribute [rw] surrogate_type
74
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::SurrogateType]
75
+ # Message for detecting output from deidentification transformations that
76
+ # support reversing.
77
+ # @!attribute [rw] stored_type
78
+ # @return [Google::Cloud::Dlp::V2::StoredType]
79
+ # Load an existing `StoredInfoType` resource for use in
80
+ # `InspectDataSource`. Not currently supported in `InspectContent`.
81
+ # @!attribute [rw] detection_rules
82
+ # @return [Array<Google::Cloud::Dlp::V2::CustomInfoType::DetectionRule>]
83
+ # Set of detection rules to apply to all findings of this CustomInfoType.
84
+ # Rules are applied in order that they are specified. Not supported for the
85
+ # `surrogate_type` CustomInfoType.
86
+ # @!attribute [rw] exclusion_type
87
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::ExclusionType]
88
+ # If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding
89
+ # to be returned. It still can be used for rules matching.
90
+ class CustomInfoType
91
+ include Google::Protobuf::MessageExts
92
+ extend Google::Protobuf::MessageExts::ClassMethods
93
+
94
+ # Custom information type based on a dictionary of words or phrases. This can
95
+ # be used to match sensitive information specific to the data, such as a list
96
+ # of employee IDs or job titles.
97
+ #
98
+ # Dictionary words are case-insensitive and all characters other than letters
99
+ # and digits in the unicode [Basic Multilingual
100
+ # Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane)
101
+ # will be replaced with whitespace when scanning for matches, so the
102
+ # dictionary phrase "Sam Johnson" will match all three phrases "sam johnson",
103
+ # "Sam, Johnson", and "Sam (Johnson)". Additionally, the characters
104
+ # surrounding any match must be of a different type than the adjacent
105
+ # characters within the word, so letters must be next to non-letters and
106
+ # digits next to non-digits. For example, the dictionary word "jen" will
107
+ # match the first three letters of the text "jen123" but will return no
108
+ # matches for "jennifer".
109
+ #
110
+ # Dictionary words containing a large number of characters that are not
111
+ # letters or digits may result in unexpected findings because such characters
112
+ # are treated as whitespace. The
113
+ # [limits](https://cloud.google.com/dlp/limits) page contains details about
114
+ # the size limits of dictionaries. For dictionaries that do not fit within
115
+ # these constraints, consider using `LargeCustomDictionaryConfig` in the
116
+ # `StoredInfoType` API.
117
+ # @!attribute [rw] word_list
118
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::Dictionary::WordList]
119
+ # List of words or phrases to search for.
120
+ # @!attribute [rw] cloud_storage_path
121
+ # @return [Google::Cloud::Dlp::V2::CloudStoragePath]
122
+ # Newline-delimited file of words in Cloud Storage. Only a single file
123
+ # is accepted.
124
+ class Dictionary
125
+ include Google::Protobuf::MessageExts
126
+ extend Google::Protobuf::MessageExts::ClassMethods
127
+
128
+ # Message defining a list of words or phrases to search for in the data.
129
+ # @!attribute [rw] words
130
+ # @return [Array<String>]
131
+ # Words or phrases defining the dictionary. The dictionary must contain
132
+ # at least one phrase and every phrase must contain at least 2 characters
133
+ # that are letters or digits. [required]
134
+ class WordList
135
+ include Google::Protobuf::MessageExts
136
+ extend Google::Protobuf::MessageExts::ClassMethods
137
+ end
138
+ end
139
+
140
+ # Message defining a custom regular expression.
141
+ # @!attribute [rw] pattern
142
+ # @return [String]
143
+ # Pattern defining the regular expression. Its syntax
144
+ # (https://github.com/google/re2/wiki/Syntax) can be found under the
145
+ # google/re2 repository on GitHub.
146
+ # @!attribute [rw] group_indexes
147
+ # @return [Array<Integer>]
148
+ # The index of the submatch to extract as findings. When not
149
+ # specified, the entire match is returned. No more than 3 may be included.
150
+ class Regex
151
+ include Google::Protobuf::MessageExts
152
+ extend Google::Protobuf::MessageExts::ClassMethods
153
+ end
154
+
155
+ # Message for detecting output from deidentification transformations
156
+ # such as
157
+ # [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig).
158
+ # These types of transformations are
159
+ # those that perform pseudonymization, thereby producing a "surrogate" as
160
+ # output. This should be used in conjunction with a field on the
161
+ # transformation such as `surrogate_info_type`. This CustomInfoType does
162
+ # not support the use of `detection_rules`.
163
+ class SurrogateType
164
+ include Google::Protobuf::MessageExts
165
+ extend Google::Protobuf::MessageExts::ClassMethods
166
+ end
167
+
168
+ # Deprecated; use `InspectionRuleSet` instead. Rule for modifying a
169
+ # `CustomInfoType` to alter behavior under certain circumstances, depending
170
+ # on the specific details of the rule. Not supported for the `surrogate_type`
171
+ # custom infoType.
172
+ # @!attribute [rw] hotword_rule
173
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::DetectionRule::HotwordRule]
174
+ # Hotword-based detection rule.
175
+ class DetectionRule
176
+ include Google::Protobuf::MessageExts
177
+ extend Google::Protobuf::MessageExts::ClassMethods
178
+
179
+ # Message for specifying a window around a finding to apply a detection
180
+ # rule.
181
+ # @!attribute [rw] window_before
182
+ # @return [Integer]
183
+ # Number of characters before the finding to consider.
184
+ # @!attribute [rw] window_after
185
+ # @return [Integer]
186
+ # Number of characters after the finding to consider.
187
+ class Proximity
188
+ include Google::Protobuf::MessageExts
189
+ extend Google::Protobuf::MessageExts::ClassMethods
190
+ end
191
+
192
+ # Message for specifying an adjustment to the likelihood of a finding as
193
+ # part of a detection rule.
194
+ # @!attribute [rw] fixed_likelihood
195
+ # @return [Google::Cloud::Dlp::V2::Likelihood]
196
+ # Set the likelihood of a finding to a fixed value.
197
+ # @!attribute [rw] relative_likelihood
198
+ # @return [Integer]
199
+ # Increase or decrease the likelihood by the specified number of
200
+ # levels. For example, if a finding would be `POSSIBLE` without the
201
+ # detection rule and `relative_likelihood` is 1, then it is upgraded to
202
+ # `LIKELY`, while a value of -1 would downgrade it to `UNLIKELY`.
203
+ # Likelihood may never drop below `VERY_UNLIKELY` or exceed
204
+ # `VERY_LIKELY`, so applying an adjustment of 1 followed by an
205
+ # adjustment of -1 when base likelihood is `VERY_LIKELY` will result in
206
+ # a final likelihood of `LIKELY`.
207
+ class LikelihoodAdjustment
208
+ include Google::Protobuf::MessageExts
209
+ extend Google::Protobuf::MessageExts::ClassMethods
210
+ end
211
+
212
+ # The rule that adjusts the likelihood of findings within a certain
213
+ # proximity of hotwords.
214
+ # @!attribute [rw] hotword_regex
215
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::Regex]
216
+ # Regular expression pattern defining what qualifies as a hotword.
217
+ # @!attribute [rw] proximity
218
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::DetectionRule::Proximity]
219
+ # Proximity of the finding within which the entire hotword must reside.
220
+ # The total length of the window cannot exceed 1000 characters. Note that
221
+ # the finding itself will be included in the window, so that hotwords may
222
+ # be used to match substrings of the finding itself. For example, the
223
+ # certainty of a phone number regex "\(\d\\{3}\) \d\\{3}-\d\\{4}" could be
224
+ # adjusted upwards if the area code is known to be the local area code of
225
+ # a company office using the hotword regex "\(xxx\)", where "xxx"
226
+ # is the area code in question.
227
+ # @!attribute [rw] likelihood_adjustment
228
+ # @return [Google::Cloud::Dlp::V2::CustomInfoType::DetectionRule::LikelihoodAdjustment]
229
+ # Likelihood adjustment to apply to all matching findings.
230
+ class HotwordRule
231
+ include Google::Protobuf::MessageExts
232
+ extend Google::Protobuf::MessageExts::ClassMethods
233
+ end
234
+ end
235
+
236
+ module ExclusionType
237
+ # A finding of this custom info type will not be excluded from results.
238
+ EXCLUSION_TYPE_UNSPECIFIED = 0
239
+
240
+ # A finding of this custom info type will be excluded from final results,
241
+ # but can still affect rule execution.
242
+ EXCLUSION_TYPE_EXCLUDE = 1
243
+ end
244
+ end
245
+
246
+ # General identifier of a data field in a storage service.
247
+ # @!attribute [rw] name
248
+ # @return [String]
249
+ # Name describing the field.
250
+ class FieldId
251
+ include Google::Protobuf::MessageExts
252
+ extend Google::Protobuf::MessageExts::ClassMethods
253
+ end
254
+
255
+ # Datastore partition ID.
256
+ # A partition ID identifies a grouping of entities. The grouping is always
257
+ # by project and namespace, however the namespace ID may be empty.
258
+ #
259
+ # A partition ID contains several dimensions:
260
+ # project ID and namespace ID.
261
+ # @!attribute [rw] project_id
262
+ # @return [String]
263
+ # The ID of the project to which the entities belong.
264
+ # @!attribute [rw] namespace_id
265
+ # @return [String]
266
+ # If not empty, the ID of the namespace to which the entities belong.
267
+ class PartitionId
268
+ include Google::Protobuf::MessageExts
269
+ extend Google::Protobuf::MessageExts::ClassMethods
270
+ end
271
+
272
+ # A representation of a Datastore kind.
273
+ # @!attribute [rw] name
274
+ # @return [String]
275
+ # The name of the kind.
276
+ class KindExpression
277
+ include Google::Protobuf::MessageExts
278
+ extend Google::Protobuf::MessageExts::ClassMethods
279
+ end
280
+
281
+ # Options defining a data set within Google Cloud Datastore.
282
+ # @!attribute [rw] partition_id
283
+ # @return [Google::Cloud::Dlp::V2::PartitionId]
284
+ # A partition ID identifies a grouping of entities. The grouping is always
285
+ # by project and namespace, however the namespace ID may be empty.
286
+ # @!attribute [rw] kind
287
+ # @return [Google::Cloud::Dlp::V2::KindExpression]
288
+ # The kind to process.
289
+ class DatastoreOptions
290
+ include Google::Protobuf::MessageExts
291
+ extend Google::Protobuf::MessageExts::ClassMethods
292
+ end
293
+
294
+ # Message representing a set of files in a Cloud Storage bucket. Regular
295
+ # expressions are used to allow fine-grained control over which files in the
296
+ # bucket to include.
297
+ #
298
+ # Included files are those that match at least one item in `include_regex` and
299
+ # do not match any items in `exclude_regex`. Note that a file that matches
300
+ # items from both lists will _not_ be included. For a match to occur, the
301
+ # entire file path (i.e., everything in the url after the bucket name) must
302
+ # match the regular expression.
303
+ #
304
+ # For example, given the input `{bucket_name: "mybucket", include_regex:
305
+ # ["directory1/.*"], exclude_regex:
306
+ # ["directory1/excluded.*"]}`:
307
+ #
308
+ # * `gs://mybucket/directory1/myfile` will be included
309
+ # * `gs://mybucket/directory1/directory2/myfile` will be included (`.*` matches
310
+ # across `/`)
311
+ # * `gs://mybucket/directory0/directory1/myfile` will _not_ be included (the
312
+ # full path doesn't match any items in `include_regex`)
313
+ # * `gs://mybucket/directory1/excludedfile` will _not_ be included (the path
314
+ # matches an item in `exclude_regex`)
315
+ #
316
+ # If `include_regex` is left empty, it will match all files by default
317
+ # (this is equivalent to setting `include_regex: [".*"]`).
318
+ #
319
+ # Some other common use cases:
320
+ #
321
+ # * `{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}` will include all
322
+ # files in `mybucket` except for .pdf files
323
+ # * `{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}` will
324
+ # include all files directly under `gs://mybucket/directory/`, without matching
325
+ # across `/`
326
+ # @!attribute [rw] bucket_name
327
+ # @return [String]
328
+ # The name of a Cloud Storage bucket. Required.
329
+ # @!attribute [rw] include_regex
330
+ # @return [Array<String>]
331
+ # A list of regular expressions matching file paths to include. All files in
332
+ # the bucket that match at least one of these regular expressions will be
333
+ # included in the set of files, except for those that also match an item in
334
+ # `exclude_regex`. Leaving this field empty will match all files by default
335
+ # (this is equivalent to including `.*` in the list).
336
+ #
337
+ # Regular expressions use RE2
338
+ # [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
339
+ # under the google/re2 repository on GitHub.
340
+ # @!attribute [rw] exclude_regex
341
+ # @return [Array<String>]
342
+ # A list of regular expressions matching file paths to exclude. All files in
343
+ # the bucket that match at least one of these regular expressions will be
344
+ # excluded from the scan.
345
+ #
346
+ # Regular expressions use RE2
347
+ # [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
348
+ # under the google/re2 repository on GitHub.
349
+ class CloudStorageRegexFileSet
350
+ include Google::Protobuf::MessageExts
351
+ extend Google::Protobuf::MessageExts::ClassMethods
352
+ end
353
+
354
+ # Options defining a file or a set of files within a Google Cloud Storage
355
+ # bucket.
356
+ # @!attribute [rw] file_set
357
+ # @return [Google::Cloud::Dlp::V2::CloudStorageOptions::FileSet]
358
+ # The set of one or more files to scan.
359
+ # @!attribute [rw] bytes_limit_per_file
360
+ # @return [Integer]
361
+ # Max number of bytes to scan from a file. If a scanned file's size is bigger
362
+ # than this value then the rest of the bytes are omitted. Only one
363
+ # of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
364
+ # @!attribute [rw] bytes_limit_per_file_percent
365
+ # @return [Integer]
366
+ # Max percentage of bytes to scan from a file. The rest are omitted. The
367
+ # number of bytes scanned is rounded down. Must be between 0 and 100,
368
+ # inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one
369
+ # of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
370
+ # @!attribute [rw] file_types
371
+ # @return [Array<Google::Cloud::Dlp::V2::FileType>]
372
+ # List of file type groups to include in the scan.
373
+ # If empty, all files are scanned and available data format processors
374
+ # are applied. In addition, the binary content of the selected files
375
+ # is always scanned as well.
376
+ # @!attribute [rw] sample_method
377
+ # @return [Google::Cloud::Dlp::V2::CloudStorageOptions::SampleMethod]
378
+ # @!attribute [rw] files_limit_percent
379
+ # @return [Integer]
380
+ # Limits the number of files to scan to this percentage of the input FileSet.
381
+ # Number of files scanned is rounded down. Must be between 0 and 100,
382
+ # inclusively. Both 0 and 100 means no limit. Defaults to 0.
383
+ class CloudStorageOptions
384
+ include Google::Protobuf::MessageExts
385
+ extend Google::Protobuf::MessageExts::ClassMethods
386
+
387
+ # Set of files to scan.
388
+ # @!attribute [rw] url
389
+ # @return [String]
390
+ # The Cloud Storage url of the file(s) to scan, in the format
391
+ # `gs://<bucket>/<path>`. Trailing wildcard in the path is allowed.
392
+ #
393
+ # If the url ends in a trailing slash, the bucket or directory represented
394
+ # by the url will be scanned non-recursively (content in sub-directories
395
+ # will not be scanned). This means that `gs://mybucket/` is equivalent to
396
+ # `gs://mybucket/*`, and `gs://mybucket/directory/` is equivalent to
397
+ # `gs://mybucket/directory/*`.
398
+ #
399
+ # Exactly one of `url` or `regex_file_set` must be set.
400
+ # @!attribute [rw] regex_file_set
401
+ # @return [Google::Cloud::Dlp::V2::CloudStorageRegexFileSet]
402
+ # The regex-filtered set of files to scan. Exactly one of `url` or
403
+ # `regex_file_set` must be set.
404
+ class FileSet
405
+ include Google::Protobuf::MessageExts
406
+ extend Google::Protobuf::MessageExts::ClassMethods
407
+ end
408
+
409
+ # How to sample bytes if not all bytes are scanned. Meaningful only when used
410
+ # in conjunction with bytes_limit_per_file. If not specified, scanning would
411
+ # start from the top.
412
+ module SampleMethod
413
+ SAMPLE_METHOD_UNSPECIFIED = 0
414
+
415
+ # Scan from the top (default).
416
+ TOP = 1
417
+
418
+ # For each file larger than bytes_limit_per_file, randomly pick the offset
419
+ # to start scanning. The scanned bytes are contiguous.
420
+ RANDOM_START = 2
421
+ end
422
+ end
423
+
424
+ # Message representing a set of files in Cloud Storage.
425
+ # @!attribute [rw] url
426
+ # @return [String]
427
+ # The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
428
+ # path is allowed.
429
+ class CloudStorageFileSet
430
+ include Google::Protobuf::MessageExts
431
+ extend Google::Protobuf::MessageExts::ClassMethods
432
+ end
433
+
434
+ # Message representing a single file or path in Cloud Storage.
435
+ # @!attribute [rw] path
436
+ # @return [String]
437
+ # A url representing a file or path (no wildcards) in Cloud Storage.
438
+ # Example: gs://[BUCKET_NAME]/dictionary.txt
439
+ class CloudStoragePath
440
+ include Google::Protobuf::MessageExts
441
+ extend Google::Protobuf::MessageExts::ClassMethods
442
+ end
443
+
444
+ # Options defining BigQuery table and row identifiers.
445
+ # @!attribute [rw] table_reference
446
+ # @return [Google::Cloud::Dlp::V2::BigQueryTable]
447
+ # Complete BigQuery table reference.
448
+ # @!attribute [rw] identifying_fields
449
+ # @return [Array<Google::Cloud::Dlp::V2::FieldId>]
450
+ # Table fields that may uniquely identify a row within the table. When
451
+ # `actions.saveFindings.outputConfig.table` is specified, the values of
452
+ # columns specified here are available in the output table under
453
+ # `location.content_locations.record_location.record_key.id_values`. Nested
454
+ # fields such as `person.birthdate.year` are allowed.
455
+ # @!attribute [rw] rows_limit
456
+ # @return [Integer]
457
+ # Max number of rows to scan. If the table has more rows than this value, the
458
+ # rest of the rows are omitted. If not set, or if set to 0, all rows will be
459
+ # scanned. Only one of rows_limit and rows_limit_percent can be specified.
460
+ # Cannot be used in conjunction with TimespanConfig.
461
+ # @!attribute [rw] rows_limit_percent
462
+ # @return [Integer]
463
+ # Max percentage of rows to scan. The rest are omitted. The number of rows
464
+ # scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and
465
+ # 100 means no limit. Defaults to 0. Only one of rows_limit and
466
+ # rows_limit_percent can be specified. Cannot be used in conjunction with
467
+ # TimespanConfig.
468
+ # @!attribute [rw] sample_method
469
+ # @return [Google::Cloud::Dlp::V2::BigQueryOptions::SampleMethod]
470
+ # @!attribute [rw] excluded_fields
471
+ # @return [Array<Google::Cloud::Dlp::V2::FieldId>]
472
+ # References to fields excluded from scanning. This allows you to skip
473
+ # inspection of entire columns which you know have no findings.
474
+ class BigQueryOptions
475
+ include Google::Protobuf::MessageExts
476
+ extend Google::Protobuf::MessageExts::ClassMethods
477
+
478
+ # How to sample rows if not all rows are scanned. Meaningful only when used
479
+ # in conjunction with either rows_limit or rows_limit_percent. If not
480
+ # specified, scanning would start from the top.
481
+ module SampleMethod
482
+ SAMPLE_METHOD_UNSPECIFIED = 0
483
+
484
+ # Scan from the top (default).
485
+ TOP = 1
486
+
487
+ # Randomly pick the row to start scanning. The scanned rows are contiguous.
488
+ RANDOM_START = 2
489
+ end
490
+ end
491
+
492
+ # Shared message indicating Cloud storage type.
493
+ # @!attribute [rw] datastore_options
494
+ # @return [Google::Cloud::Dlp::V2::DatastoreOptions]
495
+ # Google Cloud Datastore options.
496
+ # @!attribute [rw] cloud_storage_options
497
+ # @return [Google::Cloud::Dlp::V2::CloudStorageOptions]
498
+ # Google Cloud Storage options.
499
+ # @!attribute [rw] big_query_options
500
+ # @return [Google::Cloud::Dlp::V2::BigQueryOptions]
501
+ # BigQuery options.
502
+ # @!attribute [rw] hybrid_options
503
+ # @return [Google::Cloud::Dlp::V2::HybridOptions]
504
+ # Hybrid inspection options.
505
+ # Early access feature is in a pre-release state and might change or have
506
+ # limited support. For more information, see
507
+ # https://cloud.google.com/products#product-launch-stages.
508
+ # @!attribute [rw] timespan_config
509
+ # @return [Google::Cloud::Dlp::V2::StorageConfig::TimespanConfig]
510
+ class StorageConfig
511
+ include Google::Protobuf::MessageExts
512
+ extend Google::Protobuf::MessageExts::ClassMethods
513
+
514
+ # Configuration of the timespan of the items to include in scanning.
515
+ # Currently only supported when inspecting Google Cloud Storage and BigQuery.
516
+ # @!attribute [rw] start_time
517
+ # @return [Google::Protobuf::Timestamp]
518
+ # Exclude files or rows older than this value.
519
+ # @!attribute [rw] end_time
520
+ # @return [Google::Protobuf::Timestamp]
521
+ # Exclude files or rows newer than this value.
522
+ # If set to zero, no upper time limit is applied.
523
+ # @!attribute [rw] timestamp_field
524
+ # @return [Google::Cloud::Dlp::V2::FieldId]
525
+ # Specification of the field containing the timestamp of scanned items.
526
+ # Used for data sources like Datastore and BigQuery.
527
+ #
528
+ # For BigQuery:
529
+ # Required to filter out rows based on the given start and
530
+ # end times. If not specified and the table was modified between the given
531
+ # start and end times, the entire table will be scanned.
532
+ # The valid data types of the timestamp field are: `INTEGER`, `DATE`,
533
+ # `TIMESTAMP`, or `DATETIME` BigQuery column.
534
+ #
535
+ # For Datastore.
536
+ # Valid data types of the timestamp field are: `TIMESTAMP`.
537
+ # Datastore entity will be scanned if the timestamp property does not
538
+ # exist or its value is empty or invalid.
539
+ # @!attribute [rw] enable_auto_population_of_timespan_config
540
+ # @return [Boolean]
541
+ # When the job is started by a JobTrigger we will automatically figure out
542
+ # a valid start_time to avoid scanning files that have not been modified
543
+ # since the last time the JobTrigger executed. This will be based on the
544
+ # time of the execution of the last run of the JobTrigger.
545
+ class TimespanConfig
546
+ include Google::Protobuf::MessageExts
547
+ extend Google::Protobuf::MessageExts::ClassMethods
548
+ end
549
+ end
550
+
551
+ # Configuration to control jobs where the content being inspected is outside
552
+ # of Google Cloud Platform.
553
+ # @!attribute [rw] description
554
+ # @return [String]
555
+ # A short description of where the data is coming from. Will be stored once
556
+ # in the job. 256 max length.
557
+ # @!attribute [rw] required_finding_label_keys
558
+ # @return [Array<String>]
559
+ # These are labels that each inspection request must include within their
560
+ # 'finding_labels' map. Request may contain others, but any missing one of
561
+ # these will be rejected.
562
+ #
563
+ # Label keys must be between 1 and 63 characters long and must conform
564
+ # to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
565
+ #
566
+ # No more than 10 keys can be required.
567
+ # @!attribute [rw] labels
568
+ # @return [Google::Protobuf::Map{String => String}]
569
+ # To organize findings, these labels will be added to each finding.
570
+ #
571
+ # Label keys must be between 1 and 63 characters long and must conform
572
+ # to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
573
+ #
574
+ # Label values must be between 0 and 63 characters long and must conform
575
+ # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
576
+ #
577
+ # No more than 10 labels can be associated with a given finding.
578
+ #
579
+ # Examples:
580
+ # * `"environment" : "production"`
581
+ # * `"pipeline" : "etl"`
582
+ # @!attribute [rw] table_options
583
+ # @return [Google::Cloud::Dlp::V2::TableOptions]
584
+ # If the container is a table, additional information to make findings
585
+ # meaningful such as the columns that are primary keys.
586
+ class HybridOptions
587
+ include Google::Protobuf::MessageExts
588
+ extend Google::Protobuf::MessageExts::ClassMethods
589
+
590
+ # @!attribute [rw] key
591
+ # @return [String]
592
+ # @!attribute [rw] value
593
+ # @return [String]
594
+ class LabelsEntry
595
+ include Google::Protobuf::MessageExts
596
+ extend Google::Protobuf::MessageExts::ClassMethods
597
+ end
598
+ end
599
+
600
+ # Row key for identifying a record in BigQuery table.
601
+ # @!attribute [rw] table_reference
602
+ # @return [Google::Cloud::Dlp::V2::BigQueryTable]
603
+ # Complete BigQuery table reference.
604
+ # @!attribute [rw] row_number
605
+ # @return [Integer]
606
+ # Row number inferred at the time the table was scanned. This value is
607
+ # nondeterministic, cannot be queried, and may be null for inspection
608
+ # jobs. To locate findings within a table, specify
609
+ # `inspect_job.storage_config.big_query_options.identifying_fields` in
610
+ # `CreateDlpJobRequest`.
611
+ class BigQueryKey
612
+ include Google::Protobuf::MessageExts
613
+ extend Google::Protobuf::MessageExts::ClassMethods
614
+ end
615
+
616
+ # Record key for a finding in Cloud Datastore.
617
+ # @!attribute [rw] entity_key
618
+ # @return [Google::Cloud::Dlp::V2::Key]
619
+ # Datastore entity key.
620
+ class DatastoreKey
621
+ include Google::Protobuf::MessageExts
622
+ extend Google::Protobuf::MessageExts::ClassMethods
623
+ end
624
+
625
+ # A unique identifier for a Datastore entity.
626
+ # If a key's partition ID or any of its path kinds or names are
627
+ # reserved/read-only, the key is reserved/read-only.
628
+ # A reserved/read-only key is forbidden in certain documented contexts.
629
+ # @!attribute [rw] partition_id
630
+ # @return [Google::Cloud::Dlp::V2::PartitionId]
631
+ # Entities are partitioned into subsets, currently identified by a project
632
+ # ID and namespace ID.
633
+ # Queries are scoped to a single partition.
634
+ # @!attribute [rw] path
635
+ # @return [Array<Google::Cloud::Dlp::V2::Key::PathElement>]
636
+ # The entity path.
637
+ # An entity path consists of one or more elements composed of a kind and a
638
+ # string or numerical identifier, which identify entities. The first
639
+ # element identifies a _root entity_, the second element identifies
640
+ # a _child_ of the root entity, the third element identifies a child of the
641
+ # second entity, and so forth. The entities identified by all prefixes of
642
+ # the path are called the element's _ancestors_.
643
+ #
644
+ # A path can never be empty, and a path can have at most 100 elements.
645
+ class Key
646
+ include Google::Protobuf::MessageExts
647
+ extend Google::Protobuf::MessageExts::ClassMethods
648
+
649
+ # A (kind, ID/name) pair used to construct a key path.
650
+ #
651
+ # If either name or ID is set, the element is complete.
652
+ # If neither is set, the element is incomplete.
653
+ # @!attribute [rw] kind
654
+ # @return [String]
655
+ # The kind of the entity.
656
+ # A kind matching regex `__.*__` is reserved/read-only.
657
+ # A kind must not contain more than 1500 bytes when UTF-8 encoded.
658
+ # Cannot be `""`.
659
+ # @!attribute [rw] id
660
+ # @return [Integer]
661
+ # The auto-allocated ID of the entity.
662
+ # Never equal to zero. Values less than zero are discouraged and may not
663
+ # be supported in the future.
664
+ # @!attribute [rw] name
665
+ # @return [String]
666
+ # The name of the entity.
667
+ # A name matching regex `__.*__` is reserved/read-only.
668
+ # A name must not be more than 1500 bytes when UTF-8 encoded.
669
+ # Cannot be `""`.
670
+ class PathElement
671
+ include Google::Protobuf::MessageExts
672
+ extend Google::Protobuf::MessageExts::ClassMethods
673
+ end
674
+ end
675
+
676
+ # Message for a unique key indicating a record that contains a finding.
677
+ # @!attribute [rw] datastore_key
678
+ # @return [Google::Cloud::Dlp::V2::DatastoreKey]
679
+ # @!attribute [rw] big_query_key
680
+ # @return [Google::Cloud::Dlp::V2::BigQueryKey]
681
+ # @!attribute [rw] id_values
682
+ # @return [Array<String>]
683
+ # Values of identifying columns in the given row. Order of values matches
684
+ # the order of `identifying_fields` specified in the scanning request.
685
+ class RecordKey
686
+ include Google::Protobuf::MessageExts
687
+ extend Google::Protobuf::MessageExts::ClassMethods
688
+ end
689
+
690
+ # Message defining the location of a BigQuery table. A table is uniquely
691
+ # identified by its project_id, dataset_id, and table_name. Within a query
692
+ # a table is often referenced with a string in the format of:
693
+ # `<project_id>:<dataset_id>.<table_id>` or
694
+ # `<project_id>.<dataset_id>.<table_id>`.
695
+ # @!attribute [rw] project_id
696
+ # @return [String]
697
+ # The Google Cloud Platform project ID of the project containing the table.
698
+ # If omitted, project ID is inferred from the API call.
699
+ # @!attribute [rw] dataset_id
700
+ # @return [String]
701
+ # Dataset ID of the table.
702
+ # @!attribute [rw] table_id
703
+ # @return [String]
704
+ # Name of the table.
705
+ class BigQueryTable
706
+ include Google::Protobuf::MessageExts
707
+ extend Google::Protobuf::MessageExts::ClassMethods
708
+ end
709
+
710
+ # Message defining a field of a BigQuery table.
711
+ # @!attribute [rw] table
712
+ # @return [Google::Cloud::Dlp::V2::BigQueryTable]
713
+ # Source table of the field.
714
+ # @!attribute [rw] field
715
+ # @return [Google::Cloud::Dlp::V2::FieldId]
716
+ # Designated field in the BigQuery table.
717
+ class BigQueryField
718
+ include Google::Protobuf::MessageExts
719
+ extend Google::Protobuf::MessageExts::ClassMethods
720
+ end
721
+
722
+ # An entity in a dataset is a field or set of fields that correspond to a
723
+ # single person. For example, in medical records the `EntityId` might be a
724
+ # patient identifier, or for financial records it might be an account
725
+ # identifier. This message is used when generalizations or analysis must take
726
+ # into account that multiple rows correspond to the same entity.
727
+ # @!attribute [rw] field
728
+ # @return [Google::Cloud::Dlp::V2::FieldId]
729
+ # Composite key indicating which field contains the entity identifier.
730
+ class EntityId
731
+ include Google::Protobuf::MessageExts
732
+ extend Google::Protobuf::MessageExts::ClassMethods
733
+ end
734
+
735
+ # Instructions regarding the table content being inspected.
736
+ # @!attribute [rw] identifying_fields
737
+ # @return [Array<Google::Cloud::Dlp::V2::FieldId>]
738
+ # The columns that are the primary keys for table objects included in
739
+ # ContentItem. A copy of this cell's value will stored alongside alongside
740
+ # each finding so that the finding can be traced to the specific row it came
741
+ # from. No more than 3 may be provided.
742
+ class TableOptions
743
+ include Google::Protobuf::MessageExts
744
+ extend Google::Protobuf::MessageExts::ClassMethods
745
+ end
746
+
747
+ # Categorization of results based on how likely they are to represent a match,
748
+ # based on the number of elements they contain which imply a match.
749
+ module Likelihood
750
+ # Default value; same as POSSIBLE.
751
+ LIKELIHOOD_UNSPECIFIED = 0
752
+
753
+ # Few matching elements.
754
+ VERY_UNLIKELY = 1
755
+
756
+ UNLIKELY = 2
757
+
758
+ # Some matching elements.
759
+ POSSIBLE = 3
760
+
761
+ LIKELY = 4
762
+
763
+ # Many matching elements.
764
+ VERY_LIKELY = 5
765
+ end
766
+
767
+ # Definitions of file type groups to scan.
768
+ module FileType
769
+ # Includes all files.
770
+ FILE_TYPE_UNSPECIFIED = 0
771
+
772
+ # Includes all file extensions not covered by text file types.
773
+ BINARY_FILE = 1
774
+
775
+ # Included file extensions:
776
+ # asc, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh, hpp,
777
+ # hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json,
778
+ # ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw,
779
+ # rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml,
780
+ # xml, xsl, xsd, yml, yaml.
781
+ TEXT_FILE = 2
782
+
783
+ # Included file extensions:
784
+ # bmp, gif, jpg, jpeg, jpe, png.
785
+ # bytes_limit_per_file has no effect on image files.
786
+ IMAGE = 3
787
+
788
+ # Included file extensions:
789
+ # avro
790
+ AVRO = 7
791
+ end
792
+ end
793
+ end
794
+ end
795
+ end