google-cloud-dlp-v2 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Dlp
24
+ module V2
25
+ module DlpService
26
+ # Credentials for the DlpService API.
27
+ class Credentials < Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "DLP_CREDENTIALS",
33
+ "DLP_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "DLP_CREDENTIALS_JSON",
38
+ "DLP_KEYFILE_JSON",
39
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
40
+ "GOOGLE_CLOUD_KEYFILE_JSON",
41
+ "GCLOUD_KEYFILE_JSON"
42
+ ]
43
+ self.paths = [
44
+ "~/.config/google_cloud/application_default_credentials.json"
45
+ ]
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,384 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dlp
23
+ module V2
24
+ module DlpService
25
+ # Path helper methods for the DlpService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified DeidentifyTemplate resource string.
29
+ #
30
+ # @overload deidentify_template_path(organization:, deidentify_template:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `organizations/{organization}/deidentifyTemplates/{deidentify_template}`
34
+ #
35
+ # @param organization [String]
36
+ # @param deidentify_template [String]
37
+ #
38
+ # @overload deidentify_template_path(project:, deidentify_template:)
39
+ # The resource will be in the following format:
40
+ #
41
+ # `projects/{project}/deidentifyTemplates/{deidentify_template}`
42
+ #
43
+ # @param project [String]
44
+ # @param deidentify_template [String]
45
+ #
46
+ # @overload deidentify_template_path(organization:, location:, deidentify_template:)
47
+ # The resource will be in the following format:
48
+ #
49
+ # `organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}`
50
+ #
51
+ # @param organization [String]
52
+ # @param location [String]
53
+ # @param deidentify_template [String]
54
+ #
55
+ # @overload deidentify_template_path(project:, location:, deidentify_template:)
56
+ # The resource will be in the following format:
57
+ #
58
+ # `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}`
59
+ #
60
+ # @param project [String]
61
+ # @param location [String]
62
+ # @param deidentify_template [String]
63
+ #
64
+ # @return [String]
65
+ def deidentify_template_path **args
66
+ resources = {
67
+ "deidentify_template:organization" => (proc do |organization:, deidentify_template:|
68
+ raise ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
69
+
70
+ "organizations/#{organization}/deidentifyTemplates/#{deidentify_template}"
71
+ end),
72
+ "deidentify_template:project" => (proc do |project:, deidentify_template:|
73
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
74
+
75
+ "projects/#{project}/deidentifyTemplates/#{deidentify_template}"
76
+ end),
77
+ "deidentify_template:location:organization" => (proc do |organization:, location:, deidentify_template:|
78
+ raise ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
79
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
80
+
81
+ "organizations/#{organization}/locations/#{location}/deidentifyTemplates/#{deidentify_template}"
82
+ end),
83
+ "deidentify_template:location:project" => (proc do |project:, location:, deidentify_template:|
84
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
85
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
86
+
87
+ "projects/#{project}/locations/#{location}/deidentifyTemplates/#{deidentify_template}"
88
+ end)
89
+ }
90
+
91
+ resource = resources[args.keys.sort.join(":")]
92
+ raise ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
93
+ resource.call(**args)
94
+ end
95
+
96
+ ##
97
+ # Create a fully-qualified DlpJob resource string.
98
+ #
99
+ # @overload dlp_job_path(project:, dlp_job:)
100
+ # The resource will be in the following format:
101
+ #
102
+ # `projects/{project}/dlpJobs/{dlp_job}`
103
+ #
104
+ # @param project [String]
105
+ # @param dlp_job [String]
106
+ #
107
+ # @overload dlp_job_path(project:, location:, dlp_job:)
108
+ # The resource will be in the following format:
109
+ #
110
+ # `projects/{project}/locations/{location}/dlpJobs/{dlp_job}`
111
+ #
112
+ # @param project [String]
113
+ # @param location [String]
114
+ # @param dlp_job [String]
115
+ #
116
+ # @return [String]
117
+ def dlp_job_path **args
118
+ resources = {
119
+ "dlp_job:project" => (proc do |project:, dlp_job:|
120
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
121
+
122
+ "projects/#{project}/dlpJobs/#{dlp_job}"
123
+ end),
124
+ "dlp_job:location:project" => (proc do |project:, location:, dlp_job:|
125
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
126
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
127
+
128
+ "projects/#{project}/locations/#{location}/dlpJobs/#{dlp_job}"
129
+ end)
130
+ }
131
+
132
+ resource = resources[args.keys.sort.join(":")]
133
+ raise ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
134
+ resource.call(**args)
135
+ end
136
+
137
+ ##
138
+ # Create a fully-qualified InspectTemplate resource string.
139
+ #
140
+ # @overload inspect_template_path(organization:, inspect_template:)
141
+ # The resource will be in the following format:
142
+ #
143
+ # `organizations/{organization}/inspectTemplates/{inspect_template}`
144
+ #
145
+ # @param organization [String]
146
+ # @param inspect_template [String]
147
+ #
148
+ # @overload inspect_template_path(project:, inspect_template:)
149
+ # The resource will be in the following format:
150
+ #
151
+ # `projects/{project}/inspectTemplates/{inspect_template}`
152
+ #
153
+ # @param project [String]
154
+ # @param inspect_template [String]
155
+ #
156
+ # @overload inspect_template_path(organization:, location:, inspect_template:)
157
+ # The resource will be in the following format:
158
+ #
159
+ # `organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}`
160
+ #
161
+ # @param organization [String]
162
+ # @param location [String]
163
+ # @param inspect_template [String]
164
+ #
165
+ # @overload inspect_template_path(project:, location:, inspect_template:)
166
+ # The resource will be in the following format:
167
+ #
168
+ # `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}`
169
+ #
170
+ # @param project [String]
171
+ # @param location [String]
172
+ # @param inspect_template [String]
173
+ #
174
+ # @return [String]
175
+ def inspect_template_path **args
176
+ resources = {
177
+ "inspect_template:organization" => (proc do |organization:, inspect_template:|
178
+ raise ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
179
+
180
+ "organizations/#{organization}/inspectTemplates/#{inspect_template}"
181
+ end),
182
+ "inspect_template:project" => (proc do |project:, inspect_template:|
183
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
184
+
185
+ "projects/#{project}/inspectTemplates/#{inspect_template}"
186
+ end),
187
+ "inspect_template:location:organization" => (proc do |organization:, location:, inspect_template:|
188
+ raise ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
189
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
190
+
191
+ "organizations/#{organization}/locations/#{location}/inspectTemplates/#{inspect_template}"
192
+ end),
193
+ "inspect_template:location:project" => (proc do |project:, location:, inspect_template:|
194
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
195
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
196
+
197
+ "projects/#{project}/locations/#{location}/inspectTemplates/#{inspect_template}"
198
+ end)
199
+ }
200
+
201
+ resource = resources[args.keys.sort.join(":")]
202
+ raise ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
203
+ resource.call(**args)
204
+ end
205
+
206
+ ##
207
+ # Create a fully-qualified JobTrigger resource string.
208
+ #
209
+ # @overload job_trigger_path(project:, job_trigger:)
210
+ # The resource will be in the following format:
211
+ #
212
+ # `projects/{project}/jobTriggers/{job_trigger}`
213
+ #
214
+ # @param project [String]
215
+ # @param job_trigger [String]
216
+ #
217
+ # @overload job_trigger_path(project:, location:, job_trigger:)
218
+ # The resource will be in the following format:
219
+ #
220
+ # `projects/{project}/locations/{location}/jobTriggers/{job_trigger}`
221
+ #
222
+ # @param project [String]
223
+ # @param location [String]
224
+ # @param job_trigger [String]
225
+ #
226
+ # @return [String]
227
+ def job_trigger_path **args
228
+ resources = {
229
+ "job_trigger:project" => (proc do |project:, job_trigger:|
230
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
231
+
232
+ "projects/#{project}/jobTriggers/#{job_trigger}"
233
+ end),
234
+ "job_trigger:location:project" => (proc do |project:, location:, job_trigger:|
235
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
236
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
237
+
238
+ "projects/#{project}/locations/#{location}/jobTriggers/#{job_trigger}"
239
+ end)
240
+ }
241
+
242
+ resource = resources[args.keys.sort.join(":")]
243
+ raise ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
244
+ resource.call(**args)
245
+ end
246
+
247
+ ##
248
+ # Create a fully-qualified Location resource string.
249
+ #
250
+ # The resource will be in the following format:
251
+ #
252
+ # `projects/{project}/locations/{location}`
253
+ #
254
+ # @param project [String]
255
+ # @param location [String]
256
+ #
257
+ # @return [String]
258
+ def location_path project:, location:
259
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
260
+
261
+ "projects/#{project}/locations/#{location}"
262
+ end
263
+
264
+ ##
265
+ # Create a fully-qualified Organization resource string.
266
+ #
267
+ # The resource will be in the following format:
268
+ #
269
+ # `organizations/{organization}`
270
+ #
271
+ # @param organization [String]
272
+ #
273
+ # @return [String]
274
+ def organization_path organization:
275
+ "organizations/#{organization}"
276
+ end
277
+
278
+ ##
279
+ # Create a fully-qualified OrganizationLocation resource string.
280
+ #
281
+ # The resource will be in the following format:
282
+ #
283
+ # `organizations/{organization}/locations/{location}`
284
+ #
285
+ # @param organization [String]
286
+ # @param location [String]
287
+ #
288
+ # @return [String]
289
+ def organization_location_path organization:, location:
290
+ raise ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
291
+
292
+ "organizations/#{organization}/locations/#{location}"
293
+ end
294
+
295
+ ##
296
+ # Create a fully-qualified Project resource string.
297
+ #
298
+ # The resource will be in the following format:
299
+ #
300
+ # `projects/{project}`
301
+ #
302
+ # @param project [String]
303
+ #
304
+ # @return [String]
305
+ def project_path project:
306
+ "projects/#{project}"
307
+ end
308
+
309
+ ##
310
+ # Create a fully-qualified StoredInfoType resource string.
311
+ #
312
+ # @overload stored_info_type_path(organization:, stored_info_type:)
313
+ # The resource will be in the following format:
314
+ #
315
+ # `organizations/{organization}/storedInfoTypes/{stored_info_type}`
316
+ #
317
+ # @param organization [String]
318
+ # @param stored_info_type [String]
319
+ #
320
+ # @overload stored_info_type_path(project:, stored_info_type:)
321
+ # The resource will be in the following format:
322
+ #
323
+ # `projects/{project}/storedInfoTypes/{stored_info_type}`
324
+ #
325
+ # @param project [String]
326
+ # @param stored_info_type [String]
327
+ #
328
+ # @overload stored_info_type_path(organization:, location:, stored_info_type:)
329
+ # The resource will be in the following format:
330
+ #
331
+ # `organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}`
332
+ #
333
+ # @param organization [String]
334
+ # @param location [String]
335
+ # @param stored_info_type [String]
336
+ #
337
+ # @overload stored_info_type_path(project:, location:, stored_info_type:)
338
+ # The resource will be in the following format:
339
+ #
340
+ # `projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}`
341
+ #
342
+ # @param project [String]
343
+ # @param location [String]
344
+ # @param stored_info_type [String]
345
+ #
346
+ # @return [String]
347
+ def stored_info_type_path **args
348
+ resources = {
349
+ "organization:stored_info_type" => (proc do |organization:, stored_info_type:|
350
+ raise ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
351
+
352
+ "organizations/#{organization}/storedInfoTypes/#{stored_info_type}"
353
+ end),
354
+ "project:stored_info_type" => (proc do |project:, stored_info_type:|
355
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
356
+
357
+ "projects/#{project}/storedInfoTypes/#{stored_info_type}"
358
+ end),
359
+ "location:organization:stored_info_type" => (proc do |organization:, location:, stored_info_type:|
360
+ raise ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
361
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
362
+
363
+ "organizations/#{organization}/locations/#{location}/storedInfoTypes/#{stored_info_type}"
364
+ end),
365
+ "location:project:stored_info_type" => (proc do |project:, location:, stored_info_type:|
366
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
367
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
368
+
369
+ "projects/#{project}/locations/#{location}/storedInfoTypes/#{stored_info_type}"
370
+ end)
371
+ }
372
+
373
+ resource = resources[args.keys.sort.join(":")]
374
+ raise ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
375
+ resource.call(**args)
376
+ end
377
+
378
+ extend self
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dlp
23
+ module V2
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end