cloudmersive-dlp-api-client 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +124 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-dlp-api-client.gemspec +45 -0
  6. data/docs/DetectApi.md +232 -0
  7. data/docs/DlpAdvancedDetectionRequest.md +43 -0
  8. data/docs/DlpAdvancedDetectionResponse.md +44 -0
  9. data/docs/DlpAdvancedDocumentDetectionRequest.md +46 -0
  10. data/docs/DlpAdvancedDocumentRedactionRequest.md +47 -0
  11. data/docs/DlpAdvancedDocumentRedactionResponse.md +46 -0
  12. data/docs/DlpAdvancedRedactionRequest.md +44 -0
  13. data/docs/DlpAdvancedRedactionResponse.md +44 -0
  14. data/docs/DlpDetectionRequest.md +31 -0
  15. data/docs/DlpDetectionResponse.md +31 -0
  16. data/docs/DlpDocumentDetectionRequest.md +33 -0
  17. data/docs/DlpDocumentRedactionRequest.md +34 -0
  18. data/docs/DlpDocumentRedactionResponse.md +33 -0
  19. data/docs/DlpRedactionRequest.md +32 -0
  20. data/docs/DlpRedactionResponse.md +32 -0
  21. data/docs/RedactApi.md +232 -0
  22. data/docs/RedactedPageInfo.md +8 -0
  23. data/git_push.sh +55 -0
  24. data/lib/cloudmersive-dlp-api-client/api/detect_api.rb +223 -0
  25. data/lib/cloudmersive-dlp-api-client/api/redact_api.rb +223 -0
  26. data/lib/cloudmersive-dlp-api-client/api_client.rb +391 -0
  27. data/lib/cloudmersive-dlp-api-client/api_error.rb +38 -0
  28. data/lib/cloudmersive-dlp-api-client/configuration.rb +209 -0
  29. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_detection_request.rb +536 -0
  30. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_detection_response.rb +546 -0
  31. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_detection_request.rb +581 -0
  32. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_request.rb +591 -0
  33. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_response.rb +583 -0
  34. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_redaction_request.rb +546 -0
  35. data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_redaction_response.rb +546 -0
  36. data/lib/cloudmersive-dlp-api-client/models/dlp_detection_request.rb +416 -0
  37. data/lib/cloudmersive-dlp-api-client/models/dlp_detection_response.rb +416 -0
  38. data/lib/cloudmersive-dlp-api-client/models/dlp_document_detection_request.rb +451 -0
  39. data/lib/cloudmersive-dlp-api-client/models/dlp_document_redaction_request.rb +461 -0
  40. data/lib/cloudmersive-dlp-api-client/models/dlp_document_redaction_response.rb +453 -0
  41. data/lib/cloudmersive-dlp-api-client/models/dlp_redaction_request.rb +426 -0
  42. data/lib/cloudmersive-dlp-api-client/models/dlp_redaction_response.rb +426 -0
  43. data/lib/cloudmersive-dlp-api-client/models/redacted_page_info.rb +186 -0
  44. data/lib/cloudmersive-dlp-api-client/version.rb +15 -0
  45. data/lib/cloudmersive-dlp-api-client.rb +56 -0
  46. data/spec/api/detect_api_spec.rb +83 -0
  47. data/spec/api/redact_api_spec.rb +83 -0
  48. data/spec/api_client_spec.rb +243 -0
  49. data/spec/configuration_spec.rb +42 -0
  50. data/spec/models/dlp_advanced_detection_request_spec.rb +251 -0
  51. data/spec/models/dlp_advanced_detection_response_spec.rb +257 -0
  52. data/spec/models/dlp_advanced_document_detection_request_spec.rb +269 -0
  53. data/spec/models/dlp_advanced_document_redaction_request_spec.rb +275 -0
  54. data/spec/models/dlp_advanced_document_redaction_response_spec.rb +269 -0
  55. data/spec/models/dlp_advanced_redaction_request_spec.rb +257 -0
  56. data/spec/models/dlp_advanced_redaction_response_spec.rb +257 -0
  57. data/spec/models/dlp_detection_request_spec.rb +179 -0
  58. data/spec/models/dlp_detection_response_spec.rb +179 -0
  59. data/spec/models/dlp_document_detection_request_spec.rb +191 -0
  60. data/spec/models/dlp_document_redaction_request_spec.rb +197 -0
  61. data/spec/models/dlp_document_redaction_response_spec.rb +191 -0
  62. data/spec/models/dlp_redaction_request_spec.rb +185 -0
  63. data/spec/models/dlp_redaction_response_spec.rb +185 -0
  64. data/spec/models/redacted_page_info_spec.rb +41 -0
  65. data/spec/spec_helper.rb +111 -0
  66. metadata +290 -0
