cloudmersive-dlp-api-client 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -8
  3. data/docs/AudioTimestamp.md +12 -0
  4. data/docs/CustomPiiField.md +9 -0
  5. data/docs/DetectApi.md +114 -2
  6. data/docs/DlpAdvancedAudioDetectionRequest.md +48 -0
  7. data/docs/DlpAdvancedAudioDetectionResponse.md +48 -0
  8. data/docs/DlpAdvancedAudioRedactionRequest.md +54 -0
  9. data/docs/DlpAdvancedAudioRedactionResponse.md +51 -0
  10. data/docs/DlpAdvancedDetectionRequest.md +4 -0
  11. data/docs/DlpAdvancedDetectionResponse.md +3 -0
  12. data/docs/DlpAdvancedDocumentDetectionRequest.md +6 -2
  13. data/docs/DlpAdvancedDocumentRedactionRequest.md +7 -2
  14. data/docs/DlpAdvancedDocumentRedactionResponse.md +3 -0
  15. data/docs/DlpAdvancedRedactionRequest.md +6 -1
  16. data/docs/DlpAdvancedRedactionResponse.md +3 -0
  17. data/docs/DlpAudioDetectionRequest.md +32 -0
  18. data/docs/DlpAudioDetectionResponse.md +33 -0
  19. data/docs/DlpAudioRedactionRequest.md +35 -0
  20. data/docs/DlpAudioRedactionResponse.md +36 -0
  21. data/docs/DlpBatchJobResult.md +9 -0
  22. data/docs/DlpBatchJobStatusResult.md +15 -0
  23. data/docs/DlpDocumentDetectionRequest.md +2 -2
  24. data/docs/DlpDocumentRedactionRequest.md +2 -2
  25. data/docs/DlpRedactionRequest.md +1 -1
  26. data/docs/RedactApi.md +114 -2
  27. data/docs/RedactedAudioSegment.md +10 -0
  28. data/docs/TasksBatchJobApi.md +288 -0
  29. data/lib/cloudmersive-dlp-api-client/api/detect_api.rb +104 -4
  30. data/lib/cloudmersive-dlp-api-client/api/redact_api.rb +104 -4
  31. data/lib/cloudmersive-dlp-api-client/api/tasks_batch_job_api.rb +272 -0
  32. data/lib/cloudmersive-dlp-api-client/models/audio_timestamp.rb +226 -0
  33. data/lib/cloudmersive-dlp-api-client/models/custom_pii_field.rb +196 -0
  34. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_audio_detection_request.rb +601 -0
  35. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_audio_detection_response.rb +588 -0
  36. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_audio_redaction_request.rb +663 -0
  37. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_audio_redaction_response.rb +635 -0
  38. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_detection_request.rb +44 -4
  39. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_detection_response.rb +31 -1
  40. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_detection_request.rb +46 -6
  41. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_request.rb +58 -6
  42. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_response.rb +31 -1
  43. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_redaction_request.rb +57 -5
  44. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_redaction_response.rb +31 -1
  45. data/lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_request.rb +441 -0
  46. data/lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb +438 -0
  47. data/lib/cloudmersive-dlp-api-client/models/dlp_audio_redaction_request.rb +471 -0
  48. data/lib/cloudmersive-dlp-api-client/models/dlp_audio_redaction_response.rb +485 -0
  49. data/lib/cloudmersive-dlp-api-client/models/dlp_batch_job_result.rb +196 -0
  50. data/lib/cloudmersive-dlp-api-client/models/dlp_batch_job_status_result.rb +252 -0
  51. data/lib/cloudmersive-dlp-api-client/models/dlp_document_detection_request.rb +2 -2
  52. data/lib/cloudmersive-dlp-api-client/models/dlp_document_redaction_request.rb +2 -2
  53. data/lib/cloudmersive-dlp-api-client/models/dlp_redaction_request.rb +1 -1
  54. data/lib/cloudmersive-dlp-api-client/models/redacted_audio_segment.rb +206 -0
  55. data/lib/cloudmersive-dlp-api-client/version.rb +1 -1
  56. data/lib/cloudmersive-dlp-api-client.rb +14 -0
  57. data/spec/api/detect_api_spec.rb +26 -2
  58. data/spec/api/redact_api_spec.rb +26 -2
  59. data/spec/api/tasks_batch_job_api_spec.rb +95 -0
  60. data/spec/models/audio_timestamp_spec.rb +65 -0
  61. data/spec/models/custom_pii_field_spec.rb +47 -0
  62. data/spec/models/dlp_advanced_audio_detection_request_spec.rb +281 -0
  63. data/spec/models/dlp_advanced_audio_detection_response_spec.rb +281 -0
  64. data/spec/models/dlp_advanced_audio_redaction_request_spec.rb +317 -0
  65. data/spec/models/dlp_advanced_audio_redaction_response_spec.rb +299 -0
  66. data/spec/models/dlp_advanced_detection_request_spec.rb +24 -0
  67. data/spec/models/dlp_advanced_detection_response_spec.rb +18 -0
  68. data/spec/models/dlp_advanced_document_detection_request_spec.rb +24 -0
  69. data/spec/models/dlp_advanced_document_redaction_request_spec.rb +30 -0
  70. data/spec/models/dlp_advanced_document_redaction_response_spec.rb +18 -0
  71. data/spec/models/dlp_advanced_redaction_request_spec.rb +30 -0
  72. data/spec/models/dlp_advanced_redaction_response_spec.rb +18 -0
  73. data/spec/models/dlp_audio_detection_request_spec.rb +185 -0
  74. data/spec/models/dlp_audio_detection_response_spec.rb +191 -0
  75. data/spec/models/dlp_audio_redaction_request_spec.rb +203 -0
  76. data/spec/models/dlp_audio_redaction_response_spec.rb +209 -0
  77. data/spec/models/dlp_batch_job_result_spec.rb +47 -0
  78. data/spec/models/dlp_batch_job_status_result_spec.rb +83 -0
  79. data/spec/models/redacted_audio_segment_spec.rb +53 -0
  80. metadata +44 -2
