google-cloud-dlp 0.15.0 → 1.0.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.
data/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- https://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- https://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,155 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/dlp/v2/dlp_service_client"
17
-
18
- module Google
19
- module Cloud
20
- module Dlp
21
- # rubocop:disable LineLength
22
-
23
- ##
24
- # # Ruby Client for Cloud Data Loss Prevention (DLP) API
25
- #
26
- # [Cloud Data Loss Prevention (DLP) API][Product Documentation]:
27
- # Provides methods for detection, risk analysis, and de-identification of
28
- # privacy-sensitive fragments in text, images, and Google Cloud Platform
29
- # storage repositories.
30
- # - [Product Documentation][]
31
- #
32
- # ## Quick Start
33
- # In order to use this library, you first need to go through the following
34
- # steps:
35
- #
36
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
37
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
38
- # 3. [Enable the Cloud Data Loss Prevention (DLP) API.](https://console.cloud.google.com/apis/library/dlp.googleapis.com)
39
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-dlp/latest/file.AUTHENTICATION.html)
40
- #
41
- # ### Installation
42
- # ```
43
- # $ gem install google-cloud-dlp
44
- # ```
45
- #
46
- # ### Next Steps
47
- # - Read the [Cloud Data Loss Prevention (DLP) API Product documentation][Product Documentation]
48
- # to learn more about the product and see How-to Guides.
49
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
50
- # to see the full list of Cloud APIs that we cover.
51
- #
52
- # [Product Documentation]: https://cloud.google.com/dlp
53
- #
54
- # ## Enabling Logging
55
- #
56
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
57
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
58
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
59
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
60
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
61
- #
62
- # Configuring a Ruby stdlib logger:
63
- #
64
- # ```ruby
65
- # require "logger"
66
- #
67
- # module MyLogger
68
- # LOGGER = Logger.new $stderr, level: Logger::WARN
69
- # def logger
70
- # LOGGER
71
- # end
72
- # end
73
- #
74
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
75
- # module GRPC
76
- # extend MyLogger
77
- # end
78
- # ```
79
- #
80
- module V2
81
- # rubocop:enable LineLength
82
-
83
- ##
84
- # The Cloud Data Loss Prevention (DLP) API is a service that allows clients
85
- # to detect the presence of Personally Identifiable Information (PII) and other
86
- # privacy-sensitive data in user-supplied, unstructured data streams, like text
87
- # blocks or images.
88
- # The service also includes methods for sensitive data redaction and
89
- # scheduling of data scans on Google Cloud Platform based data sets.
90
- #
91
- # To learn more about concepts and find how-to guides see
92
- # https://cloud.google.com/dlp/docs/.
93
- #
94
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
95
- # Provides the means for authenticating requests made by the client. This parameter can
96
- # be many types.
97
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
98
- # authenticating requests made by this client.
99
- # A `String` will be treated as the path to the keyfile to be used for the construction of
100
- # credentials for this client.
101
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
102
- # credentials for this client.
103
- # A `GRPC::Core::Channel` will be used to make calls through.
104
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
105
- # should already be composed with a `GRPC::Core::CallCredentials` object.
106
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
107
- # metadata for requests, generally, to give OAuth credentials.
108
- # @param scopes [Array<String>]
109
- # The OAuth scopes for this service. This parameter is ignored if
110
- # an updater_proc is supplied.
111
- # @param client_config [Hash]
112
- # A Hash for call options for each method. See
113
- # Google::Gax#construct_settings for the structure of
114
- # this data. Falls back to the default config if not specified
115
- # or the specified config is missing data points.
116
- # @param timeout [Numeric]
117
- # The default timeout, in seconds, for calls made through this client.
118
- # @param metadata [Hash]
119
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
120
- # @param service_address [String]
121
- # Override for the service hostname, or `nil` to leave as the default.
122
- # @param service_port [Integer]
123
- # Override for the service port, or `nil` to leave as the default.
124
- # @param exception_transformer [Proc]
125
- # An optional proc that intercepts any exceptions raised during an API call to inject
126
- # custom error handling.
127
- def self.new \
128
- credentials: nil,
129
- scopes: nil,
130
- client_config: nil,
131
- timeout: nil,
132
- metadata: nil,
133
- service_address: nil,
134
- service_port: nil,
135
- exception_transformer: nil,
136
- lib_name: nil,
137
- lib_version: nil
138
- kwargs = {
139
- credentials: credentials,
140
- scopes: scopes,
141
- client_config: client_config,
142
- timeout: timeout,
143
- metadata: metadata,
144
- exception_transformer: exception_transformer,
145
- lib_name: lib_name,
146
- service_address: service_address,
147
- service_port: service_port,
148
- lib_version: lib_version
149
- }.select { |_, v| v != nil }
150
- Google::Cloud::Dlp::V2::DlpServiceClient.new(**kwargs)
151
- end
152
- end
153
- end
154
- end
155
- end
@@ -1,41 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "googleauth"
17
-
18
- module Google
19
- module Cloud
20
- module Dlp
21
- module V2
22
- class Credentials < Google::Auth::Credentials
23
- SCOPE = [
24
- "https://www.googleapis.com/auth/cloud-platform"
25
- ].freeze
26
- PATH_ENV_VARS = %w(DLP_CREDENTIALS
27
- DLP_KEYFILE
28
- GOOGLE_CLOUD_CREDENTIALS
29
- GOOGLE_CLOUD_KEYFILE
30
- GCLOUD_KEYFILE)
31
- JSON_ENV_VARS = %w(DLP_CREDENTIALS_JSON
32
- DLP_KEYFILE_JSON
33
- GOOGLE_CLOUD_CREDENTIALS_JSON
34
- GOOGLE_CLOUD_KEYFILE_JSON
35
- GCLOUD_KEYFILE_JSON)
36
- DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,2368 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/privacy/dlp/v2/dlp_pb"
29
- require "google/cloud/dlp/v2/credentials"
30
- require "google/cloud/dlp/version"
31
-
32
- module Google
33
- module Cloud
34
- module Dlp
35
- module V2
36
- # The Cloud Data Loss Prevention (DLP) API is a service that allows clients
37
- # to detect the presence of Personally Identifiable Information (PII) and other
38
- # privacy-sensitive data in user-supplied, unstructured data streams, like text
39
- # blocks or images.
40
- # The service also includes methods for sensitive data redaction and
41
- # scheduling of data scans on Google Cloud Platform based data sets.
42
- #
43
- # To learn more about concepts and find how-to guides see
44
- # https://cloud.google.com/dlp/docs/.
45
- #
46
- # @!attribute [r] dlp_service_stub
47
- # @return [Google::Privacy::Dlp::V2::DlpService::Stub]
48
- class DlpServiceClient
49
- # @private
50
- attr_reader :dlp_service_stub
51
-
52
- # The default address of the service.
53
- SERVICE_ADDRESS = "dlp.googleapis.com".freeze
54
-
55
- # The default port of the service.
56
- DEFAULT_SERVICE_PORT = 443
57
-
58
- # The default set of gRPC interceptors.
59
- GRPC_INTERCEPTORS = []
60
-
61
- DEFAULT_TIMEOUT = 30
62
-
63
- PAGE_DESCRIPTORS = {
64
- "list_inspect_templates" => Google::Gax::PageDescriptor.new(
65
- "page_token",
66
- "next_page_token",
67
- "inspect_templates"),
68
- "list_deidentify_templates" => Google::Gax::PageDescriptor.new(
69
- "page_token",
70
- "next_page_token",
71
- "deidentify_templates"),
72
- "list_dlp_jobs" => Google::Gax::PageDescriptor.new(
73
- "page_token",
74
- "next_page_token",
75
- "jobs"),
76
- "list_job_triggers" => Google::Gax::PageDescriptor.new(
77
- "page_token",
78
- "next_page_token",
79
- "job_triggers"),
80
- "list_stored_info_types" => Google::Gax::PageDescriptor.new(
81
- "page_token",
82
- "next_page_token",
83
- "stored_info_types")
84
- }.freeze
85
-
86
- private_constant :PAGE_DESCRIPTORS
87
-
88
- # The scopes needed to make gRPC calls to all of the methods defined in
89
- # this service.
90
- ALL_SCOPES = [
91
- "https://www.googleapis.com/auth/cloud-platform"
92
- ].freeze
93
-
94
-
95
- DLP_JOB_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
96
- "projects/{project}/dlpJobs/{dlp_job}"
97
- )
98
-
99
- private_constant :DLP_JOB_PATH_TEMPLATE
100
-
101
- ORGANIZATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
102
- "organizations/{organization}"
103
- )
104
-
105
- private_constant :ORGANIZATION_PATH_TEMPLATE
106
-
107
- ORGANIZATION_DEIDENTIFY_TEMPLATE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
108
- "organizations/{organization}/deidentifyTemplates/{deidentify_template}"
109
- )
110
-
111
- private_constant :ORGANIZATION_DEIDENTIFY_TEMPLATE_PATH_TEMPLATE
112
-
113
- ORGANIZATION_INSPECT_TEMPLATE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
114
- "organizations/{organization}/inspectTemplates/{inspect_template}"
115
- )
116
-
117
- private_constant :ORGANIZATION_INSPECT_TEMPLATE_PATH_TEMPLATE
118
-
119
- ORGANIZATION_STORED_INFO_TYPE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
120
- "organizations/{organization}/storedInfoTypes/{stored_info_type}"
121
- )
122
-
123
- private_constant :ORGANIZATION_STORED_INFO_TYPE_PATH_TEMPLATE
124
-
125
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
126
- "projects/{project}"
127
- )
128
-
129
- private_constant :PROJECT_PATH_TEMPLATE
130
-
131
- PROJECT_DEIDENTIFY_TEMPLATE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
132
- "projects/{project}/deidentifyTemplates/{deidentify_template}"
133
- )
134
-
135
- private_constant :PROJECT_DEIDENTIFY_TEMPLATE_PATH_TEMPLATE
136
-
137
- PROJECT_INSPECT_TEMPLATE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
138
- "projects/{project}/inspectTemplates/{inspect_template}"
139
- )
140
-
141
- private_constant :PROJECT_INSPECT_TEMPLATE_PATH_TEMPLATE
142
-
143
- PROJECT_JOB_TRIGGER_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
144
- "projects/{project}/jobTriggers/{job_trigger}"
145
- )
146
-
147
- private_constant :PROJECT_JOB_TRIGGER_PATH_TEMPLATE
148
-
149
- PROJECT_STORED_INFO_TYPE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
150
- "projects/{project}/storedInfoTypes/{stored_info_type}"
151
- )
152
-
153
- private_constant :PROJECT_STORED_INFO_TYPE_PATH_TEMPLATE
154
-
155
- # Returns a fully-qualified dlp_job resource name string.
156
- # @param project [String]
157
- # @param dlp_job [String]
158
- # @return [String]
159
- def self.dlp_job_path project, dlp_job
160
- DLP_JOB_PATH_TEMPLATE.render(
161
- :"project" => project,
162
- :"dlp_job" => dlp_job
163
- )
164
- end
165
-
166
- # Returns a fully-qualified organization resource name string.
167
- # @param organization [String]
168
- # @return [String]
169
- def self.organization_path organization
170
- ORGANIZATION_PATH_TEMPLATE.render(
171
- :"organization" => organization
172
- )
173
- end
174
-
175
- # Returns a fully-qualified organization_deidentify_template resource name string.
176
- # @param organization [String]
177
- # @param deidentify_template [String]
178
- # @return [String]
179
- def self.organization_deidentify_template_path organization, deidentify_template
180
- ORGANIZATION_DEIDENTIFY_TEMPLATE_PATH_TEMPLATE.render(
181
- :"organization" => organization,
182
- :"deidentify_template" => deidentify_template
183
- )
184
- end
185
-
186
- # Returns a fully-qualified organization_inspect_template resource name string.
187
- # @param organization [String]
188
- # @param inspect_template [String]
189
- # @return [String]
190
- def self.organization_inspect_template_path organization, inspect_template
191
- ORGANIZATION_INSPECT_TEMPLATE_PATH_TEMPLATE.render(
192
- :"organization" => organization,
193
- :"inspect_template" => inspect_template
194
- )
195
- end
196
-
197
- # Returns a fully-qualified organization_stored_info_type resource name string.
198
- # @param organization [String]
199
- # @param stored_info_type [String]
200
- # @return [String]
201
- def self.organization_stored_info_type_path organization, stored_info_type
202
- ORGANIZATION_STORED_INFO_TYPE_PATH_TEMPLATE.render(
203
- :"organization" => organization,
204
- :"stored_info_type" => stored_info_type
205
- )
206
- end
207
-
208
- # Returns a fully-qualified project resource name string.
209
- # @param project [String]
210
- # @return [String]
211
- def self.project_path project
212
- PROJECT_PATH_TEMPLATE.render(
213
- :"project" => project
214
- )
215
- end
216
-
217
- # Returns a fully-qualified project_deidentify_template resource name string.
218
- # @param project [String]
219
- # @param deidentify_template [String]
220
- # @return [String]
221
- def self.project_deidentify_template_path project, deidentify_template
222
- PROJECT_DEIDENTIFY_TEMPLATE_PATH_TEMPLATE.render(
223
- :"project" => project,
224
- :"deidentify_template" => deidentify_template
225
- )
226
- end
227
-
228
- # Returns a fully-qualified project_inspect_template resource name string.
229
- # @param project [String]
230
- # @param inspect_template [String]
231
- # @return [String]
232
- def self.project_inspect_template_path project, inspect_template
233
- PROJECT_INSPECT_TEMPLATE_PATH_TEMPLATE.render(
234
- :"project" => project,
235
- :"inspect_template" => inspect_template
236
- )
237
- end
238
-
239
- # Returns a fully-qualified project_job_trigger resource name string.
240
- # @param project [String]
241
- # @param job_trigger [String]
242
- # @return [String]
243
- def self.project_job_trigger_path project, job_trigger
244
- PROJECT_JOB_TRIGGER_PATH_TEMPLATE.render(
245
- :"project" => project,
246
- :"job_trigger" => job_trigger
247
- )
248
- end
249
-
250
- # Returns a fully-qualified project_stored_info_type resource name string.
251
- # @param project [String]
252
- # @param stored_info_type [String]
253
- # @return [String]
254
- def self.project_stored_info_type_path project, stored_info_type
255
- PROJECT_STORED_INFO_TYPE_PATH_TEMPLATE.render(
256
- :"project" => project,
257
- :"stored_info_type" => stored_info_type
258
- )
259
- end
260
-
261
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
262
- # Provides the means for authenticating requests made by the client. This parameter can
263
- # be many types.
264
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
265
- # authenticating requests made by this client.
266
- # A `String` will be treated as the path to the keyfile to be used for the construction of
267
- # credentials for this client.
268
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
269
- # credentials for this client.
270
- # A `GRPC::Core::Channel` will be used to make calls through.
271
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
272
- # should already be composed with a `GRPC::Core::CallCredentials` object.
273
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
274
- # metadata for requests, generally, to give OAuth credentials.
275
- # @param scopes [Array<String>]
276
- # The OAuth scopes for this service. This parameter is ignored if
277
- # an updater_proc is supplied.
278
- # @param client_config [Hash]
279
- # A Hash for call options for each method. See
280
- # Google::Gax#construct_settings for the structure of
281
- # this data. Falls back to the default config if not specified
282
- # or the specified config is missing data points.
283
- # @param timeout [Numeric]
284
- # The default timeout, in seconds, for calls made through this client.
285
- # @param metadata [Hash]
286
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
287
- # @param service_address [String]
288
- # Override for the service hostname, or `nil` to leave as the default.
289
- # @param service_port [Integer]
290
- # Override for the service port, or `nil` to leave as the default.
291
- # @param exception_transformer [Proc]
292
- # An optional proc that intercepts any exceptions raised during an API call to inject
293
- # custom error handling.
294
- def initialize \
295
- credentials: nil,
296
- scopes: ALL_SCOPES,
297
- client_config: {},
298
- timeout: DEFAULT_TIMEOUT,
299
- metadata: nil,
300
- service_address: nil,
301
- service_port: nil,
302
- exception_transformer: nil,
303
- lib_name: nil,
304
- lib_version: ""
305
- # These require statements are intentionally placed here to initialize
306
- # the gRPC module only when it's required.
307
- # See https://github.com/googleapis/toolkit/issues/446
308
- require "google/gax/grpc"
309
- require "google/privacy/dlp/v2/dlp_services_pb"
310
-
311
- credentials ||= Google::Cloud::Dlp::V2::Credentials.default
312
-
313
- if credentials.is_a?(String) || credentials.is_a?(Hash)
314
- updater_proc = Google::Cloud::Dlp::V2::Credentials.new(credentials).updater_proc
315
- end
316
- if credentials.is_a?(GRPC::Core::Channel)
317
- channel = credentials
318
- end
319
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
320
- chan_creds = credentials
321
- end
322
- if credentials.is_a?(Proc)
323
- updater_proc = credentials
324
- end
325
- if credentials.is_a?(Google::Auth::Credentials)
326
- updater_proc = credentials.updater_proc
327
- end
328
-
329
- package_version = Google::Cloud::Dlp::VERSION
330
-
331
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
332
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
333
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
334
- google_api_client << " grpc/#{GRPC::VERSION}"
335
- google_api_client.freeze
336
-
337
- headers = { :"x-goog-api-client" => google_api_client }
338
- if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
339
- headers[:"x-goog-user-project"] = credentials.quota_project_id
340
- end
341
- headers.merge!(metadata) unless metadata.nil?
342
- client_config_file = Pathname.new(__dir__).join(
343
- "dlp_service_client_config.json"
344
- )
345
- defaults = client_config_file.open do |f|
346
- Google::Gax.construct_settings(
347
- "google.privacy.dlp.v2.DlpService",
348
- JSON.parse(f.read),
349
- client_config,
350
- Google::Gax::Grpc::STATUS_CODE_NAMES,
351
- timeout,
352
- page_descriptors: PAGE_DESCRIPTORS,
353
- errors: Google::Gax::Grpc::API_ERRORS,
354
- metadata: headers
355
- )
356
- end
357
-
358
- # Allow overriding the service path/port in subclasses.
359
- service_path = service_address || self.class::SERVICE_ADDRESS
360
- port = service_port || self.class::DEFAULT_SERVICE_PORT
361
- interceptors = self.class::GRPC_INTERCEPTORS
362
- @dlp_service_stub = Google::Gax::Grpc.create_stub(
363
- service_path,
364
- port,
365
- chan_creds: chan_creds,
366
- channel: channel,
367
- updater_proc: updater_proc,
368
- scopes: scopes,
369
- interceptors: interceptors,
370
- &Google::Privacy::Dlp::V2::DlpService::Stub.method(:new)
371
- )
372
-
373
- @inspect_content = Google::Gax.create_api_call(
374
- @dlp_service_stub.method(:inspect_content),
375
- defaults["inspect_content"],
376
- exception_transformer: exception_transformer,
377
- params_extractor: proc do |request|
378
- {'parent' => request.parent}
379
- end
380
- )
381
- @redact_image = Google::Gax.create_api_call(
382
- @dlp_service_stub.method(:redact_image),
383
- defaults["redact_image"],
384
- exception_transformer: exception_transformer,
385
- params_extractor: proc do |request|
386
- {'parent' => request.parent}
387
- end
388
- )
389
- @deidentify_content = Google::Gax.create_api_call(
390
- @dlp_service_stub.method(:deidentify_content),
391
- defaults["deidentify_content"],
392
- exception_transformer: exception_transformer,
393
- params_extractor: proc do |request|
394
- {'parent' => request.parent}
395
- end
396
- )
397
- @reidentify_content = Google::Gax.create_api_call(
398
- @dlp_service_stub.method(:reidentify_content),
399
- defaults["reidentify_content"],
400
- exception_transformer: exception_transformer,
401
- params_extractor: proc do |request|
402
- {'parent' => request.parent}
403
- end
404
- )
405
- @list_info_types = Google::Gax.create_api_call(
406
- @dlp_service_stub.method(:list_info_types),
407
- defaults["list_info_types"],
408
- exception_transformer: exception_transformer,
409
- params_extractor: proc do |request|
410
- {'location_id' => request.location_id}
411
- end
412
- )
413
- @create_inspect_template = Google::Gax.create_api_call(
414
- @dlp_service_stub.method(:create_inspect_template),
415
- defaults["create_inspect_template"],
416
- exception_transformer: exception_transformer,
417
- params_extractor: proc do |request|
418
- {'parent' => request.parent}
419
- end
420
- )
421
- @update_inspect_template = Google::Gax.create_api_call(
422
- @dlp_service_stub.method(:update_inspect_template),
423
- defaults["update_inspect_template"],
424
- exception_transformer: exception_transformer,
425
- params_extractor: proc do |request|
426
- {'name' => request.name}
427
- end
428
- )
429
- @get_inspect_template = Google::Gax.create_api_call(
430
- @dlp_service_stub.method(:get_inspect_template),
431
- defaults["get_inspect_template"],
432
- exception_transformer: exception_transformer,
433
- params_extractor: proc do |request|
434
- {'name' => request.name}
435
- end
436
- )
437
- @list_inspect_templates = Google::Gax.create_api_call(
438
- @dlp_service_stub.method(:list_inspect_templates),
439
- defaults["list_inspect_templates"],
440
- exception_transformer: exception_transformer,
441
- params_extractor: proc do |request|
442
- {'parent' => request.parent}
443
- end
444
- )
445
- @delete_inspect_template = Google::Gax.create_api_call(
446
- @dlp_service_stub.method(:delete_inspect_template),
447
- defaults["delete_inspect_template"],
448
- exception_transformer: exception_transformer,
449
- params_extractor: proc do |request|
450
- {'name' => request.name}
451
- end
452
- )
453
- @create_deidentify_template = Google::Gax.create_api_call(
454
- @dlp_service_stub.method(:create_deidentify_template),
455
- defaults["create_deidentify_template"],
456
- exception_transformer: exception_transformer,
457
- params_extractor: proc do |request|
458
- {'parent' => request.parent}
459
- end
460
- )
461
- @update_deidentify_template = Google::Gax.create_api_call(
462
- @dlp_service_stub.method(:update_deidentify_template),
463
- defaults["update_deidentify_template"],
464
- exception_transformer: exception_transformer,
465
- params_extractor: proc do |request|
466
- {'name' => request.name}
467
- end
468
- )
469
- @get_deidentify_template = Google::Gax.create_api_call(
470
- @dlp_service_stub.method(:get_deidentify_template),
471
- defaults["get_deidentify_template"],
472
- exception_transformer: exception_transformer,
473
- params_extractor: proc do |request|
474
- {'name' => request.name}
475
- end
476
- )
477
- @list_deidentify_templates = Google::Gax.create_api_call(
478
- @dlp_service_stub.method(:list_deidentify_templates),
479
- defaults["list_deidentify_templates"],
480
- exception_transformer: exception_transformer,
481
- params_extractor: proc do |request|
482
- {'parent' => request.parent}
483
- end
484
- )
485
- @delete_deidentify_template = Google::Gax.create_api_call(
486
- @dlp_service_stub.method(:delete_deidentify_template),
487
- defaults["delete_deidentify_template"],
488
- exception_transformer: exception_transformer,
489
- params_extractor: proc do |request|
490
- {'name' => request.name}
491
- end
492
- )
493
- @create_dlp_job = Google::Gax.create_api_call(
494
- @dlp_service_stub.method(:create_dlp_job),
495
- defaults["create_dlp_job"],
496
- exception_transformer: exception_transformer,
497
- params_extractor: proc do |request|
498
- {'parent' => request.parent}
499
- end
500
- )
501
- @list_dlp_jobs = Google::Gax.create_api_call(
502
- @dlp_service_stub.method(:list_dlp_jobs),
503
- defaults["list_dlp_jobs"],
504
- exception_transformer: exception_transformer,
505
- params_extractor: proc do |request|
506
- {'parent' => request.parent}
507
- end
508
- )
509
- @get_dlp_job = Google::Gax.create_api_call(
510
- @dlp_service_stub.method(:get_dlp_job),
511
- defaults["get_dlp_job"],
512
- exception_transformer: exception_transformer,
513
- params_extractor: proc do |request|
514
- {'name' => request.name}
515
- end
516
- )
517
- @delete_dlp_job = Google::Gax.create_api_call(
518
- @dlp_service_stub.method(:delete_dlp_job),
519
- defaults["delete_dlp_job"],
520
- exception_transformer: exception_transformer,
521
- params_extractor: proc do |request|
522
- {'name' => request.name}
523
- end
524
- )
525
- @cancel_dlp_job = Google::Gax.create_api_call(
526
- @dlp_service_stub.method(:cancel_dlp_job),
527
- defaults["cancel_dlp_job"],
528
- exception_transformer: exception_transformer,
529
- params_extractor: proc do |request|
530
- {'name' => request.name}
531
- end
532
- )
533
- @finish_dlp_job = Google::Gax.create_api_call(
534
- @dlp_service_stub.method(:finish_dlp_job),
535
- defaults["finish_dlp_job"],
536
- exception_transformer: exception_transformer,
537
- params_extractor: proc do |request|
538
- {'name' => request.name}
539
- end
540
- )
541
- @hybrid_inspect_dlp_job = Google::Gax.create_api_call(
542
- @dlp_service_stub.method(:hybrid_inspect_dlp_job),
543
- defaults["hybrid_inspect_dlp_job"],
544
- exception_transformer: exception_transformer,
545
- params_extractor: proc do |request|
546
- {'name' => request.name}
547
- end
548
- )
549
- @list_job_triggers = Google::Gax.create_api_call(
550
- @dlp_service_stub.method(:list_job_triggers),
551
- defaults["list_job_triggers"],
552
- exception_transformer: exception_transformer,
553
- params_extractor: proc do |request|
554
- {'parent' => request.parent}
555
- end
556
- )
557
- @get_job_trigger = Google::Gax.create_api_call(
558
- @dlp_service_stub.method(:get_job_trigger),
559
- defaults["get_job_trigger"],
560
- exception_transformer: exception_transformer,
561
- params_extractor: proc do |request|
562
- {'name' => request.name}
563
- end
564
- )
565
- @delete_job_trigger = Google::Gax.create_api_call(
566
- @dlp_service_stub.method(:delete_job_trigger),
567
- defaults["delete_job_trigger"],
568
- exception_transformer: exception_transformer,
569
- params_extractor: proc do |request|
570
- {'name' => request.name}
571
- end
572
- )
573
- @hybrid_inspect_job_trigger = Google::Gax.create_api_call(
574
- @dlp_service_stub.method(:hybrid_inspect_job_trigger),
575
- defaults["hybrid_inspect_job_trigger"],
576
- exception_transformer: exception_transformer,
577
- params_extractor: proc do |request|
578
- {'name' => request.name}
579
- end
580
- )
581
- @update_job_trigger = Google::Gax.create_api_call(
582
- @dlp_service_stub.method(:update_job_trigger),
583
- defaults["update_job_trigger"],
584
- exception_transformer: exception_transformer,
585
- params_extractor: proc do |request|
586
- {'name' => request.name}
587
- end
588
- )
589
- @create_job_trigger = Google::Gax.create_api_call(
590
- @dlp_service_stub.method(:create_job_trigger),
591
- defaults["create_job_trigger"],
592
- exception_transformer: exception_transformer,
593
- params_extractor: proc do |request|
594
- {'parent' => request.parent}
595
- end
596
- )
597
- @create_stored_info_type = Google::Gax.create_api_call(
598
- @dlp_service_stub.method(:create_stored_info_type),
599
- defaults["create_stored_info_type"],
600
- exception_transformer: exception_transformer,
601
- params_extractor: proc do |request|
602
- {'parent' => request.parent}
603
- end
604
- )
605
- @update_stored_info_type = Google::Gax.create_api_call(
606
- @dlp_service_stub.method(:update_stored_info_type),
607
- defaults["update_stored_info_type"],
608
- exception_transformer: exception_transformer,
609
- params_extractor: proc do |request|
610
- {'name' => request.name}
611
- end
612
- )
613
- @get_stored_info_type = Google::Gax.create_api_call(
614
- @dlp_service_stub.method(:get_stored_info_type),
615
- defaults["get_stored_info_type"],
616
- exception_transformer: exception_transformer,
617
- params_extractor: proc do |request|
618
- {'name' => request.name}
619
- end
620
- )
621
- @list_stored_info_types = Google::Gax.create_api_call(
622
- @dlp_service_stub.method(:list_stored_info_types),
623
- defaults["list_stored_info_types"],
624
- exception_transformer: exception_transformer,
625
- params_extractor: proc do |request|
626
- {'parent' => request.parent}
627
- end
628
- )
629
- @delete_stored_info_type = Google::Gax.create_api_call(
630
- @dlp_service_stub.method(:delete_stored_info_type),
631
- defaults["delete_stored_info_type"],
632
- exception_transformer: exception_transformer,
633
- params_extractor: proc do |request|
634
- {'name' => request.name}
635
- end
636
- )
637
- end
638
-
639
- # Service calls
640
-
641
- # Finds potentially sensitive info in content.
642
- # This method has limits on input size, processing time, and output size.
643
- #
644
- # When no InfoTypes or CustomInfoTypes are specified in this request, the
645
- # system will automatically choose what detectors to run. By default this may
646
- # be all types, but may change over time as detectors are updated.
647
- #
648
- # For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
649
- # and https://cloud.google.com/dlp/docs/inspecting-text,
650
- #
651
- # @param parent [String]
652
- # The parent resource name, for example projects/my-project-id.
653
- # @param inspect_config [Google::Privacy::Dlp::V2::InspectConfig | Hash]
654
- # Configuration for the inspector. What specified here will override
655
- # the template referenced by the inspect_template_name argument.
656
- # A hash of the same form as `Google::Privacy::Dlp::V2::InspectConfig`
657
- # can also be provided.
658
- # @param item [Google::Privacy::Dlp::V2::ContentItem | Hash]
659
- # The item to inspect.
660
- # A hash of the same form as `Google::Privacy::Dlp::V2::ContentItem`
661
- # can also be provided.
662
- # @param inspect_template_name [String]
663
- # Template to use. Any configuration directly specified in
664
- # inspect_config will override those set in the template. Singular fields
665
- # that are set in this request will replace their corresponding fields in the
666
- # template. Repeated fields are appended. Singular sub-messages and groups
667
- # are recursively merged.
668
- # @param location_id [String]
669
- # The geographic location to process content inspection. Reserved for future
670
- # extensions.
671
- # @param options [Google::Gax::CallOptions]
672
- # Overrides the default settings for this call, e.g, timeout,
673
- # retries, etc.
674
- # @yield [result, operation] Access the result along with the RPC operation
675
- # @yieldparam result [Google::Privacy::Dlp::V2::InspectContentResponse]
676
- # @yieldparam operation [GRPC::ActiveCall::Operation]
677
- # @return [Google::Privacy::Dlp::V2::InspectContentResponse]
678
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
679
- # @example
680
- # require "google/cloud/dlp"
681
- #
682
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
683
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
684
- # response = dlp_client.inspect_content(formatted_parent)
685
-
686
- def inspect_content \
687
- parent,
688
- inspect_config: nil,
689
- item: nil,
690
- inspect_template_name: nil,
691
- location_id: nil,
692
- options: nil,
693
- &block
694
- req = {
695
- parent: parent,
696
- inspect_config: inspect_config,
697
- item: item,
698
- inspect_template_name: inspect_template_name,
699
- location_id: location_id
700
- }.delete_if { |_, v| v.nil? }
701
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::InspectContentRequest)
702
- @inspect_content.call(req, options, &block)
703
- end
704
-
705
- # Redacts potentially sensitive info from an image.
706
- # This method has limits on input size, processing time, and output size.
707
- # See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to
708
- # learn more.
709
- #
710
- # When no InfoTypes or CustomInfoTypes are specified in this request, the
711
- # system will automatically choose what detectors to run. By default this may
712
- # be all types, but may change over time as detectors are updated.
713
- #
714
- # @param parent [String]
715
- # The parent resource name, for example projects/my-project-id.
716
- # @param location_id [String]
717
- # The geographic location to process the request. Reserved for future
718
- # extensions.
719
- # @param inspect_config [Google::Privacy::Dlp::V2::InspectConfig | Hash]
720
- # Configuration for the inspector.
721
- # A hash of the same form as `Google::Privacy::Dlp::V2::InspectConfig`
722
- # can also be provided.
723
- # @param image_redaction_configs [Array<Google::Privacy::Dlp::V2::RedactImageRequest::ImageRedactionConfig | Hash>]
724
- # The configuration for specifying what content to redact from images.
725
- # A hash of the same form as `Google::Privacy::Dlp::V2::RedactImageRequest::ImageRedactionConfig`
726
- # can also be provided.
727
- # @param include_findings [true, false]
728
- # Whether the response should include findings along with the redacted
729
- # image.
730
- # @param byte_item [Google::Privacy::Dlp::V2::ByteContentItem | Hash]
731
- # The content must be PNG, JPEG, SVG or BMP.
732
- # A hash of the same form as `Google::Privacy::Dlp::V2::ByteContentItem`
733
- # can also be provided.
734
- # @param options [Google::Gax::CallOptions]
735
- # Overrides the default settings for this call, e.g, timeout,
736
- # retries, etc.
737
- # @yield [result, operation] Access the result along with the RPC operation
738
- # @yieldparam result [Google::Privacy::Dlp::V2::RedactImageResponse]
739
- # @yieldparam operation [GRPC::ActiveCall::Operation]
740
- # @return [Google::Privacy::Dlp::V2::RedactImageResponse]
741
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
742
- # @example
743
- # require "google/cloud/dlp"
744
- #
745
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
746
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
747
- # response = dlp_client.redact_image(formatted_parent)
748
-
749
- def redact_image \
750
- parent,
751
- location_id: nil,
752
- inspect_config: nil,
753
- image_redaction_configs: nil,
754
- include_findings: nil,
755
- byte_item: nil,
756
- options: nil,
757
- &block
758
- req = {
759
- parent: parent,
760
- location_id: location_id,
761
- inspect_config: inspect_config,
762
- image_redaction_configs: image_redaction_configs,
763
- include_findings: include_findings,
764
- byte_item: byte_item
765
- }.delete_if { |_, v| v.nil? }
766
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::RedactImageRequest)
767
- @redact_image.call(req, options, &block)
768
- end
769
-
770
- # De-identifies potentially sensitive info from a ContentItem.
771
- # This method has limits on input size and output size.
772
- # See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to
773
- # learn more.
774
- #
775
- # When no InfoTypes or CustomInfoTypes are specified in this request, the
776
- # system will automatically choose what detectors to run. By default this may
777
- # be all types, but may change over time as detectors are updated.
778
- #
779
- # @param parent [String]
780
- # The parent resource name, for example projects/my-project-id.
781
- # @param deidentify_config [Google::Privacy::Dlp::V2::DeidentifyConfig | Hash]
782
- # Configuration for the de-identification of the content item.
783
- # Items specified here will override the template referenced by the
784
- # deidentify_template_name argument.
785
- # A hash of the same form as `Google::Privacy::Dlp::V2::DeidentifyConfig`
786
- # can also be provided.
787
- # @param inspect_config [Google::Privacy::Dlp::V2::InspectConfig | Hash]
788
- # Configuration for the inspector.
789
- # Items specified here will override the template referenced by the
790
- # inspect_template_name argument.
791
- # A hash of the same form as `Google::Privacy::Dlp::V2::InspectConfig`
792
- # can also be provided.
793
- # @param item [Google::Privacy::Dlp::V2::ContentItem | Hash]
794
- # The item to de-identify. Will be treated as text.
795
- # A hash of the same form as `Google::Privacy::Dlp::V2::ContentItem`
796
- # can also be provided.
797
- # @param inspect_template_name [String]
798
- # Template to use. Any configuration directly specified in
799
- # inspect_config will override those set in the template. Singular fields
800
- # that are set in this request will replace their corresponding fields in the
801
- # template. Repeated fields are appended. Singular sub-messages and groups
802
- # are recursively merged.
803
- # @param deidentify_template_name [String]
804
- # Template to use. Any configuration directly specified in
805
- # deidentify_config will override those set in the template. Singular fields
806
- # that are set in this request will replace their corresponding fields in the
807
- # template. Repeated fields are appended. Singular sub-messages and groups
808
- # are recursively merged.
809
- # @param location_id [String]
810
- # The geographic location to process de-identification. Reserved for future
811
- # extensions.
812
- # @param options [Google::Gax::CallOptions]
813
- # Overrides the default settings for this call, e.g, timeout,
814
- # retries, etc.
815
- # @yield [result, operation] Access the result along with the RPC operation
816
- # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyContentResponse]
817
- # @yieldparam operation [GRPC::ActiveCall::Operation]
818
- # @return [Google::Privacy::Dlp::V2::DeidentifyContentResponse]
819
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
820
- # @example
821
- # require "google/cloud/dlp"
822
- #
823
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
824
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
825
- # response = dlp_client.deidentify_content(formatted_parent)
826
-
827
- def deidentify_content \
828
- parent,
829
- deidentify_config: nil,
830
- inspect_config: nil,
831
- item: nil,
832
- inspect_template_name: nil,
833
- deidentify_template_name: nil,
834
- location_id: nil,
835
- options: nil,
836
- &block
837
- req = {
838
- parent: parent,
839
- deidentify_config: deidentify_config,
840
- inspect_config: inspect_config,
841
- item: item,
842
- inspect_template_name: inspect_template_name,
843
- deidentify_template_name: deidentify_template_name,
844
- location_id: location_id
845
- }.delete_if { |_, v| v.nil? }
846
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeidentifyContentRequest)
847
- @deidentify_content.call(req, options, &block)
848
- end
849
-
850
- # Re-identifies content that has been de-identified.
851
- # See
852
- # https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
853
- # to learn more.
854
- #
855
- # @param parent [String]
856
- # Required. The parent resource name.
857
- # @param reidentify_config [Google::Privacy::Dlp::V2::DeidentifyConfig | Hash]
858
- # Configuration for the re-identification of the content item.
859
- # This field shares the same proto message type that is used for
860
- # de-identification, however its usage here is for the reversal of the
861
- # previous de-identification. Re-identification is performed by examining
862
- # the transformations used to de-identify the items and executing the
863
- # reverse. This requires that only reversible transformations
864
- # be provided here. The reversible transformations are:
865
- #
866
- # * `CryptoDeterministicConfig`
867
- # * `CryptoReplaceFfxFpeConfig`
868
- # A hash of the same form as `Google::Privacy::Dlp::V2::DeidentifyConfig`
869
- # can also be provided.
870
- # @param inspect_config [Google::Privacy::Dlp::V2::InspectConfig | Hash]
871
- # Configuration for the inspector.
872
- # A hash of the same form as `Google::Privacy::Dlp::V2::InspectConfig`
873
- # can also be provided.
874
- # @param item [Google::Privacy::Dlp::V2::ContentItem | Hash]
875
- # The item to re-identify. Will be treated as text.
876
- # A hash of the same form as `Google::Privacy::Dlp::V2::ContentItem`
877
- # can also be provided.
878
- # @param inspect_template_name [String]
879
- # Template to use. Any configuration directly specified in
880
- # `inspect_config` will override those set in the template. Singular fields
881
- # that are set in this request will replace their corresponding fields in the
882
- # template. Repeated fields are appended. Singular sub-messages and groups
883
- # are recursively merged.
884
- # @param reidentify_template_name [String]
885
- # Template to use. References an instance of `DeidentifyTemplate`.
886
- # Any configuration directly specified in `reidentify_config` or
887
- # `inspect_config` will override those set in the template. Singular fields
888
- # that are set in this request will replace their corresponding fields in the
889
- # template. Repeated fields are appended. Singular sub-messages and groups
890
- # are recursively merged.
891
- # @param location_id [String]
892
- # The geographic location to process content reidentification. Reserved for
893
- # future extensions.
894
- # @param options [Google::Gax::CallOptions]
895
- # Overrides the default settings for this call, e.g, timeout,
896
- # retries, etc.
897
- # @yield [result, operation] Access the result along with the RPC operation
898
- # @yieldparam result [Google::Privacy::Dlp::V2::ReidentifyContentResponse]
899
- # @yieldparam operation [GRPC::ActiveCall::Operation]
900
- # @return [Google::Privacy::Dlp::V2::ReidentifyContentResponse]
901
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
902
- # @example
903
- # require "google/cloud/dlp"
904
- #
905
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
906
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
907
- # response = dlp_client.reidentify_content(formatted_parent)
908
-
909
- def reidentify_content \
910
- parent,
911
- reidentify_config: nil,
912
- inspect_config: nil,
913
- item: nil,
914
- inspect_template_name: nil,
915
- reidentify_template_name: nil,
916
- location_id: nil,
917
- options: nil,
918
- &block
919
- req = {
920
- parent: parent,
921
- reidentify_config: reidentify_config,
922
- inspect_config: inspect_config,
923
- item: item,
924
- inspect_template_name: inspect_template_name,
925
- reidentify_template_name: reidentify_template_name,
926
- location_id: location_id
927
- }.delete_if { |_, v| v.nil? }
928
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ReidentifyContentRequest)
929
- @reidentify_content.call(req, options, &block)
930
- end
931
-
932
- # Returns a list of the sensitive information types that the DLP API
933
- # supports. See https://cloud.google.com/dlp/docs/infotypes-reference to
934
- # learn more.
935
- #
936
- # @param language_code [String]
937
- # BCP-47 language code for localized infoType friendly
938
- # names. If omitted, or if localized strings are not available,
939
- # en-US strings will be returned.
940
- # @param filter [String]
941
- # filter to only return infoTypes supported by certain parts of the
942
- # API. Defaults to supported_by=INSPECT.
943
- # @param location_id [String]
944
- # The geographic location to list info types. Reserved for future
945
- # extensions.
946
- # @param options [Google::Gax::CallOptions]
947
- # Overrides the default settings for this call, e.g, timeout,
948
- # retries, etc.
949
- # @yield [result, operation] Access the result along with the RPC operation
950
- # @yieldparam result [Google::Privacy::Dlp::V2::ListInfoTypesResponse]
951
- # @yieldparam operation [GRPC::ActiveCall::Operation]
952
- # @return [Google::Privacy::Dlp::V2::ListInfoTypesResponse]
953
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
954
- # @example
955
- # require "google/cloud/dlp"
956
- #
957
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
958
- # response = dlp_client.list_info_types
959
-
960
- def list_info_types \
961
- language_code: nil,
962
- filter: nil,
963
- location_id: nil,
964
- options: nil,
965
- &block
966
- req = {
967
- language_code: language_code,
968
- filter: filter,
969
- location_id: location_id
970
- }.delete_if { |_, v| v.nil? }
971
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListInfoTypesRequest)
972
- @list_info_types.call(req, options, &block)
973
- end
974
-
975
- # Creates an InspectTemplate for re-using frequently used configuration
976
- # for inspecting content, images, and storage.
977
- # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
978
- #
979
- # @param parent [String]
980
- # Required. The parent resource name, for example projects/my-project-id or
981
- # organizations/my-org-id.
982
- # @param inspect_template [Google::Privacy::Dlp::V2::InspectTemplate | Hash]
983
- # Required. The InspectTemplate to create.
984
- # A hash of the same form as `Google::Privacy::Dlp::V2::InspectTemplate`
985
- # can also be provided.
986
- # @param template_id [String]
987
- # The template id can contain uppercase and lowercase letters,
988
- # numbers, and hyphens; that is, it must match the regular
989
- # expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
990
- # characters. Can be empty to allow the system to generate one.
991
- # @param location_id [String]
992
- # The geographic location to store the inspection template. Reserved for
993
- # future extensions.
994
- # @param options [Google::Gax::CallOptions]
995
- # Overrides the default settings for this call, e.g, timeout,
996
- # retries, etc.
997
- # @yield [result, operation] Access the result along with the RPC operation
998
- # @yieldparam result [Google::Privacy::Dlp::V2::InspectTemplate]
999
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1000
- # @return [Google::Privacy::Dlp::V2::InspectTemplate]
1001
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1002
- # @example
1003
- # require "google/cloud/dlp"
1004
- #
1005
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1006
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
1007
- # response = dlp_client.create_inspect_template(formatted_parent)
1008
-
1009
- def create_inspect_template \
1010
- parent,
1011
- inspect_template: nil,
1012
- template_id: nil,
1013
- location_id: nil,
1014
- options: nil,
1015
- &block
1016
- req = {
1017
- parent: parent,
1018
- inspect_template: inspect_template,
1019
- template_id: template_id,
1020
- location_id: location_id
1021
- }.delete_if { |_, v| v.nil? }
1022
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateInspectTemplateRequest)
1023
- @create_inspect_template.call(req, options, &block)
1024
- end
1025
-
1026
- # Updates the InspectTemplate.
1027
- # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
1028
- #
1029
- # @param name [String]
1030
- # Required. Resource name of organization and inspectTemplate to be updated,
1031
- # for example `organizations/433245324/inspectTemplates/432452342` or
1032
- # projects/project-id/inspectTemplates/432452342.
1033
- # @param inspect_template [Google::Privacy::Dlp::V2::InspectTemplate | Hash]
1034
- # New InspectTemplate value.
1035
- # A hash of the same form as `Google::Privacy::Dlp::V2::InspectTemplate`
1036
- # can also be provided.
1037
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
1038
- # Mask to control which fields get updated.
1039
- # A hash of the same form as `Google::Protobuf::FieldMask`
1040
- # can also be provided.
1041
- # @param options [Google::Gax::CallOptions]
1042
- # Overrides the default settings for this call, e.g, timeout,
1043
- # retries, etc.
1044
- # @yield [result, operation] Access the result along with the RPC operation
1045
- # @yieldparam result [Google::Privacy::Dlp::V2::InspectTemplate]
1046
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1047
- # @return [Google::Privacy::Dlp::V2::InspectTemplate]
1048
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1049
- # @example
1050
- # require "google/cloud/dlp"
1051
- #
1052
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1053
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_inspect_template_path("[ORGANIZATION]", "[INSPECT_TEMPLATE]")
1054
- # response = dlp_client.update_inspect_template(formatted_name)
1055
-
1056
- def update_inspect_template \
1057
- name,
1058
- inspect_template: nil,
1059
- update_mask: nil,
1060
- options: nil,
1061
- &block
1062
- req = {
1063
- name: name,
1064
- inspect_template: inspect_template,
1065
- update_mask: update_mask
1066
- }.delete_if { |_, v| v.nil? }
1067
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::UpdateInspectTemplateRequest)
1068
- @update_inspect_template.call(req, options, &block)
1069
- end
1070
-
1071
- # Gets an InspectTemplate.
1072
- # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
1073
- #
1074
- # @param name [String]
1075
- # Required. Resource name of the organization and inspectTemplate to be read,
1076
- # for example `organizations/433245324/inspectTemplates/432452342` or
1077
- # projects/project-id/inspectTemplates/432452342.
1078
- # @param options [Google::Gax::CallOptions]
1079
- # Overrides the default settings for this call, e.g, timeout,
1080
- # retries, etc.
1081
- # @yield [result, operation] Access the result along with the RPC operation
1082
- # @yieldparam result [Google::Privacy::Dlp::V2::InspectTemplate]
1083
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1084
- # @return [Google::Privacy::Dlp::V2::InspectTemplate]
1085
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1086
- # @example
1087
- # require "google/cloud/dlp"
1088
- #
1089
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1090
- # response = dlp_client.get_inspect_template
1091
-
1092
- def get_inspect_template \
1093
- name: nil,
1094
- options: nil,
1095
- &block
1096
- req = {
1097
- name: name
1098
- }.delete_if { |_, v| v.nil? }
1099
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetInspectTemplateRequest)
1100
- @get_inspect_template.call(req, options, &block)
1101
- end
1102
-
1103
- # Lists InspectTemplates.
1104
- # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
1105
- #
1106
- # @param parent [String]
1107
- # Required. The parent resource name, for example projects/my-project-id or
1108
- # organizations/my-org-id.
1109
- # @param page_size [Integer]
1110
- # The maximum number of resources contained in the underlying API
1111
- # response. If page streaming is performed per-resource, this
1112
- # parameter does not affect the return value. If page streaming is
1113
- # performed per-page, this determines the maximum number of
1114
- # resources in a page.
1115
- # @param order_by [String]
1116
- # Comma separated list of fields to order by,
1117
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1118
- # default sorting order is ascending, redundant space characters are
1119
- # insignificant.
1120
- #
1121
- # Example: `name asc,update_time, create_time desc`
1122
- #
1123
- # Supported fields are:
1124
- #
1125
- # * `create_time`: corresponds to time the template was created.
1126
- # * `update_time`: corresponds to time the template was last updated.
1127
- # * `name`: corresponds to template's name.
1128
- # * `display_name`: corresponds to template's display name.
1129
- # @param location_id [String]
1130
- # The geographic location where inspection templates will be retrieved from.
1131
- # Use `-` for all locations. Reserved for future extensions.
1132
- # @param options [Google::Gax::CallOptions]
1133
- # Overrides the default settings for this call, e.g, timeout,
1134
- # retries, etc.
1135
- # @yield [result, operation] Access the result along with the RPC operation
1136
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::InspectTemplate>]
1137
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1138
- # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::InspectTemplate>]
1139
- # An enumerable of Google::Privacy::Dlp::V2::InspectTemplate instances.
1140
- # See Google::Gax::PagedEnumerable documentation for other
1141
- # operations such as per-page iteration or access to the response
1142
- # object.
1143
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1144
- # @example
1145
- # require "google/cloud/dlp"
1146
- #
1147
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1148
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
1149
- #
1150
- # # Iterate over all results.
1151
- # dlp_client.list_inspect_templates(formatted_parent).each do |element|
1152
- # # Process element.
1153
- # end
1154
- #
1155
- # # Or iterate over results one page at a time.
1156
- # dlp_client.list_inspect_templates(formatted_parent).each_page do |page|
1157
- # # Process each page at a time.
1158
- # page.each do |element|
1159
- # # Process element.
1160
- # end
1161
- # end
1162
-
1163
- def list_inspect_templates \
1164
- parent,
1165
- page_size: nil,
1166
- order_by: nil,
1167
- location_id: nil,
1168
- options: nil,
1169
- &block
1170
- req = {
1171
- parent: parent,
1172
- page_size: page_size,
1173
- order_by: order_by,
1174
- location_id: location_id
1175
- }.delete_if { |_, v| v.nil? }
1176
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListInspectTemplatesRequest)
1177
- @list_inspect_templates.call(req, options, &block)
1178
- end
1179
-
1180
- # Deletes an InspectTemplate.
1181
- # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
1182
- #
1183
- # @param name [String]
1184
- # Required. Resource name of the organization and inspectTemplate to be
1185
- # deleted, for example `organizations/433245324/inspectTemplates/432452342`
1186
- # or projects/project-id/inspectTemplates/432452342.
1187
- # @param options [Google::Gax::CallOptions]
1188
- # Overrides the default settings for this call, e.g, timeout,
1189
- # retries, etc.
1190
- # @yield [result, operation] Access the result along with the RPC operation
1191
- # @yieldparam result []
1192
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1193
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1194
- # @example
1195
- # require "google/cloud/dlp"
1196
- #
1197
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1198
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_inspect_template_path("[ORGANIZATION]", "[INSPECT_TEMPLATE]")
1199
- # dlp_client.delete_inspect_template(formatted_name)
1200
-
1201
- def delete_inspect_template \
1202
- name,
1203
- options: nil,
1204
- &block
1205
- req = {
1206
- name: name
1207
- }.delete_if { |_, v| v.nil? }
1208
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteInspectTemplateRequest)
1209
- @delete_inspect_template.call(req, options, &block)
1210
- nil
1211
- end
1212
-
1213
- # Creates a DeidentifyTemplate for re-using frequently used configuration
1214
- # for de-identifying content, images, and storage.
1215
- # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1216
- # more.
1217
- #
1218
- # @param parent [String]
1219
- # Required. The parent resource name, for example projects/my-project-id or
1220
- # organizations/my-org-id.
1221
- # @param deidentify_template [Google::Privacy::Dlp::V2::DeidentifyTemplate | Hash]
1222
- # Required. The DeidentifyTemplate to create.
1223
- # A hash of the same form as `Google::Privacy::Dlp::V2::DeidentifyTemplate`
1224
- # can also be provided.
1225
- # @param template_id [String]
1226
- # The template id can contain uppercase and lowercase letters,
1227
- # numbers, and hyphens; that is, it must match the regular
1228
- # expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
1229
- # characters. Can be empty to allow the system to generate one.
1230
- # @param location_id [String]
1231
- # The geographic location to store the deidentification template. Reserved
1232
- # for future extensions.
1233
- # @param options [Google::Gax::CallOptions]
1234
- # Overrides the default settings for this call, e.g, timeout,
1235
- # retries, etc.
1236
- # @yield [result, operation] Access the result along with the RPC operation
1237
- # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1238
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1239
- # @return [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1240
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1241
- # @example
1242
- # require "google/cloud/dlp"
1243
- #
1244
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1245
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
1246
- # response = dlp_client.create_deidentify_template(formatted_parent)
1247
-
1248
- def create_deidentify_template \
1249
- parent,
1250
- deidentify_template: nil,
1251
- template_id: nil,
1252
- location_id: nil,
1253
- options: nil,
1254
- &block
1255
- req = {
1256
- parent: parent,
1257
- deidentify_template: deidentify_template,
1258
- template_id: template_id,
1259
- location_id: location_id
1260
- }.delete_if { |_, v| v.nil? }
1261
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateDeidentifyTemplateRequest)
1262
- @create_deidentify_template.call(req, options, &block)
1263
- end
1264
-
1265
- # Updates the DeidentifyTemplate.
1266
- # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1267
- # more.
1268
- #
1269
- # @param name [String]
1270
- # Required. Resource name of organization and deidentify template to be
1271
- # updated, for example
1272
- # `organizations/433245324/deidentifyTemplates/432452342` or
1273
- # projects/project-id/deidentifyTemplates/432452342.
1274
- # @param deidentify_template [Google::Privacy::Dlp::V2::DeidentifyTemplate | Hash]
1275
- # New DeidentifyTemplate value.
1276
- # A hash of the same form as `Google::Privacy::Dlp::V2::DeidentifyTemplate`
1277
- # can also be provided.
1278
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
1279
- # Mask to control which fields get updated.
1280
- # A hash of the same form as `Google::Protobuf::FieldMask`
1281
- # can also be provided.
1282
- # @param options [Google::Gax::CallOptions]
1283
- # Overrides the default settings for this call, e.g, timeout,
1284
- # retries, etc.
1285
- # @yield [result, operation] Access the result along with the RPC operation
1286
- # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1287
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1288
- # @return [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1289
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1290
- # @example
1291
- # require "google/cloud/dlp"
1292
- #
1293
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1294
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_deidentify_template_path("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
1295
- # response = dlp_client.update_deidentify_template(formatted_name)
1296
-
1297
- def update_deidentify_template \
1298
- name,
1299
- deidentify_template: nil,
1300
- update_mask: nil,
1301
- options: nil,
1302
- &block
1303
- req = {
1304
- name: name,
1305
- deidentify_template: deidentify_template,
1306
- update_mask: update_mask
1307
- }.delete_if { |_, v| v.nil? }
1308
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::UpdateDeidentifyTemplateRequest)
1309
- @update_deidentify_template.call(req, options, &block)
1310
- end
1311
-
1312
- # Gets a DeidentifyTemplate.
1313
- # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1314
- # more.
1315
- #
1316
- # @param name [String]
1317
- # Required. Resource name of the organization and deidentify template to be
1318
- # read, for example `organizations/433245324/deidentifyTemplates/432452342`
1319
- # or projects/project-id/deidentifyTemplates/432452342.
1320
- # @param options [Google::Gax::CallOptions]
1321
- # Overrides the default settings for this call, e.g, timeout,
1322
- # retries, etc.
1323
- # @yield [result, operation] Access the result along with the RPC operation
1324
- # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1325
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1326
- # @return [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1327
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1328
- # @example
1329
- # require "google/cloud/dlp"
1330
- #
1331
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1332
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_deidentify_template_path("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
1333
- # response = dlp_client.get_deidentify_template(formatted_name)
1334
-
1335
- def get_deidentify_template \
1336
- name,
1337
- options: nil,
1338
- &block
1339
- req = {
1340
- name: name
1341
- }.delete_if { |_, v| v.nil? }
1342
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetDeidentifyTemplateRequest)
1343
- @get_deidentify_template.call(req, options, &block)
1344
- end
1345
-
1346
- # Lists DeidentifyTemplates.
1347
- # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1348
- # more.
1349
- #
1350
- # @param parent [String]
1351
- # Required. The parent resource name, for example projects/my-project-id or
1352
- # organizations/my-org-id.
1353
- # @param page_size [Integer]
1354
- # The maximum number of resources contained in the underlying API
1355
- # response. If page streaming is performed per-resource, this
1356
- # parameter does not affect the return value. If page streaming is
1357
- # performed per-page, this determines the maximum number of
1358
- # resources in a page.
1359
- # @param order_by [String]
1360
- # Comma separated list of fields to order by,
1361
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1362
- # default sorting order is ascending, redundant space characters are
1363
- # insignificant.
1364
- #
1365
- # Example: `name asc,update_time, create_time desc`
1366
- #
1367
- # Supported fields are:
1368
- #
1369
- # * `create_time`: corresponds to time the template was created.
1370
- # * `update_time`: corresponds to time the template was last updated.
1371
- # * `name`: corresponds to template's name.
1372
- # * `display_name`: corresponds to template's display name.
1373
- # @param location_id [String]
1374
- # The geographic location where deidentifications templates will be retrieved
1375
- # from. Use `-` for all locations. Reserved for future extensions.
1376
- # @param options [Google::Gax::CallOptions]
1377
- # Overrides the default settings for this call, e.g, timeout,
1378
- # retries, etc.
1379
- # @yield [result, operation] Access the result along with the RPC operation
1380
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DeidentifyTemplate>]
1381
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1382
- # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DeidentifyTemplate>]
1383
- # An enumerable of Google::Privacy::Dlp::V2::DeidentifyTemplate instances.
1384
- # See Google::Gax::PagedEnumerable documentation for other
1385
- # operations such as per-page iteration or access to the response
1386
- # object.
1387
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1388
- # @example
1389
- # require "google/cloud/dlp"
1390
- #
1391
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1392
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
1393
- #
1394
- # # Iterate over all results.
1395
- # dlp_client.list_deidentify_templates(formatted_parent).each do |element|
1396
- # # Process element.
1397
- # end
1398
- #
1399
- # # Or iterate over results one page at a time.
1400
- # dlp_client.list_deidentify_templates(formatted_parent).each_page do |page|
1401
- # # Process each page at a time.
1402
- # page.each do |element|
1403
- # # Process element.
1404
- # end
1405
- # end
1406
-
1407
- def list_deidentify_templates \
1408
- parent,
1409
- page_size: nil,
1410
- order_by: nil,
1411
- location_id: nil,
1412
- options: nil,
1413
- &block
1414
- req = {
1415
- parent: parent,
1416
- page_size: page_size,
1417
- order_by: order_by,
1418
- location_id: location_id
1419
- }.delete_if { |_, v| v.nil? }
1420
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListDeidentifyTemplatesRequest)
1421
- @list_deidentify_templates.call(req, options, &block)
1422
- end
1423
-
1424
- # Deletes a DeidentifyTemplate.
1425
- # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1426
- # more.
1427
- #
1428
- # @param name [String]
1429
- # Required. Resource name of the organization and deidentify template to be
1430
- # deleted, for example
1431
- # `organizations/433245324/deidentifyTemplates/432452342` or
1432
- # projects/project-id/deidentifyTemplates/432452342.
1433
- # @param options [Google::Gax::CallOptions]
1434
- # Overrides the default settings for this call, e.g, timeout,
1435
- # retries, etc.
1436
- # @yield [result, operation] Access the result along with the RPC operation
1437
- # @yieldparam result []
1438
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1439
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1440
- # @example
1441
- # require "google/cloud/dlp"
1442
- #
1443
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1444
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_deidentify_template_path("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
1445
- # dlp_client.delete_deidentify_template(formatted_name)
1446
-
1447
- def delete_deidentify_template \
1448
- name,
1449
- options: nil,
1450
- &block
1451
- req = {
1452
- name: name
1453
- }.delete_if { |_, v| v.nil? }
1454
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteDeidentifyTemplateRequest)
1455
- @delete_deidentify_template.call(req, options, &block)
1456
- nil
1457
- end
1458
-
1459
- # Creates a new job to inspect storage or calculate risk metrics.
1460
- # See https://cloud.google.com/dlp/docs/inspecting-storage and
1461
- # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1462
- #
1463
- # When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
1464
- # system will automatically choose what detectors to run. By default this may
1465
- # be all types, but may change over time as detectors are updated.
1466
- #
1467
- # @param parent [String]
1468
- # Required. The parent resource name, for example projects/my-project-id.
1469
- # @param inspect_job [Google::Privacy::Dlp::V2::InspectJobConfig | Hash]
1470
- # Set to control what and how to inspect.
1471
- # A hash of the same form as `Google::Privacy::Dlp::V2::InspectJobConfig`
1472
- # can also be provided.
1473
- # @param risk_job [Google::Privacy::Dlp::V2::RiskAnalysisJobConfig | Hash]
1474
- # Set to choose what metric to calculate.
1475
- # A hash of the same form as `Google::Privacy::Dlp::V2::RiskAnalysisJobConfig`
1476
- # can also be provided.
1477
- # @param job_id [String]
1478
- # The job id can contain uppercase and lowercase letters,
1479
- # numbers, and hyphens; that is, it must match the regular
1480
- # expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
1481
- # characters. Can be empty to allow the system to generate one.
1482
- # @param location_id [String]
1483
- # The geographic location to store and process the job. Reserved for
1484
- # future extensions.
1485
- # @param options [Google::Gax::CallOptions]
1486
- # Overrides the default settings for this call, e.g, timeout,
1487
- # retries, etc.
1488
- # @yield [result, operation] Access the result along with the RPC operation
1489
- # @yieldparam result [Google::Privacy::Dlp::V2::DlpJob]
1490
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1491
- # @return [Google::Privacy::Dlp::V2::DlpJob]
1492
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1493
- # @example
1494
- # require "google/cloud/dlp"
1495
- #
1496
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1497
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
1498
- # response = dlp_client.create_dlp_job(formatted_parent)
1499
-
1500
- def create_dlp_job \
1501
- parent,
1502
- inspect_job: nil,
1503
- risk_job: nil,
1504
- job_id: nil,
1505
- location_id: nil,
1506
- options: nil,
1507
- &block
1508
- req = {
1509
- parent: parent,
1510
- inspect_job: inspect_job,
1511
- risk_job: risk_job,
1512
- job_id: job_id,
1513
- location_id: location_id
1514
- }.delete_if { |_, v| v.nil? }
1515
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateDlpJobRequest)
1516
- @create_dlp_job.call(req, options, &block)
1517
- end
1518
-
1519
- # Lists DlpJobs that match the specified filter in the request.
1520
- # See https://cloud.google.com/dlp/docs/inspecting-storage and
1521
- # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1522
- #
1523
- # @param parent [String]
1524
- # Required. The parent resource name, for example projects/my-project-id.
1525
- # @param filter [String]
1526
- # Allows filtering.
1527
- #
1528
- # Supported syntax:
1529
- #
1530
- # * Filter expressions are made up of one or more restrictions.
1531
- # * Restrictions can be combined by `AND` or `OR` logical operators. A
1532
- # sequence of restrictions implicitly uses `AND`.
1533
- # * A restriction has the form of `{field} {operator} {value}`.
1534
- # * Supported fields/values for inspect jobs:
1535
- # * `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED
1536
- # * `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
1537
- # * `trigger_name` - The resource name of the trigger that created job.
1538
- # * 'end_time` - Corresponds to time the job finished.
1539
- # * 'start_time` - Corresponds to time the job finished.
1540
- # * Supported fields for risk analysis jobs:
1541
- # * `state` - RUNNING|CANCELED|FINISHED|FAILED
1542
- # * 'end_time` - Corresponds to time the job finished.
1543
- # * 'start_time` - Corresponds to time the job finished.
1544
- # * The operator must be `=` or `!=`.
1545
- #
1546
- # Examples:
1547
- #
1548
- # * inspected_storage = cloud_storage AND state = done
1549
- # * inspected_storage = cloud_storage OR inspected_storage = bigquery
1550
- # * inspected_storage = cloud_storage AND (state = done OR state = canceled)
1551
- # * end_time > \"2017-12-12T00:00:00+00:00\"
1552
- #
1553
- # The length of this field should be no more than 500 characters.
1554
- # @param page_size [Integer]
1555
- # The maximum number of resources contained in the underlying API
1556
- # response. If page streaming is performed per-resource, this
1557
- # parameter does not affect the return value. If page streaming is
1558
- # performed per-page, this determines the maximum number of
1559
- # resources in a page.
1560
- # @param type [Google::Privacy::Dlp::V2::DlpJobType]
1561
- # The type of job. Defaults to `DlpJobType.INSPECT`
1562
- # @param order_by [String]
1563
- # Comma separated list of fields to order by,
1564
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1565
- # default sorting order is ascending, redundant space characters are
1566
- # insignificant.
1567
- #
1568
- # Example: `name asc, end_time asc, create_time desc`
1569
- #
1570
- # Supported fields are:
1571
- #
1572
- # * `create_time`: corresponds to time the job was created.
1573
- # * `end_time`: corresponds to time the job ended.
1574
- # * `name`: corresponds to job's name.
1575
- # * `state`: corresponds to `state`
1576
- # @param location_id [String]
1577
- # The geographic location where jobs will be retrieved from.
1578
- # Use `-` for all locations. Reserved for future extensions.
1579
- # @param options [Google::Gax::CallOptions]
1580
- # Overrides the default settings for this call, e.g, timeout,
1581
- # retries, etc.
1582
- # @yield [result, operation] Access the result along with the RPC operation
1583
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DlpJob>]
1584
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1585
- # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DlpJob>]
1586
- # An enumerable of Google::Privacy::Dlp::V2::DlpJob instances.
1587
- # See Google::Gax::PagedEnumerable documentation for other
1588
- # operations such as per-page iteration or access to the response
1589
- # object.
1590
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1591
- # @example
1592
- # require "google/cloud/dlp"
1593
- #
1594
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1595
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
1596
- #
1597
- # # Iterate over all results.
1598
- # dlp_client.list_dlp_jobs(formatted_parent).each do |element|
1599
- # # Process element.
1600
- # end
1601
- #
1602
- # # Or iterate over results one page at a time.
1603
- # dlp_client.list_dlp_jobs(formatted_parent).each_page do |page|
1604
- # # Process each page at a time.
1605
- # page.each do |element|
1606
- # # Process element.
1607
- # end
1608
- # end
1609
-
1610
- def list_dlp_jobs \
1611
- parent,
1612
- filter: nil,
1613
- page_size: nil,
1614
- type: nil,
1615
- order_by: nil,
1616
- location_id: nil,
1617
- options: nil,
1618
- &block
1619
- req = {
1620
- parent: parent,
1621
- filter: filter,
1622
- page_size: page_size,
1623
- type: type,
1624
- order_by: order_by,
1625
- location_id: location_id
1626
- }.delete_if { |_, v| v.nil? }
1627
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListDlpJobsRequest)
1628
- @list_dlp_jobs.call(req, options, &block)
1629
- end
1630
-
1631
- # Gets the latest state of a long-running DlpJob.
1632
- # See https://cloud.google.com/dlp/docs/inspecting-storage and
1633
- # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1634
- #
1635
- # @param name [String]
1636
- # Required. The name of the DlpJob resource.
1637
- # @param options [Google::Gax::CallOptions]
1638
- # Overrides the default settings for this call, e.g, timeout,
1639
- # retries, etc.
1640
- # @yield [result, operation] Access the result along with the RPC operation
1641
- # @yieldparam result [Google::Privacy::Dlp::V2::DlpJob]
1642
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1643
- # @return [Google::Privacy::Dlp::V2::DlpJob]
1644
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1645
- # @example
1646
- # require "google/cloud/dlp"
1647
- #
1648
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1649
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.dlp_job_path("[PROJECT]", "[DLP_JOB]")
1650
- # response = dlp_client.get_dlp_job(formatted_name)
1651
-
1652
- def get_dlp_job \
1653
- name,
1654
- options: nil,
1655
- &block
1656
- req = {
1657
- name: name
1658
- }.delete_if { |_, v| v.nil? }
1659
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetDlpJobRequest)
1660
- @get_dlp_job.call(req, options, &block)
1661
- end
1662
-
1663
- # Deletes a long-running DlpJob. This method indicates that the client is
1664
- # no longer interested in the DlpJob result. The job will be cancelled if
1665
- # possible.
1666
- # See https://cloud.google.com/dlp/docs/inspecting-storage and
1667
- # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1668
- #
1669
- # @param name [String]
1670
- # Required. The name of the DlpJob resource to be deleted.
1671
- # @param options [Google::Gax::CallOptions]
1672
- # Overrides the default settings for this call, e.g, timeout,
1673
- # retries, etc.
1674
- # @yield [result, operation] Access the result along with the RPC operation
1675
- # @yieldparam result []
1676
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1677
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1678
- # @example
1679
- # require "google/cloud/dlp"
1680
- #
1681
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1682
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.dlp_job_path("[PROJECT]", "[DLP_JOB]")
1683
- # dlp_client.delete_dlp_job(formatted_name)
1684
-
1685
- def delete_dlp_job \
1686
- name,
1687
- options: nil,
1688
- &block
1689
- req = {
1690
- name: name
1691
- }.delete_if { |_, v| v.nil? }
1692
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteDlpJobRequest)
1693
- @delete_dlp_job.call(req, options, &block)
1694
- nil
1695
- end
1696
-
1697
- # Starts asynchronous cancellation on a long-running DlpJob. The server
1698
- # makes a best effort to cancel the DlpJob, but success is not
1699
- # guaranteed.
1700
- # See https://cloud.google.com/dlp/docs/inspecting-storage and
1701
- # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1702
- #
1703
- # @param name [String]
1704
- # Required. The name of the DlpJob resource to be cancelled.
1705
- # @param options [Google::Gax::CallOptions]
1706
- # Overrides the default settings for this call, e.g, timeout,
1707
- # retries, etc.
1708
- # @yield [result, operation] Access the result along with the RPC operation
1709
- # @yieldparam result []
1710
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1711
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1712
- # @example
1713
- # require "google/cloud/dlp"
1714
- #
1715
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1716
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.dlp_job_path("[PROJECT]", "[DLP_JOB]")
1717
- # dlp_client.cancel_dlp_job(formatted_name)
1718
-
1719
- def cancel_dlp_job \
1720
- name,
1721
- options: nil,
1722
- &block
1723
- req = {
1724
- name: name
1725
- }.delete_if { |_, v| v.nil? }
1726
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CancelDlpJobRequest)
1727
- @cancel_dlp_job.call(req, options, &block)
1728
- nil
1729
- end
1730
-
1731
- # Finish a running hybrid DlpJob. Triggers the finalization steps and running
1732
- # of any enabled actions that have not yet run.
1733
- # Early access feature is in a pre-release state and might change or have
1734
- # limited support. For more information, see
1735
- # https://cloud.google.com/products#product-launch-stages.
1736
- #
1737
- # @param name [String]
1738
- # Required. The name of the DlpJob resource to be cancelled.
1739
- # @param options [Google::Gax::CallOptions]
1740
- # Overrides the default settings for this call, e.g, timeout,
1741
- # retries, etc.
1742
- # @yield [result, operation] Access the result along with the RPC operation
1743
- # @yieldparam result []
1744
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1745
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1746
- # @example
1747
- # require "google/cloud/dlp"
1748
- #
1749
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1750
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.dlp_job_path("[PROJECT]", "[DLP_JOB]")
1751
- # dlp_client.finish_dlp_job(formatted_name)
1752
-
1753
- def finish_dlp_job \
1754
- name,
1755
- options: nil,
1756
- &block
1757
- req = {
1758
- name: name
1759
- }.delete_if { |_, v| v.nil? }
1760
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::FinishDlpJobRequest)
1761
- @finish_dlp_job.call(req, options, &block)
1762
- nil
1763
- end
1764
-
1765
- # Inspect hybrid content and store findings to a job.
1766
- # To review the findings inspect the job. Inspection will occur
1767
- # asynchronously.
1768
- # Early access feature is in a pre-release state and might change or have
1769
- # limited support. For more information, see
1770
- # https://cloud.google.com/products#product-launch-stages.
1771
- #
1772
- # @param name [String]
1773
- # Required. Resource name of the job to execute a hybrid inspect on, for
1774
- # example `projects/dlp-test-project/dlpJob/53234423`.
1775
- # @param hybrid_item [Google::Privacy::Dlp::V2::HybridContentItem | Hash]
1776
- # The item to inspect.
1777
- # A hash of the same form as `Google::Privacy::Dlp::V2::HybridContentItem`
1778
- # can also be provided.
1779
- # @param options [Google::Gax::CallOptions]
1780
- # Overrides the default settings for this call, e.g, timeout,
1781
- # retries, etc.
1782
- # @yield [result, operation] Access the result along with the RPC operation
1783
- # @yieldparam result [Google::Privacy::Dlp::V2::HybridInspectResponse]
1784
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1785
- # @return [Google::Privacy::Dlp::V2::HybridInspectResponse]
1786
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1787
- # @example
1788
- # require "google/cloud/dlp"
1789
- #
1790
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1791
- #
1792
- # # TODO: Initialize `name`:
1793
- # name = ''
1794
- # response = dlp_client.hybrid_inspect_dlp_job(name)
1795
-
1796
- def hybrid_inspect_dlp_job \
1797
- name,
1798
- hybrid_item: nil,
1799
- options: nil,
1800
- &block
1801
- req = {
1802
- name: name,
1803
- hybrid_item: hybrid_item
1804
- }.delete_if { |_, v| v.nil? }
1805
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::HybridInspectDlpJobRequest)
1806
- @hybrid_inspect_dlp_job.call(req, options, &block)
1807
- end
1808
-
1809
- # Lists job triggers.
1810
- # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1811
- #
1812
- # @param parent [String]
1813
- # Required. The parent resource name, for example `projects/my-project-id`.
1814
- # @param page_size [Integer]
1815
- # The maximum number of resources contained in the underlying API
1816
- # response. If page streaming is performed per-resource, this
1817
- # parameter does not affect the return value. If page streaming is
1818
- # performed per-page, this determines the maximum number of
1819
- # resources in a page.
1820
- # @param order_by [String]
1821
- # Comma separated list of triggeredJob fields to order by,
1822
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1823
- # default sorting order is ascending, redundant space characters are
1824
- # insignificant.
1825
- #
1826
- # Example: `name asc,update_time, create_time desc`
1827
- #
1828
- # Supported fields are:
1829
- #
1830
- # * `create_time`: corresponds to time the JobTrigger was created.
1831
- # * `update_time`: corresponds to time the JobTrigger was last updated.
1832
- # * `last_run_time`: corresponds to the last time the JobTrigger ran.
1833
- # * `name`: corresponds to JobTrigger's name.
1834
- # * `display_name`: corresponds to JobTrigger's display name.
1835
- # * `status`: corresponds to JobTrigger's status.
1836
- # @param filter [String]
1837
- # Allows filtering.
1838
- #
1839
- # Supported syntax:
1840
- #
1841
- # * Filter expressions are made up of one or more restrictions.
1842
- # * Restrictions can be combined by `AND` or `OR` logical operators. A
1843
- # sequence of restrictions implicitly uses `AND`.
1844
- # * A restriction has the form of `{field} {operator} {value}`.
1845
- # * Supported fields/values for inspect jobs:
1846
- # * `status` - HEALTHY|PAUSED|CANCELLED
1847
- # * `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
1848
- # * 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
1849
- # quotation marks. Nanoseconds are ignored.
1850
- # * 'error_count' - Number of errors that have occurred while running.
1851
- # * The operator must be `=` or `!=` for status and inspected_storage.
1852
- #
1853
- # Examples:
1854
- #
1855
- # * inspected_storage = cloud_storage AND status = HEALTHY
1856
- # * inspected_storage = cloud_storage OR inspected_storage = bigquery
1857
- # * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)
1858
- # * last_run_time > \"2017-12-12T00:00:00+00:00\"
1859
- #
1860
- # The length of this field should be no more than 500 characters.
1861
- # @param location_id [String]
1862
- # The geographic location where job triggers will be retrieved from.
1863
- # Use `-` for all locations. Reserved for future extensions.
1864
- # @param options [Google::Gax::CallOptions]
1865
- # Overrides the default settings for this call, e.g, timeout,
1866
- # retries, etc.
1867
- # @yield [result, operation] Access the result along with the RPC operation
1868
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::JobTrigger>]
1869
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1870
- # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::JobTrigger>]
1871
- # An enumerable of Google::Privacy::Dlp::V2::JobTrigger instances.
1872
- # See Google::Gax::PagedEnumerable documentation for other
1873
- # operations such as per-page iteration or access to the response
1874
- # object.
1875
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1876
- # @example
1877
- # require "google/cloud/dlp"
1878
- #
1879
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1880
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
1881
- #
1882
- # # Iterate over all results.
1883
- # dlp_client.list_job_triggers(formatted_parent).each do |element|
1884
- # # Process element.
1885
- # end
1886
- #
1887
- # # Or iterate over results one page at a time.
1888
- # dlp_client.list_job_triggers(formatted_parent).each_page do |page|
1889
- # # Process each page at a time.
1890
- # page.each do |element|
1891
- # # Process element.
1892
- # end
1893
- # end
1894
-
1895
- def list_job_triggers \
1896
- parent,
1897
- page_size: nil,
1898
- order_by: nil,
1899
- filter: nil,
1900
- location_id: nil,
1901
- options: nil,
1902
- &block
1903
- req = {
1904
- parent: parent,
1905
- page_size: page_size,
1906
- order_by: order_by,
1907
- filter: filter,
1908
- location_id: location_id
1909
- }.delete_if { |_, v| v.nil? }
1910
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListJobTriggersRequest)
1911
- @list_job_triggers.call(req, options, &block)
1912
- end
1913
-
1914
- # Gets a job trigger.
1915
- # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1916
- #
1917
- # @param name [String]
1918
- # Required. Resource name of the project and the triggeredJob, for example
1919
- # `projects/dlp-test-project/jobTriggers/53234423`.
1920
- # @param options [Google::Gax::CallOptions]
1921
- # Overrides the default settings for this call, e.g, timeout,
1922
- # retries, etc.
1923
- # @yield [result, operation] Access the result along with the RPC operation
1924
- # @yieldparam result [Google::Privacy::Dlp::V2::JobTrigger]
1925
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1926
- # @return [Google::Privacy::Dlp::V2::JobTrigger]
1927
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1928
- # @example
1929
- # require "google/cloud/dlp"
1930
- #
1931
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1932
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]")
1933
- # response = dlp_client.get_job_trigger(formatted_name)
1934
-
1935
- def get_job_trigger \
1936
- name,
1937
- options: nil,
1938
- &block
1939
- req = {
1940
- name: name
1941
- }.delete_if { |_, v| v.nil? }
1942
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetJobTriggerRequest)
1943
- @get_job_trigger.call(req, options, &block)
1944
- end
1945
-
1946
- # Deletes a job trigger.
1947
- # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1948
- #
1949
- # @param name [String]
1950
- # Required. Resource name of the project and the triggeredJob, for example
1951
- # `projects/dlp-test-project/jobTriggers/53234423`.
1952
- # @param options [Google::Gax::CallOptions]
1953
- # Overrides the default settings for this call, e.g, timeout,
1954
- # retries, etc.
1955
- # @yield [result, operation] Access the result along with the RPC operation
1956
- # @yieldparam result []
1957
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1958
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1959
- # @example
1960
- # require "google/cloud/dlp"
1961
- #
1962
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
1963
- #
1964
- # # TODO: Initialize `name`:
1965
- # name = ''
1966
- # dlp_client.delete_job_trigger(name)
1967
-
1968
- def delete_job_trigger \
1969
- name,
1970
- options: nil,
1971
- &block
1972
- req = {
1973
- name: name
1974
- }.delete_if { |_, v| v.nil? }
1975
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteJobTriggerRequest)
1976
- @delete_job_trigger.call(req, options, &block)
1977
- nil
1978
- end
1979
-
1980
- # Inspect hybrid content and store findings to a trigger. The inspection
1981
- # will be processed asynchronously. To review the findings monitor the
1982
- # jobs within the trigger.
1983
- # Early access feature is in a pre-release state and might change or have
1984
- # limited support. For more information, see
1985
- # https://cloud.google.com/products#product-launch-stages.
1986
- #
1987
- # @param name [String]
1988
- # Required. Resource name of the trigger to execute a hybrid inspect on, for
1989
- # example `projects/dlp-test-project/jobTriggers/53234423`.
1990
- # @param hybrid_item [Google::Privacy::Dlp::V2::HybridContentItem | Hash]
1991
- # The item to inspect.
1992
- # A hash of the same form as `Google::Privacy::Dlp::V2::HybridContentItem`
1993
- # can also be provided.
1994
- # @param options [Google::Gax::CallOptions]
1995
- # Overrides the default settings for this call, e.g, timeout,
1996
- # retries, etc.
1997
- # @yield [result, operation] Access the result along with the RPC operation
1998
- # @yieldparam result [Google::Privacy::Dlp::V2::HybridInspectResponse]
1999
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2000
- # @return [Google::Privacy::Dlp::V2::HybridInspectResponse]
2001
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2002
- # @example
2003
- # require "google/cloud/dlp"
2004
- #
2005
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2006
- #
2007
- # # TODO: Initialize `name`:
2008
- # name = ''
2009
- # response = dlp_client.hybrid_inspect_job_trigger(name)
2010
-
2011
- def hybrid_inspect_job_trigger \
2012
- name,
2013
- hybrid_item: nil,
2014
- options: nil,
2015
- &block
2016
- req = {
2017
- name: name,
2018
- hybrid_item: hybrid_item
2019
- }.delete_if { |_, v| v.nil? }
2020
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::HybridInspectJobTriggerRequest)
2021
- @hybrid_inspect_job_trigger.call(req, options, &block)
2022
- end
2023
-
2024
- # Updates a job trigger.
2025
- # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
2026
- #
2027
- # @param name [String]
2028
- # Required. Resource name of the project and the triggeredJob, for example
2029
- # `projects/dlp-test-project/jobTriggers/53234423`.
2030
- # @param job_trigger [Google::Privacy::Dlp::V2::JobTrigger | Hash]
2031
- # New JobTrigger value.
2032
- # A hash of the same form as `Google::Privacy::Dlp::V2::JobTrigger`
2033
- # can also be provided.
2034
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
2035
- # Mask to control which fields get updated.
2036
- # A hash of the same form as `Google::Protobuf::FieldMask`
2037
- # can also be provided.
2038
- # @param options [Google::Gax::CallOptions]
2039
- # Overrides the default settings for this call, e.g, timeout,
2040
- # retries, etc.
2041
- # @yield [result, operation] Access the result along with the RPC operation
2042
- # @yieldparam result [Google::Privacy::Dlp::V2::JobTrigger]
2043
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2044
- # @return [Google::Privacy::Dlp::V2::JobTrigger]
2045
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2046
- # @example
2047
- # require "google/cloud/dlp"
2048
- #
2049
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2050
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]")
2051
- # response = dlp_client.update_job_trigger(formatted_name)
2052
-
2053
- def update_job_trigger \
2054
- name,
2055
- job_trigger: nil,
2056
- update_mask: nil,
2057
- options: nil,
2058
- &block
2059
- req = {
2060
- name: name,
2061
- job_trigger: job_trigger,
2062
- update_mask: update_mask
2063
- }.delete_if { |_, v| v.nil? }
2064
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::UpdateJobTriggerRequest)
2065
- @update_job_trigger.call(req, options, &block)
2066
- end
2067
-
2068
- # Creates a job trigger to run DLP actions such as scanning storage for
2069
- # sensitive information on a set schedule.
2070
- # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
2071
- #
2072
- # @param parent [String]
2073
- # Required. The parent resource name, for example projects/my-project-id.
2074
- # @param job_trigger [Google::Privacy::Dlp::V2::JobTrigger | Hash]
2075
- # Required. The JobTrigger to create.
2076
- # A hash of the same form as `Google::Privacy::Dlp::V2::JobTrigger`
2077
- # can also be provided.
2078
- # @param trigger_id [String]
2079
- # The trigger id can contain uppercase and lowercase letters,
2080
- # numbers, and hyphens; that is, it must match the regular
2081
- # expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
2082
- # characters. Can be empty to allow the system to generate one.
2083
- # @param location_id [String]
2084
- # The geographic location to store the job trigger. Reserved for
2085
- # future extensions.
2086
- # @param options [Google::Gax::CallOptions]
2087
- # Overrides the default settings for this call, e.g, timeout,
2088
- # retries, etc.
2089
- # @yield [result, operation] Access the result along with the RPC operation
2090
- # @yieldparam result [Google::Privacy::Dlp::V2::JobTrigger]
2091
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2092
- # @return [Google::Privacy::Dlp::V2::JobTrigger]
2093
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2094
- # @example
2095
- # require "google/cloud/dlp"
2096
- #
2097
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2098
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
2099
- # response = dlp_client.create_job_trigger(formatted_parent)
2100
-
2101
- def create_job_trigger \
2102
- parent,
2103
- job_trigger: nil,
2104
- trigger_id: nil,
2105
- location_id: nil,
2106
- options: nil,
2107
- &block
2108
- req = {
2109
- parent: parent,
2110
- job_trigger: job_trigger,
2111
- trigger_id: trigger_id,
2112
- location_id: location_id
2113
- }.delete_if { |_, v| v.nil? }
2114
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateJobTriggerRequest)
2115
- @create_job_trigger.call(req, options, &block)
2116
- end
2117
-
2118
- # Creates a pre-built stored infoType to be used for inspection.
2119
- # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2120
- # learn more.
2121
- #
2122
- # @param parent [String]
2123
- # Required. The parent resource name, for example projects/my-project-id or
2124
- # organizations/my-org-id.
2125
- # @param config [Google::Privacy::Dlp::V2::StoredInfoTypeConfig | Hash]
2126
- # Required. Configuration of the storedInfoType to create.
2127
- # A hash of the same form as `Google::Privacy::Dlp::V2::StoredInfoTypeConfig`
2128
- # can also be provided.
2129
- # @param stored_info_type_id [String]
2130
- # The storedInfoType ID can contain uppercase and lowercase letters,
2131
- # numbers, and hyphens; that is, it must match the regular
2132
- # expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
2133
- # characters. Can be empty to allow the system to generate one.
2134
- # @param location_id [String]
2135
- # The geographic location to store the stored infoType. Reserved for
2136
- # future extensions.
2137
- # @param options [Google::Gax::CallOptions]
2138
- # Overrides the default settings for this call, e.g, timeout,
2139
- # retries, etc.
2140
- # @yield [result, operation] Access the result along with the RPC operation
2141
- # @yieldparam result [Google::Privacy::Dlp::V2::StoredInfoType]
2142
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2143
- # @return [Google::Privacy::Dlp::V2::StoredInfoType]
2144
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2145
- # @example
2146
- # require "google/cloud/dlp"
2147
- #
2148
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2149
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
2150
- # response = dlp_client.create_stored_info_type(formatted_parent)
2151
-
2152
- def create_stored_info_type \
2153
- parent,
2154
- config: nil,
2155
- stored_info_type_id: nil,
2156
- location_id: nil,
2157
- options: nil,
2158
- &block
2159
- req = {
2160
- parent: parent,
2161
- config: config,
2162
- stored_info_type_id: stored_info_type_id,
2163
- location_id: location_id
2164
- }.delete_if { |_, v| v.nil? }
2165
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateStoredInfoTypeRequest)
2166
- @create_stored_info_type.call(req, options, &block)
2167
- end
2168
-
2169
- # Updates the stored infoType by creating a new version. The existing version
2170
- # will continue to be used until the new version is ready.
2171
- # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2172
- # learn more.
2173
- #
2174
- # @param name [String]
2175
- # Required. Resource name of organization and storedInfoType to be updated,
2176
- # for example `organizations/433245324/storedInfoTypes/432452342` or
2177
- # projects/project-id/storedInfoTypes/432452342.
2178
- # @param config [Google::Privacy::Dlp::V2::StoredInfoTypeConfig | Hash]
2179
- # Updated configuration for the storedInfoType. If not provided, a new
2180
- # version of the storedInfoType will be created with the existing
2181
- # configuration.
2182
- # A hash of the same form as `Google::Privacy::Dlp::V2::StoredInfoTypeConfig`
2183
- # can also be provided.
2184
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
2185
- # Mask to control which fields get updated.
2186
- # A hash of the same form as `Google::Protobuf::FieldMask`
2187
- # can also be provided.
2188
- # @param options [Google::Gax::CallOptions]
2189
- # Overrides the default settings for this call, e.g, timeout,
2190
- # retries, etc.
2191
- # @yield [result, operation] Access the result along with the RPC operation
2192
- # @yieldparam result [Google::Privacy::Dlp::V2::StoredInfoType]
2193
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2194
- # @return [Google::Privacy::Dlp::V2::StoredInfoType]
2195
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2196
- # @example
2197
- # require "google/cloud/dlp"
2198
- #
2199
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2200
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_stored_info_type_path("[ORGANIZATION]", "[STORED_INFO_TYPE]")
2201
- # response = dlp_client.update_stored_info_type(formatted_name)
2202
-
2203
- def update_stored_info_type \
2204
- name,
2205
- config: nil,
2206
- update_mask: nil,
2207
- options: nil,
2208
- &block
2209
- req = {
2210
- name: name,
2211
- config: config,
2212
- update_mask: update_mask
2213
- }.delete_if { |_, v| v.nil? }
2214
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::UpdateStoredInfoTypeRequest)
2215
- @update_stored_info_type.call(req, options, &block)
2216
- end
2217
-
2218
- # Gets a stored infoType.
2219
- # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2220
- # learn more.
2221
- #
2222
- # @param name [String]
2223
- # Required. Resource name of the organization and storedInfoType to be read,
2224
- # for example `organizations/433245324/storedInfoTypes/432452342` or
2225
- # projects/project-id/storedInfoTypes/432452342.
2226
- # @param options [Google::Gax::CallOptions]
2227
- # Overrides the default settings for this call, e.g, timeout,
2228
- # retries, etc.
2229
- # @yield [result, operation] Access the result along with the RPC operation
2230
- # @yieldparam result [Google::Privacy::Dlp::V2::StoredInfoType]
2231
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2232
- # @return [Google::Privacy::Dlp::V2::StoredInfoType]
2233
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2234
- # @example
2235
- # require "google/cloud/dlp"
2236
- #
2237
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2238
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_stored_info_type_path("[ORGANIZATION]", "[STORED_INFO_TYPE]")
2239
- # response = dlp_client.get_stored_info_type(formatted_name)
2240
-
2241
- def get_stored_info_type \
2242
- name,
2243
- options: nil,
2244
- &block
2245
- req = {
2246
- name: name
2247
- }.delete_if { |_, v| v.nil? }
2248
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetStoredInfoTypeRequest)
2249
- @get_stored_info_type.call(req, options, &block)
2250
- end
2251
-
2252
- # Lists stored infoTypes.
2253
- # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2254
- # learn more.
2255
- #
2256
- # @param parent [String]
2257
- # Required. The parent resource name, for example projects/my-project-id or
2258
- # organizations/my-org-id.
2259
- # @param page_size [Integer]
2260
- # The maximum number of resources contained in the underlying API
2261
- # response. If page streaming is performed per-resource, this
2262
- # parameter does not affect the return value. If page streaming is
2263
- # performed per-page, this determines the maximum number of
2264
- # resources in a page.
2265
- # @param order_by [String]
2266
- # Comma separated list of fields to order by,
2267
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
2268
- # default sorting order is ascending, redundant space characters are
2269
- # insignificant.
2270
- #
2271
- # Example: `name asc, display_name, create_time desc`
2272
- #
2273
- # Supported fields are:
2274
- #
2275
- # * `create_time`: corresponds to time the most recent version of the
2276
- # resource was created.
2277
- # * `state`: corresponds to the state of the resource.
2278
- # * `name`: corresponds to resource name.
2279
- # * `display_name`: corresponds to info type's display name.
2280
- # @param location_id [String]
2281
- # The geographic location where stored infoTypes will be retrieved from.
2282
- # Use `-` for all locations. Reserved for future extensions.
2283
- # @param options [Google::Gax::CallOptions]
2284
- # Overrides the default settings for this call, e.g, timeout,
2285
- # retries, etc.
2286
- # @yield [result, operation] Access the result along with the RPC operation
2287
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::StoredInfoType>]
2288
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2289
- # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::StoredInfoType>]
2290
- # An enumerable of Google::Privacy::Dlp::V2::StoredInfoType instances.
2291
- # See Google::Gax::PagedEnumerable documentation for other
2292
- # operations such as per-page iteration or access to the response
2293
- # object.
2294
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2295
- # @example
2296
- # require "google/cloud/dlp"
2297
- #
2298
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2299
- # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
2300
- #
2301
- # # Iterate over all results.
2302
- # dlp_client.list_stored_info_types(formatted_parent).each do |element|
2303
- # # Process element.
2304
- # end
2305
- #
2306
- # # Or iterate over results one page at a time.
2307
- # dlp_client.list_stored_info_types(formatted_parent).each_page do |page|
2308
- # # Process each page at a time.
2309
- # page.each do |element|
2310
- # # Process element.
2311
- # end
2312
- # end
2313
-
2314
- def list_stored_info_types \
2315
- parent,
2316
- page_size: nil,
2317
- order_by: nil,
2318
- location_id: nil,
2319
- options: nil,
2320
- &block
2321
- req = {
2322
- parent: parent,
2323
- page_size: page_size,
2324
- order_by: order_by,
2325
- location_id: location_id
2326
- }.delete_if { |_, v| v.nil? }
2327
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListStoredInfoTypesRequest)
2328
- @list_stored_info_types.call(req, options, &block)
2329
- end
2330
-
2331
- # Deletes a stored infoType.
2332
- # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2333
- # learn more.
2334
- #
2335
- # @param name [String]
2336
- # Required. Resource name of the organization and storedInfoType to be
2337
- # deleted, for example `organizations/433245324/storedInfoTypes/432452342` or
2338
- # projects/project-id/storedInfoTypes/432452342.
2339
- # @param options [Google::Gax::CallOptions]
2340
- # Overrides the default settings for this call, e.g, timeout,
2341
- # retries, etc.
2342
- # @yield [result, operation] Access the result along with the RPC operation
2343
- # @yieldparam result []
2344
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2345
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2346
- # @example
2347
- # require "google/cloud/dlp"
2348
- #
2349
- # dlp_client = Google::Cloud::Dlp.new(version: :v2)
2350
- # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_stored_info_type_path("[ORGANIZATION]", "[STORED_INFO_TYPE]")
2351
- # dlp_client.delete_stored_info_type(formatted_name)
2352
-
2353
- def delete_stored_info_type \
2354
- name,
2355
- options: nil,
2356
- &block
2357
- req = {
2358
- name: name
2359
- }.delete_if { |_, v| v.nil? }
2360
- req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteStoredInfoTypeRequest)
2361
- @delete_stored_info_type.call(req, options, &block)
2362
- nil
2363
- end
2364
- end
2365
- end
2366
- end
2367
- end
2368
- end