@@ -0,0 +1,583 @@
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 advanced DLP document redaction with 35 PII detection results, redacted document, and optional rationale.
17
+ class DlpAdvancedDocumentRedactionResponse
18
+ # The redacted document as a rasterized PDF with PII regions redacted, or the original file if no disallowed PII was found.
19
+ attr_accessor :redacted_document
20
+
21
+ # True if no disallowed PII or sensitive data types were detected; false if any disallowed type was found and redacted.
22
+ attr_accessor :clean_result
23
+
24
+ # True if the document contains email addresses.
25
+ attr_accessor :contains_email_address
26
+
27
+ # True if the document contains phone numbers.
28
+ attr_accessor :contains_phone_number
29
+
30
+ # True if the document contains street addresses.
31
+ attr_accessor :contains_street_address
32
+
33
+ # True if the document contains person names.
34
+ attr_accessor :contains_person_name
35
+
36
+ # True if the document contains birth dates.
37
+ attr_accessor :contains_birth_date
38
+
39
+ # True if the document contains passport numbers.
40
+ attr_accessor :contains_passport_number
41
+
42
+ # True if the document contains drivers license numbers.
43
+ attr_accessor :contains_drivers_license
44
+
45
+ # True if the document contains social security numbers.
46
+ attr_accessor :contains_social_security_number
47
+
48
+ # True if the document contains taxpayer IDs.
49
+ attr_accessor :contains_taxpayer_id
50
+
51
+ # True if the document contains credit card numbers.
52
+ attr_accessor :contains_credit_card_number
53
+
54
+ # True if the document contains credit card expiration dates.
55
+ attr_accessor :contains_credit_card_expiration_date
56
+
57
+ # True if the document contains credit card verification codes.
58
+ attr_accessor :contains_credit_card_verification_code
59
+
60
+ # True if the document contains bank account numbers.
61
+ attr_accessor :contains_bank_account_number
62
+
63
+ # True if the document contains IBANs.
64
+ attr_accessor :contains_iban
65
+
66
+ # True if the document contains health insurance numbers.
67
+ attr_accessor :contains_health_insurance_number
68
+
69
+ # True if the document contains bearer tokens.
70
+ attr_accessor :contains_bearer_token
71
+
72
+ # True if the document contains HTTP cookies.
73
+ attr_accessor :contains_http_cookie
74
+
75
+ # True if the document contains private keys.
76
+ attr_accessor :contains_private_keys
77
+
78
+ # True if the document contains credentials (usernames/passwords).
79
+ attr_accessor :contains_credentials
80
+
81
+ # True if the document contains deep web URLs (.onion).
82
+ attr_accessor :contains_deep_web_urls
83
+
84
+ # True if the document contains source code.
85
+ attr_accessor :contains_source_code
86
+
87
+ # True if the document contains IP addresses.
88
+ attr_accessor :contains_ip_address
89
+
90
+ # True if the document contains MAC addresses.
91
+ attr_accessor :contains_mac_address
92
+
93
+ # True if the document contains health insurance member IDs.
94
+ attr_accessor :contains_health_insurance_member_id
95
+
96
+ # True if the document contains references to injuries or diseases.
97
+ attr_accessor :contains_health_injury_or_disease
98
+
99
+ # True if the document contains references to types of medical treatment.
100
+ attr_accessor :contains_health_type_of_treatment
101
+
102
+ # True if the document contains dates and times of medical treatment.
103
+ attr_accessor :contains_health_date_and_time_of_treatment
104
+
105
+ # True if the document contains health plan beneficiary numbers.
106
+ attr_accessor :contains_health_plan_beneficiary_number
107
+
108
+ # True if the document contains payments made for medical treatment.
109
+ attr_accessor :contains_health_payments_made_for_treatment
110
+
111
+ # True if the document contains identifiable human faces.
112
+ attr_accessor :contains_faces
113
+
114
+ # True if the document contains vehicle identifiers (e.g. license plates, VINs).
115
+ attr_accessor :contains_vehicle_id
116
+
117
+ # True if the document contains device identifiers (e.g. serial numbers, IMEIs, MAC-level device IDs).
118
+ attr_accessor :contains_device_id
119
+
120
+ # True if the document contains names of relatives.
121
+ attr_accessor :contains_names_of_relatives
122
+
123
+ # True if the document contains health universal record locators (URLs).
124
+ attr_accessor :contains_health_universal_record_locator
125
+
126
+ # True if the document contains biometric data references (e.g. fingerprints, retinal scans, voiceprints).
127
+ attr_accessor :contains_biometrics
128
+
129
+ # List of pages that were redacted (had PII regions redacted).
130
+ attr_accessor :pages_redacted
131
+
132
+ # Rationale for why the conclusion was formed. Only populated when ProvideAnalysisRationale is set to true in the request.
133
+ attr_accessor :analysis_rationale
134
+
135
+ # Attribute mapping from ruby-style variable name to JSON key.
136
+ def self.attribute_map
137
+ {
138
+ :'redacted_document' => :'RedactedDocument',
139
+ :'clean_result' => :'CleanResult',
140
+ :'contains_email_address' => :'ContainsEmailAddress',
141
+ :'contains_phone_number' => :'ContainsPhoneNumber',
142
+ :'contains_street_address' => :'ContainsStreetAddress',
143
+ :'contains_person_name' => :'ContainsPersonName',
144
+ :'contains_birth_date' => :'ContainsBirthDate',
145
+ :'contains_passport_number' => :'ContainsPassportNumber',
146
+ :'contains_drivers_license' => :'ContainsDriversLicense',
147
+ :'contains_social_security_number' => :'ContainsSocialSecurityNumber',
148
+ :'contains_taxpayer_id' => :'ContainsTaxpayerID',
149
+ :'contains_credit_card_number' => :'ContainsCreditCardNumber',
150
+ :'contains_credit_card_expiration_date' => :'ContainsCreditCardExpirationDate',
151
+ :'contains_credit_card_verification_code' => :'ContainsCreditCardVerificationCode',
152
+ :'contains_bank_account_number' => :'ContainsBankAccountNumber',
153
+ :'contains_iban' => :'ContainsIBAN',
154
+ :'contains_health_insurance_number' => :'ContainsHealthInsuranceNumber',
155
+ :'contains_bearer_token' => :'ContainsBearerToken',
156
+ :'contains_http_cookie' => :'ContainsHttpCookie',
157
+ :'contains_private_keys' => :'ContainsPrivateKeys',
158
+ :'contains_credentials' => :'ContainsCredentials',
159
+ :'contains_deep_web_urls' => :'ContainsDeepWebUrls',
160
+ :'contains_source_code' => :'ContainsSourceCode',
161
+ :'contains_ip_address' => :'ContainsIpAddress',
162
+ :'contains_mac_address' => :'ContainsMacAddress',
163
+ :'contains_health_insurance_member_id' => :'ContainsHealthInsuranceMemberID',
164
+ :'contains_health_injury_or_disease' => :'ContainsHealthInjuryOrDisease',
165
+ :'contains_health_type_of_treatment' => :'ContainsHealthTypeOfTreatment',
166
+ :'contains_health_date_and_time_of_treatment' => :'ContainsHealthDateAndTimeOfTreatment',
167
+ :'contains_health_plan_beneficiary_number' => :'ContainsHealthPlanBeneficiaryNumber',
168
+ :'contains_health_payments_made_for_treatment' => :'ContainsHealthPaymentsMadeForTreatment',
169
+ :'contains_faces' => :'ContainsFaces',
170
+ :'contains_vehicle_id' => :'ContainsVehicleID',
171
+ :'contains_device_id' => :'ContainsDeviceID',
172
+ :'contains_names_of_relatives' => :'ContainsNamesOfRelatives',
173
+ :'contains_health_universal_record_locator' => :'ContainsHealthUniversalRecordLocator',
174
+ :'contains_biometrics' => :'ContainsBiometrics',
175
+ :'pages_redacted' => :'PagesRedacted',
176
+ :'analysis_rationale' => :'AnalysisRationale'
177
+ }
178
+ end
179
+
180
+ # Attribute type mapping.
181
+ def self.swagger_types
182
+ {
183
+ :'redacted_document' => :'String',
184
+ :'clean_result' => :'BOOLEAN',
185
+ :'contains_email_address' => :'BOOLEAN',
186
+ :'contains_phone_number' => :'BOOLEAN',
187
+ :'contains_street_address' => :'BOOLEAN',
188
+ :'contains_person_name' => :'BOOLEAN',
189
+ :'contains_birth_date' => :'BOOLEAN',
190
+ :'contains_passport_number' => :'BOOLEAN',
191
+ :'contains_drivers_license' => :'BOOLEAN',
192
+ :'contains_social_security_number' => :'BOOLEAN',
193
+ :'contains_taxpayer_id' => :'BOOLEAN',
194
+ :'contains_credit_card_number' => :'BOOLEAN',
195
+ :'contains_credit_card_expiration_date' => :'BOOLEAN',
196
+ :'contains_credit_card_verification_code' => :'BOOLEAN',
197
+ :'contains_bank_account_number' => :'BOOLEAN',
198
+ :'contains_iban' => :'BOOLEAN',
199
+ :'contains_health_insurance_number' => :'BOOLEAN',
200
+ :'contains_bearer_token' => :'BOOLEAN',
201
+ :'contains_http_cookie' => :'BOOLEAN',
202
+ :'contains_private_keys' => :'BOOLEAN',
203
+ :'contains_credentials' => :'BOOLEAN',
204
+ :'contains_deep_web_urls' => :'BOOLEAN',
205
+ :'contains_source_code' => :'BOOLEAN',
206
+ :'contains_ip_address' => :'BOOLEAN',
207
+ :'contains_mac_address' => :'BOOLEAN',
208
+ :'contains_health_insurance_member_id' => :'BOOLEAN',
209
+ :'contains_health_injury_or_disease' => :'BOOLEAN',
210
+ :'contains_health_type_of_treatment' => :'BOOLEAN',
211
+ :'contains_health_date_and_time_of_treatment' => :'BOOLEAN',
212
+ :'contains_health_plan_beneficiary_number' => :'BOOLEAN',
213
+ :'contains_health_payments_made_for_treatment' => :'BOOLEAN',
214
+ :'contains_faces' => :'BOOLEAN',
215
+ :'contains_vehicle_id' => :'BOOLEAN',
216
+ :'contains_device_id' => :'BOOLEAN',
217
+ :'contains_names_of_relatives' => :'BOOLEAN',
218
+ :'contains_health_universal_record_locator' => :'BOOLEAN',
219
+ :'contains_biometrics' => :'BOOLEAN',
220
+ :'pages_redacted' => :'Array<RedactedPageInfo>',
221
+ :'analysis_rationale' => :'String'
222
+ }
223
+ end
224
+
225
+ # Initializes the object
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ def initialize(attributes = {})
228
+ return unless attributes.is_a?(Hash)
229
+
230
+ # convert string to symbol for hash key
231
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
232
+
233
+ if attributes.has_key?(:'RedactedDocument')
234
+ self.redacted_document = attributes[:'RedactedDocument']
235
+ end
236
+
237
+ if attributes.has_key?(:'CleanResult')
238
+ self.clean_result = attributes[:'CleanResult']
239
+ end
240
+
241
+ if attributes.has_key?(:'ContainsEmailAddress')
242
+ self.contains_email_address = attributes[:'ContainsEmailAddress']
243
+ end
244
+
245
+ if attributes.has_key?(:'ContainsPhoneNumber')
246
+ self.contains_phone_number = attributes[:'ContainsPhoneNumber']
247
+ end
248
+
249
+ if attributes.has_key?(:'ContainsStreetAddress')
250
+ self.contains_street_address = attributes[:'ContainsStreetAddress']
251
+ end
252
+
253
+ if attributes.has_key?(:'ContainsPersonName')
254
+ self.contains_person_name = attributes[:'ContainsPersonName']
255
+ end
256
+
257
+ if attributes.has_key?(:'ContainsBirthDate')
258
+ self.contains_birth_date = attributes[:'ContainsBirthDate']
259
+ end
260
+
261
+ if attributes.has_key?(:'ContainsPassportNumber')
262
+ self.contains_passport_number = attributes[:'ContainsPassportNumber']
263
+ end
264
+
265
+ if attributes.has_key?(:'ContainsDriversLicense')
266
+ self.contains_drivers_license = attributes[:'ContainsDriversLicense']
267
+ end
268
+
269
+ if attributes.has_key?(:'ContainsSocialSecurityNumber')
270
+ self.contains_social_security_number = attributes[:'ContainsSocialSecurityNumber']
271
+ end
272
+
273
+ if attributes.has_key?(:'ContainsTaxpayerID')
274
+ self.contains_taxpayer_id = attributes[:'ContainsTaxpayerID']
275
+ end
276
+
277
+ if attributes.has_key?(:'ContainsCreditCardNumber')
278
+ self.contains_credit_card_number = attributes[:'ContainsCreditCardNumber']
279
+ end
280
+
281
+ if attributes.has_key?(:'ContainsCreditCardExpirationDate')
282
+ self.contains_credit_card_expiration_date = attributes[:'ContainsCreditCardExpirationDate']
283
+ end
284
+
285
+ if attributes.has_key?(:'ContainsCreditCardVerificationCode')
286
+ self.contains_credit_card_verification_code = attributes[:'ContainsCreditCardVerificationCode']
287
+ end
288
+
289
+ if attributes.has_key?(:'ContainsBankAccountNumber')
290
+ self.contains_bank_account_number = attributes[:'ContainsBankAccountNumber']
291
+ end
292
+
293
+ if attributes.has_key?(:'ContainsIBAN')
294
+ self.contains_iban = attributes[:'ContainsIBAN']
295
+ end
296
+
297
+ if attributes.has_key?(:'ContainsHealthInsuranceNumber')
298
+ self.contains_health_insurance_number = attributes[:'ContainsHealthInsuranceNumber']
299
+ end
300
+
301
+ if attributes.has_key?(:'ContainsBearerToken')
302
+ self.contains_bearer_token = attributes[:'ContainsBearerToken']
303
+ end
304
+
305
+ if attributes.has_key?(:'ContainsHttpCookie')
306
+ self.contains_http_cookie = attributes[:'ContainsHttpCookie']
307
+ end
308
+
309
+ if attributes.has_key?(:'ContainsPrivateKeys')
310
+ self.contains_private_keys = attributes[:'ContainsPrivateKeys']
311
+ end
312
+
313
+ if attributes.has_key?(:'ContainsCredentials')
314
+ self.contains_credentials = attributes[:'ContainsCredentials']
315
+ end
316
+
317
+ if attributes.has_key?(:'ContainsDeepWebUrls')
318
+ self.contains_deep_web_urls = attributes[:'ContainsDeepWebUrls']
319
+ end
320
+
321
+ if attributes.has_key?(:'ContainsSourceCode')
322
+ self.contains_source_code = attributes[:'ContainsSourceCode']
323
+ end
324
+
325
+ if attributes.has_key?(:'ContainsIpAddress')
326
+ self.contains_ip_address = attributes[:'ContainsIpAddress']
327
+ end
328
+
329
+ if attributes.has_key?(:'ContainsMacAddress')
330
+ self.contains_mac_address = attributes[:'ContainsMacAddress']
331
+ end
332
+
333
+ if attributes.has_key?(:'ContainsHealthInsuranceMemberID')
334
+ self.contains_health_insurance_member_id = attributes[:'ContainsHealthInsuranceMemberID']
335
+ end
336
+
337
+ if attributes.has_key?(:'ContainsHealthInjuryOrDisease')
338
+ self.contains_health_injury_or_disease = attributes[:'ContainsHealthInjuryOrDisease']
339
+ end
340
+
341
+ if attributes.has_key?(:'ContainsHealthTypeOfTreatment')
342
+ self.contains_health_type_of_treatment = attributes[:'ContainsHealthTypeOfTreatment']
343
+ end
344
+
345
+ if attributes.has_key?(:'ContainsHealthDateAndTimeOfTreatment')
346
+ self.contains_health_date_and_time_of_treatment = attributes[:'ContainsHealthDateAndTimeOfTreatment']
347
+ end
348
+
349
+ if attributes.has_key?(:'ContainsHealthPlanBeneficiaryNumber')
350
+ self.contains_health_plan_beneficiary_number = attributes[:'ContainsHealthPlanBeneficiaryNumber']
351
+ end
352
+
353
+ if attributes.has_key?(:'ContainsHealthPaymentsMadeForTreatment')
354
+ self.contains_health_payments_made_for_treatment = attributes[:'ContainsHealthPaymentsMadeForTreatment']
355
+ end
356
+
357
+ if attributes.has_key?(:'ContainsFaces')
358
+ self.contains_faces = attributes[:'ContainsFaces']
359
+ end
360
+
361
+ if attributes.has_key?(:'ContainsVehicleID')
362
+ self.contains_vehicle_id = attributes[:'ContainsVehicleID']
363
+ end
364
+
365
+ if attributes.has_key?(:'ContainsDeviceID')
366
+ self.contains_device_id = attributes[:'ContainsDeviceID']
367
+ end
368
+
369
+ if attributes.has_key?(:'ContainsNamesOfRelatives')
370
+ self.contains_names_of_relatives = attributes[:'ContainsNamesOfRelatives']
371
+ end
372
+
373
+ if attributes.has_key?(:'ContainsHealthUniversalRecordLocator')
374
+ self.contains_health_universal_record_locator = attributes[:'ContainsHealthUniversalRecordLocator']
375
+ end
376
+
377
+ if attributes.has_key?(:'ContainsBiometrics')
378
+ self.contains_biometrics = attributes[:'ContainsBiometrics']
379
+ end
380
+
381
+ if attributes.has_key?(:'PagesRedacted')
382
+ if (value = attributes[:'PagesRedacted']).is_a?(Array)
383
+ self.pages_redacted = value
384
+ end
385
+ end
386
+
387
+ if attributes.has_key?(:'AnalysisRationale')
388
+ self.analysis_rationale = attributes[:'AnalysisRationale']
389
+ end
390
+ end
391
+
392
+ # Show invalid properties with the reasons. Usually used together with valid?
393
+ # @return Array for valid properties with the reasons
394
+ def list_invalid_properties
395
+ invalid_properties = Array.new
396
+ if !@redacted_document.nil? && @redacted_document !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
397
+ invalid_properties.push('invalid value for "redacted_document", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
398
+ end
399
+
400
+ invalid_properties
401
+ end
402
+
403
+ # Check to see if the all the properties in the model are valid
404
+ # @return true if the model is valid
405
+ def valid?
406
+ return false if !@redacted_document.nil? && @redacted_document !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
407
+ true
408
+ end
409
+
410
+ # Custom attribute writer method with validation
411
+ # @param [Object] redacted_document Value to be assigned
412
+ def redacted_document=(redacted_document)
413
+ if !redacted_document.nil? && redacted_document !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
414
+ fail ArgumentError, 'invalid value for "redacted_document", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
415
+ end
416
+
417
+ @redacted_document = redacted_document
418
+ end
419
+
420
+ # Checks equality by comparing each attribute.
421
+ # @param [Object] Object to be compared
422
+ def ==(o)
423
+ return true if self.equal?(o)
424
+ self.class == o.class &&
425
+ redacted_document == o.redacted_document &&
426
+ clean_result == o.clean_result &&
427
+ contains_email_address == o.contains_email_address &&
428
+ contains_phone_number == o.contains_phone_number &&
429
+ contains_street_address == o.contains_street_address &&
430
+ contains_person_name == o.contains_person_name &&
431
+ contains_birth_date == o.contains_birth_date &&
432
+ contains_passport_number == o.contains_passport_number &&
433
+ contains_drivers_license == o.contains_drivers_license &&
434
+ contains_social_security_number == o.contains_social_security_number &&
435
+ contains_taxpayer_id == o.contains_taxpayer_id &&
436
+ contains_credit_card_number == o.contains_credit_card_number &&
437
+ contains_credit_card_expiration_date == o.contains_credit_card_expiration_date &&
438
+ contains_credit_card_verification_code == o.contains_credit_card_verification_code &&
439
+ contains_bank_account_number == o.contains_bank_account_number &&
440
+ contains_iban == o.contains_iban &&
441
+ contains_health_insurance_number == o.contains_health_insurance_number &&
442
+ contains_bearer_token == o.contains_bearer_token &&
443
+ contains_http_cookie == o.contains_http_cookie &&
444
+ contains_private_keys == o.contains_private_keys &&
445
+ contains_credentials == o.contains_credentials &&
446
+ contains_deep_web_urls == o.contains_deep_web_urls &&
447
+ contains_source_code == o.contains_source_code &&
448
+ contains_ip_address == o.contains_ip_address &&
449
+ contains_mac_address == o.contains_mac_address &&
450
+ contains_health_insurance_member_id == o.contains_health_insurance_member_id &&
451
+ contains_health_injury_or_disease == o.contains_health_injury_or_disease &&
452
+ contains_health_type_of_treatment == o.contains_health_type_of_treatment &&
453
+ contains_health_date_and_time_of_treatment == o.contains_health_date_and_time_of_treatment &&
454
+ contains_health_plan_beneficiary_number == o.contains_health_plan_beneficiary_number &&
455
+ contains_health_payments_made_for_treatment == o.contains_health_payments_made_for_treatment &&
456
+ contains_faces == o.contains_faces &&
457
+ contains_vehicle_id == o.contains_vehicle_id &&
458
+ contains_device_id == o.contains_device_id &&
459
+ contains_names_of_relatives == o.contains_names_of_relatives &&
460
+ contains_health_universal_record_locator == o.contains_health_universal_record_locator &&
461
+ contains_biometrics == o.contains_biometrics &&
462
+ pages_redacted == o.pages_redacted &&
463
+ analysis_rationale == o.analysis_rationale
464
+ end
465
+
466
+ # @see the `==` method
467
+ # @param [Object] Object to be compared
468
+ def eql?(o)
469
+ self == o
470
+ end
471
+
472
+ # Calculates hash code according to all attributes.
473
+ # @return [Fixnum] Hash code
474
+ def hash
475
+ [redacted_document, 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, contains_health_insurance_member_id, contains_health_injury_or_disease, contains_health_type_of_treatment, contains_health_date_and_time_of_treatment, contains_health_plan_beneficiary_number, contains_health_payments_made_for_treatment, contains_faces, contains_vehicle_id, contains_device_id, contains_names_of_relatives, contains_health_universal_record_locator, contains_biometrics, pages_redacted, analysis_rationale].hash
476
+ end
477
+
478
+ # Builds the object from hash
479
+ # @param [Hash] attributes Model attributes in the form of hash
480
+ # @return [Object] Returns the model itself
481
+ def build_from_hash(attributes)
482
+ return nil unless attributes.is_a?(Hash)
483
+ self.class.swagger_types.each_pair do |key, type|
484
+ if type =~ /\AArray<(.*)>/i
485
+ # check to ensure the input is an array given that the attribute
486
+ # is documented as an array but the input is not
487
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
488
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
489
+ end
490
+ elsif !attributes[self.class.attribute_map[key]].nil?
491
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
492
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
493
+ end
494
+
495
+ self
496
+ end
497
+
498
+ # Deserializes the data based on type
499
+ # @param string type Data type
500
+ # @param string value Value to be deserialized
501
+ # @return [Object] Deserialized data
502
+ def _deserialize(type, value)
503
+ case type.to_sym
504
+ when :DateTime
505
+ DateTime.parse(value)
506
+ when :Date
507
+ Date.parse(value)
508
+ when :String
509
+ value.to_s
510
+ when :Integer
511
+ value.to_i
512
+ when :Float
513
+ value.to_f
514
+ when :BOOLEAN
515
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
516
+ true
517
+ else
518
+ false
519
+ end
520
+ when :Object
521
+ # generic object (usually a Hash), return directly
522
+ value
523
+ when /\AArray<(?<inner_type>.+)>\z/
524
+ inner_type = Regexp.last_match[:inner_type]
525
+ value.map { |v| _deserialize(inner_type, v) }
526
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
527
+ k_type = Regexp.last_match[:k_type]
528
+ v_type = Regexp.last_match[:v_type]
529
+ {}.tap do |hash|
530
+ value.each do |k, v|
531
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
532
+ end
533
+ end
534
+ else # model
535
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
536
+ temp_model.build_from_hash(value)
537
+ end
538
+ end
539
+
540
+ # Returns the string representation of the object
541
+ # @return [String] String presentation of the object
542
+ def to_s
543
+ to_hash.to_s
544
+ end
545
+
546
+ # to_body is an alias to to_hash (backward compatibility)
547
+ # @return [Hash] Returns the object in the form of hash
548
+ def to_body
549
+ to_hash
550
+ end
551
+
552
+ # Returns the object in the form of hash
553
+ # @return [Hash] Returns the object in the form of hash
554
+ def to_hash
555
+ hash = {}
556
+ self.class.attribute_map.each_pair do |attr, param|
557
+ value = self.send(attr)
558
+ next if value.nil?
559
+ hash[param] = _to_hash(value)
560
+ end
561
+ hash
562
+ end
563
+
564
+ # Outputs non-array value in the form of hash
565
+ # For object, use to_hash. Otherwise, just return the value
566
+ # @param [Object] value Any valid value
567
+ # @return [Hash] Returns the value in the form of hash
568
+ def _to_hash(value)
569
+ if value.is_a?(Array)
570
+ value.compact.map { |v| _to_hash(v) }
571
+ elsif value.is_a?(Hash)
572
+ {}.tap do |hash|
573
+ value.each { |k, v| hash[k] = _to_hash(v) }
574
+ end
575
+ elsif value.respond_to? :to_hash
576
+ value.to_hash
577
+ else
578
+ value
579
+ end
580
+ end
581
+
582
+ end
583
+ end