@@ -0,0 +1,485 @@
1
+ =begin
2
+ #dlpapi
3
+
4
+ #Easily and directly scan and detect sensitive data (PII) in input text.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveDlpApiClient
16
+ # Response object for DLP audio redaction with 23 PII detection results, redacted audio, and redacted transcript.
17
+ class DlpAudioRedactionResponse
18
+ # The redacted audio file bytes with PII segments bleeped or muted, or the original audio if no disallowed PII was found.
19
+ attr_accessor :redacted_audio
20
+
21
+ # The redacted transcript text with PII removed or replaced.
22
+ attr_accessor :redacted_transcript
23
+
24
+ # Full original transcript of the audio file.
25
+ attr_accessor :original_transcript
26
+
27
+ # Token-level timestamps from speech recognition.
28
+ attr_accessor :timestamps
29
+
30
+ # List of audio segments that were redacted, with their time ranges.
31
+ attr_accessor :redacted_segments
32
+
33
+ # True if no disallowed PII or sensitive data types were detected; false if any disallowed type was found and redacted.
34
+ attr_accessor :clean_result
35
+
36
+ # True if the audio transcript contains email addresses.
37
+ attr_accessor :contains_email_address
38
+
39
+ # True if the audio transcript contains phone numbers.
40
+ attr_accessor :contains_phone_number
41
+
42
+ # True if the audio transcript contains street addresses.
43
+ attr_accessor :contains_street_address
44
+
45
+ # True if the audio transcript contains person names.
46
+ attr_accessor :contains_person_name
47
+
48
+ # True if the audio transcript contains birth dates.
49
+ attr_accessor :contains_birth_date
50
+
51
+ # True if the audio transcript contains passport numbers.
52
+ attr_accessor :contains_passport_number
53
+
54
+ # True if the audio transcript contains drivers license numbers.
55
+ attr_accessor :contains_drivers_license
56
+
57
+ # True if the audio transcript contains social security numbers.
58
+ attr_accessor :contains_social_security_number
59
+
60
+ # True if the audio transcript contains taxpayer IDs.
61
+ attr_accessor :contains_taxpayer_id
62
+
63
+ # True if the audio transcript contains credit card numbers.
64
+ attr_accessor :contains_credit_card_number
65
+
66
+ # True if the audio transcript contains credit card expiration dates.
67
+ attr_accessor :contains_credit_card_expiration_date
68
+
69
+ # True if the audio transcript contains credit card verification codes.
70
+ attr_accessor :contains_credit_card_verification_code
71
+
72
+ # True if the audio transcript contains bank account numbers.
73
+ attr_accessor :contains_bank_account_number
74
+
75
+ # True if the audio transcript contains IBANs.
76
+ attr_accessor :contains_iban
77
+
78
+ # True if the audio transcript contains health insurance numbers.
79
+ attr_accessor :contains_health_insurance_number
80
+
81
+ # True if the audio transcript contains bearer tokens.
82
+ attr_accessor :contains_bearer_token
83
+
84
+ # True if the audio transcript contains HTTP cookies.
85
+ attr_accessor :contains_http_cookie
86
+
87
+ # True if the audio transcript contains private keys.
88
+ attr_accessor :contains_private_keys
89
+
90
+ # True if the audio transcript contains credentials (usernames/passwords).
91
+ attr_accessor :contains_credentials
92
+
93
+ # True if the audio transcript contains deep web URLs (.onion).
94
+ attr_accessor :contains_deep_web_urls
95
+
96
+ # True if the audio transcript contains source code.
97
+ attr_accessor :contains_source_code
98
+
99
+ # True if the audio transcript contains IP addresses.
100
+ attr_accessor :contains_ip_address
101
+
102
+ # True if the audio transcript contains MAC addresses.
103
+ attr_accessor :contains_mac_address
104
+
105
+ # Attribute mapping from ruby-style variable name to JSON key.
106
+ def self.attribute_map
107
+ {
108
+ :'redacted_audio' => :'RedactedAudio',
109
+ :'redacted_transcript' => :'RedactedTranscript',
110
+ :'original_transcript' => :'OriginalTranscript',
111
+ :'timestamps' => :'Timestamps',
112
+ :'redacted_segments' => :'RedactedSegments',
113
+ :'clean_result' => :'CleanResult',
114
+ :'contains_email_address' => :'ContainsEmailAddress',
115
+ :'contains_phone_number' => :'ContainsPhoneNumber',
116
+ :'contains_street_address' => :'ContainsStreetAddress',
117
+ :'contains_person_name' => :'ContainsPersonName',
118
+ :'contains_birth_date' => :'ContainsBirthDate',
119
+ :'contains_passport_number' => :'ContainsPassportNumber',
120
+ :'contains_drivers_license' => :'ContainsDriversLicense',
121
+ :'contains_social_security_number' => :'ContainsSocialSecurityNumber',
122
+ :'contains_taxpayer_id' => :'ContainsTaxpayerID',
123
+ :'contains_credit_card_number' => :'ContainsCreditCardNumber',
124
+ :'contains_credit_card_expiration_date' => :'ContainsCreditCardExpirationDate',
125
+ :'contains_credit_card_verification_code' => :'ContainsCreditCardVerificationCode',
126
+ :'contains_bank_account_number' => :'ContainsBankAccountNumber',
127
+ :'contains_iban' => :'ContainsIBAN',
128
+ :'contains_health_insurance_number' => :'ContainsHealthInsuranceNumber',
129
+ :'contains_bearer_token' => :'ContainsBearerToken',
130
+ :'contains_http_cookie' => :'ContainsHttpCookie',
131
+ :'contains_private_keys' => :'ContainsPrivateKeys',
132
+ :'contains_credentials' => :'ContainsCredentials',
133
+ :'contains_deep_web_urls' => :'ContainsDeepWebUrls',
134
+ :'contains_source_code' => :'ContainsSourceCode',
135
+ :'contains_ip_address' => :'ContainsIpAddress',
136
+ :'contains_mac_address' => :'ContainsMacAddress'
137
+ }
138
+ end
139
+
140
+ # Attribute type mapping.
141
+ def self.swagger_types
142
+ {
143
+ :'redacted_audio' => :'String',
144
+ :'redacted_transcript' => :'String',
145
+ :'original_transcript' => :'String',
146
+ :'timestamps' => :'Array<AudioTimestamp>',
147
+ :'redacted_segments' => :'Array<RedactedAudioSegment>',
148
+ :'clean_result' => :'BOOLEAN',
149
+ :'contains_email_address' => :'BOOLEAN',
150
+ :'contains_phone_number' => :'BOOLEAN',
151
+ :'contains_street_address' => :'BOOLEAN',
152
+ :'contains_person_name' => :'BOOLEAN',
153
+ :'contains_birth_date' => :'BOOLEAN',
154
+ :'contains_passport_number' => :'BOOLEAN',
155
+ :'contains_drivers_license' => :'BOOLEAN',
156
+ :'contains_social_security_number' => :'BOOLEAN',
157
+ :'contains_taxpayer_id' => :'BOOLEAN',
158
+ :'contains_credit_card_number' => :'BOOLEAN',
159
+ :'contains_credit_card_expiration_date' => :'BOOLEAN',
160
+ :'contains_credit_card_verification_code' => :'BOOLEAN',
161
+ :'contains_bank_account_number' => :'BOOLEAN',
162
+ :'contains_iban' => :'BOOLEAN',
163
+ :'contains_health_insurance_number' => :'BOOLEAN',
164
+ :'contains_bearer_token' => :'BOOLEAN',
165
+ :'contains_http_cookie' => :'BOOLEAN',
166
+ :'contains_private_keys' => :'BOOLEAN',
167
+ :'contains_credentials' => :'BOOLEAN',
168
+ :'contains_deep_web_urls' => :'BOOLEAN',
169
+ :'contains_source_code' => :'BOOLEAN',
170
+ :'contains_ip_address' => :'BOOLEAN',
171
+ :'contains_mac_address' => :'BOOLEAN'
172
+ }
173
+ end
174
+
175
+ # Initializes the object
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ def initialize(attributes = {})
178
+ return unless attributes.is_a?(Hash)
179
+
180
+ # convert string to symbol for hash key
181
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
182
+
183
+ if attributes.has_key?(:'RedactedAudio')
184
+ self.redacted_audio = attributes[:'RedactedAudio']
185
+ end
186
+
187
+ if attributes.has_key?(:'RedactedTranscript')
188
+ self.redacted_transcript = attributes[:'RedactedTranscript']
189
+ end
190
+
191
+ if attributes.has_key?(:'OriginalTranscript')
192
+ self.original_transcript = attributes[:'OriginalTranscript']
193
+ end
194
+
195
+ if attributes.has_key?(:'Timestamps')
196
+ if (value = attributes[:'Timestamps']).is_a?(Array)
197
+ self.timestamps = value
198
+ end
199
+ end
200
+
201
+ if attributes.has_key?(:'RedactedSegments')
202
+ if (value = attributes[:'RedactedSegments']).is_a?(Array)
203
+ self.redacted_segments = value
204
+ end
205
+ end
206
+
207
+ if attributes.has_key?(:'CleanResult')
208
+ self.clean_result = attributes[:'CleanResult']
209
+ end
210
+
211
+ if attributes.has_key?(:'ContainsEmailAddress')
212
+ self.contains_email_address = attributes[:'ContainsEmailAddress']
213
+ end
214
+
215
+ if attributes.has_key?(:'ContainsPhoneNumber')
216
+ self.contains_phone_number = attributes[:'ContainsPhoneNumber']
217
+ end
218
+
219
+ if attributes.has_key?(:'ContainsStreetAddress')
220
+ self.contains_street_address = attributes[:'ContainsStreetAddress']
221
+ end
222
+
223
+ if attributes.has_key?(:'ContainsPersonName')
224
+ self.contains_person_name = attributes[:'ContainsPersonName']
225
+ end
226
+
227
+ if attributes.has_key?(:'ContainsBirthDate')
228
+ self.contains_birth_date = attributes[:'ContainsBirthDate']
229
+ end
230
+
231
+ if attributes.has_key?(:'ContainsPassportNumber')
232
+ self.contains_passport_number = attributes[:'ContainsPassportNumber']
233
+ end
234
+
235
+ if attributes.has_key?(:'ContainsDriversLicense')
236
+ self.contains_drivers_license = attributes[:'ContainsDriversLicense']
237
+ end
238
+
239
+ if attributes.has_key?(:'ContainsSocialSecurityNumber')
240
+ self.contains_social_security_number = attributes[:'ContainsSocialSecurityNumber']
241
+ end
242
+
243
+ if attributes.has_key?(:'ContainsTaxpayerID')
244
+ self.contains_taxpayer_id = attributes[:'ContainsTaxpayerID']
245
+ end
246
+
247
+ if attributes.has_key?(:'ContainsCreditCardNumber')
248
+ self.contains_credit_card_number = attributes[:'ContainsCreditCardNumber']
249
+ end
250
+
251
+ if attributes.has_key?(:'ContainsCreditCardExpirationDate')
252
+ self.contains_credit_card_expiration_date = attributes[:'ContainsCreditCardExpirationDate']
253
+ end
254
+
255
+ if attributes.has_key?(:'ContainsCreditCardVerificationCode')
256
+ self.contains_credit_card_verification_code = attributes[:'ContainsCreditCardVerificationCode']
257
+ end
258
+
259
+ if attributes.has_key?(:'ContainsBankAccountNumber')
260
+ self.contains_bank_account_number = attributes[:'ContainsBankAccountNumber']
261
+ end
262
+
263
+ if attributes.has_key?(:'ContainsIBAN')
264
+ self.contains_iban = attributes[:'ContainsIBAN']
265
+ end
266
+
267
+ if attributes.has_key?(:'ContainsHealthInsuranceNumber')
268
+ self.contains_health_insurance_number = attributes[:'ContainsHealthInsuranceNumber']
269
+ end
270
+
271
+ if attributes.has_key?(:'ContainsBearerToken')
272
+ self.contains_bearer_token = attributes[:'ContainsBearerToken']
273
+ end
274
+
275
+ if attributes.has_key?(:'ContainsHttpCookie')
276
+ self.contains_http_cookie = attributes[:'ContainsHttpCookie']
277
+ end
278
+
279
+ if attributes.has_key?(:'ContainsPrivateKeys')
280
+ self.contains_private_keys = attributes[:'ContainsPrivateKeys']
281
+ end
282
+
283
+ if attributes.has_key?(:'ContainsCredentials')
284
+ self.contains_credentials = attributes[:'ContainsCredentials']
285
+ end
286
+
287
+ if attributes.has_key?(:'ContainsDeepWebUrls')
288
+ self.contains_deep_web_urls = attributes[:'ContainsDeepWebUrls']
289
+ end
290
+
291
+ if attributes.has_key?(:'ContainsSourceCode')
292
+ self.contains_source_code = attributes[:'ContainsSourceCode']
293
+ end
294
+
295
+ if attributes.has_key?(:'ContainsIpAddress')
296
+ self.contains_ip_address = attributes[:'ContainsIpAddress']
297
+ end
298
+
299
+ if attributes.has_key?(:'ContainsMacAddress')
300
+ self.contains_mac_address = attributes[:'ContainsMacAddress']
301
+ end
302
+ end
303
+
304
+ # Show invalid properties with the reasons. Usually used together with valid?
305
+ # @return Array for valid properties with the reasons
306
+ def list_invalid_properties
307
+ invalid_properties = Array.new
308
+ if !@redacted_audio.nil? && @redacted_audio !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
309
+ invalid_properties.push('invalid value for "redacted_audio", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
310
+ end
311
+
312
+ invalid_properties
313
+ end
314
+
315
+ # Check to see if the all the properties in the model are valid
316
+ # @return true if the model is valid
317
+ def valid?
318
+ return false if !@redacted_audio.nil? && @redacted_audio !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
319
+ true
320
+ end
321
+
322
+ # Custom attribute writer method with validation
323
+ # @param [Object] redacted_audio Value to be assigned
324
+ def redacted_audio=(redacted_audio)
325
+ if !redacted_audio.nil? && redacted_audio !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
326
+ fail ArgumentError, 'invalid value for "redacted_audio", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
327
+ end
328
+
329
+ @redacted_audio = redacted_audio
330
+ end
331
+
332
+ # Checks equality by comparing each attribute.
333
+ # @param [Object] Object to be compared
334
+ def ==(o)
335
+ return true if self.equal?(o)
336
+ self.class == o.class &&
337
+ redacted_audio == o.redacted_audio &&
338
+ redacted_transcript == o.redacted_transcript &&
339
+ original_transcript == o.original_transcript &&
340
+ timestamps == o.timestamps &&
341
+ redacted_segments == o.redacted_segments &&
342
+ clean_result == o.clean_result &&
343
+ contains_email_address == o.contains_email_address &&
344
+ contains_phone_number == o.contains_phone_number &&
345
+ contains_street_address == o.contains_street_address &&
346
+ contains_person_name == o.contains_person_name &&
347
+ contains_birth_date == o.contains_birth_date &&
348
+ contains_passport_number == o.contains_passport_number &&
349
+ contains_drivers_license == o.contains_drivers_license &&
350
+ contains_social_security_number == o.contains_social_security_number &&
351
+ contains_taxpayer_id == o.contains_taxpayer_id &&
352
+ contains_credit_card_number == o.contains_credit_card_number &&
353
+ contains_credit_card_expiration_date == o.contains_credit_card_expiration_date &&
354
+ contains_credit_card_verification_code == o.contains_credit_card_verification_code &&
355
+ contains_bank_account_number == o.contains_bank_account_number &&
356
+ contains_iban == o.contains_iban &&
357
+ contains_health_insurance_number == o.contains_health_insurance_number &&
358
+ contains_bearer_token == o.contains_bearer_token &&
359
+ contains_http_cookie == o.contains_http_cookie &&
360
+ contains_private_keys == o.contains_private_keys &&
361
+ contains_credentials == o.contains_credentials &&
362
+ contains_deep_web_urls == o.contains_deep_web_urls &&
363
+ contains_source_code == o.contains_source_code &&
364
+ contains_ip_address == o.contains_ip_address &&
365
+ contains_mac_address == o.contains_mac_address
366
+ end
367
+
368
+ # @see the `==` method
369
+ # @param [Object] Object to be compared
370
+ def eql?(o)
371
+ self == o
372
+ end
373
+
374
+ # Calculates hash code according to all attributes.
375
+ # @return [Fixnum] Hash code
376
+ def hash
377
+ [redacted_audio, redacted_transcript, original_transcript, timestamps, redacted_segments, clean_result, contains_email_address, contains_phone_number, contains_street_address, contains_person_name, contains_birth_date, contains_passport_number, contains_drivers_license, contains_social_security_number, contains_taxpayer_id, contains_credit_card_number, contains_credit_card_expiration_date, contains_credit_card_verification_code, contains_bank_account_number, contains_iban, contains_health_insurance_number, contains_bearer_token, contains_http_cookie, contains_private_keys, contains_credentials, contains_deep_web_urls, contains_source_code, contains_ip_address, contains_mac_address].hash
378
+ end
379
+
380
+ # Builds the object from hash
381
+ # @param [Hash] attributes Model attributes in the form of hash
382
+ # @return [Object] Returns the model itself
383
+ def build_from_hash(attributes)
384
+ return nil unless attributes.is_a?(Hash)
385
+ self.class.swagger_types.each_pair do |key, type|
386
+ if type =~ /\AArray<(.*)>/i
387
+ # check to ensure the input is an array given that the attribute
388
+ # is documented as an array but the input is not
389
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
390
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
391
+ end
392
+ elsif !attributes[self.class.attribute_map[key]].nil?
393
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
394
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
395
+ end
396
+
397
+ self
398
+ end
399
+
400
+ # Deserializes the data based on type
401
+ # @param string type Data type
402
+ # @param string value Value to be deserialized
403
+ # @return [Object] Deserialized data
404
+ def _deserialize(type, value)
405
+ case type.to_sym
406
+ when :DateTime
407
+ DateTime.parse(value)
408
+ when :Date
409
+ Date.parse(value)
410
+ when :String
411
+ value.to_s
412
+ when :Integer
413
+ value.to_i
414
+ when :Float
415
+ value.to_f
416
+ when :BOOLEAN
417
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
418
+ true
419
+ else
420
+ false
421
+ end
422
+ when :Object
423
+ # generic object (usually a Hash), return directly
424
+ value
425
+ when /\AArray<(?<inner_type>.+)>\z/
426
+ inner_type = Regexp.last_match[:inner_type]
427
+ value.map { |v| _deserialize(inner_type, v) }
428
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
429
+ k_type = Regexp.last_match[:k_type]
430
+ v_type = Regexp.last_match[:v_type]
431
+ {}.tap do |hash|
432
+ value.each do |k, v|
433
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
434
+ end
435
+ end
436
+ else # model
437
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
438
+ temp_model.build_from_hash(value)
439
+ end
440
+ end
441
+
442
+ # Returns the string representation of the object
443
+ # @return [String] String presentation of the object
444
+ def to_s
445
+ to_hash.to_s
446
+ end
447
+
448
+ # to_body is an alias to to_hash (backward compatibility)
449
+ # @return [Hash] Returns the object in the form of hash
450
+ def to_body
451
+ to_hash
452
+ end
453
+
454
+ # Returns the object in the form of hash
455
+ # @return [Hash] Returns the object in the form of hash
456
+ def to_hash
457
+ hash = {}
458
+ self.class.attribute_map.each_pair do |attr, param|
459
+ value = self.send(attr)
460
+ next if value.nil?
461
+ hash[param] = _to_hash(value)
462
+ end
463
+ hash
464
+ end
465
+
466
+ # Outputs non-array value in the form of hash
467
+ # For object, use to_hash. Otherwise, just return the value
468
+ # @param [Object] value Any valid value
469
+ # @return [Hash] Returns the value in the form of hash
470
+ def _to_hash(value)
471
+ if value.is_a?(Array)
472
+ value.compact.map { |v| _to_hash(v) }
473
+ elsif value.is_a?(Hash)
474
+ {}.tap do |hash|
475
+ value.each { |k, v| hash[k] = _to_hash(v) }
476
+ end
477
+ elsif value.respond_to? :to_hash
478
+ value.to_hash
479
+ else
480
+ value
481
+ end
482
+ end
483
+
484
+ end
485
+ end
@@ -0,0 +1,196 @@
1
+ =begin
2
+ #dlpapi
3
+
4
+ #Easily and directly scan and detect sensitive data (PII) in input text.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveDlpApiClient
16
+ # Result of submitting a DLP batch job
17
+ class DlpBatchJobResult
18
+ # True if successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # When creating a job, an Async Job ID is returned. Use the GetAsyncJobStatus API to check on the status of this job using the AsyncJobID and get the result when it finishes
22
+ attr_accessor :async_job_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'successful' => :'Successful',
28
+ :'async_job_id' => :'AsyncJobID'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'successful' => :'BOOLEAN',
36
+ :'async_job_id' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'Successful')
49
+ self.successful = attributes[:'Successful']
50
+ end
51
+
52
+ if attributes.has_key?(:'AsyncJobID')
53
+ self.async_job_id = attributes[:'AsyncJobID']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ successful == o.successful &&
76
+ async_job_id == o.async_job_id
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [successful, async_job_id].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+ end