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,471 @@
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
+ # Request object for DLP audio redaction with 23 PII detection types.
17
+ class DlpAudioRedactionRequest
18
+ # Audio file bytes (WAV, MP3, M4A, FLAC, OGG, or WMA) to transcribe, scan for PII, and redact.
19
+ attr_accessor :input_file
20
+
21
+ # Language code for speech recognition. Default is \"ENG\" (English).
22
+ attr_accessor :language_code
23
+
24
+ # Set to true to allow email addresses in the audio transcript and not redact them.
25
+ attr_accessor :allow_email_address
26
+
27
+ # Set to true to allow phone numbers in the audio transcript and not redact them.
28
+ attr_accessor :allow_phone_number
29
+
30
+ # Set to true to allow street addresses in the audio transcript and not redact them.
31
+ attr_accessor :allow_street_address
32
+
33
+ # Set to true to allow person names in the audio transcript and not redact them.
34
+ attr_accessor :allow_person_name
35
+
36
+ # Set to true to allow birth dates in the audio transcript and not redact them.
37
+ attr_accessor :allow_birth_date
38
+
39
+ # Set to true to allow passport numbers in the audio transcript and not redact them.
40
+ attr_accessor :allow_passport_number
41
+
42
+ # Set to true to allow drivers license numbers in the audio transcript and not redact them.
43
+ attr_accessor :allow_drivers_license
44
+
45
+ # Set to true to allow social security numbers in the audio transcript and not redact them.
46
+ attr_accessor :allow_social_security_number
47
+
48
+ # Set to true to allow taxpayer IDs in the audio transcript and not redact them.
49
+ attr_accessor :allow_taxpayer_id
50
+
51
+ # Set to true to allow credit card numbers in the audio transcript and not redact them.
52
+ attr_accessor :allow_credit_card_number
53
+
54
+ # Set to true to allow credit card expiration dates in the audio transcript and not redact them.
55
+ attr_accessor :allow_credit_card_expiration_date
56
+
57
+ # Set to true to allow credit card verification codes in the audio transcript and not redact them.
58
+ attr_accessor :allow_credit_card_verification_code
59
+
60
+ # Set to true to allow bank account numbers in the audio transcript and not redact them.
61
+ attr_accessor :allow_bank_account_number
62
+
63
+ # Set to true to allow IBANs in the audio transcript and not redact them.
64
+ attr_accessor :allow_iban
65
+
66
+ # Set to true to allow health insurance numbers in the audio transcript and not redact them.
67
+ attr_accessor :allow_health_insurance_number
68
+
69
+ # Set to true to allow bearer tokens in the audio transcript and not redact them.
70
+ attr_accessor :allow_bearer_token
71
+
72
+ # Set to true to allow HTTP cookies in the audio transcript and not redact them.
73
+ attr_accessor :allow_http_cookie
74
+
75
+ # Set to true to allow private keys in the audio transcript and not redact them.
76
+ attr_accessor :allow_private_keys
77
+
78
+ # Set to true to allow credentials (usernames/passwords) in the audio transcript and not redact them.
79
+ attr_accessor :allow_credentials
80
+
81
+ # Set to true to allow deep web URLs (.onion) in the audio transcript and not redact them.
82
+ attr_accessor :allow_deep_web_urls
83
+
84
+ # Set to true to allow source code in the audio transcript and not redact it.
85
+ attr_accessor :allow_source_code
86
+
87
+ # Set to true to allow IP addresses in the audio transcript and not redact them.
88
+ attr_accessor :allow_ip_address
89
+
90
+ # Set to true to allow MAC addresses in the audio transcript and not redact them.
91
+ attr_accessor :allow_mac_address
92
+
93
+ # Redaction mode for audio: \"Bleep\" (default) replaces redacted audio segments with a bleep tone, or \"Mute\" zeroes out the audio for the redacted portions.
94
+ attr_accessor :redaction_mode
95
+
96
+ # Redaction mode for the transcript text: \"SemanticTag\" (default) replaces PII with a semantic tag in square brackets (e.g. [PHONE-NUMBER]), \"Delete\" removes PII entirely, or \"ReplaceWithAsterisk\" replaces PII characters with asterisks (*).
97
+ attr_accessor :transcript_redaction_mode
98
+
99
+ # Optional. Speech recognition mode used when transcribing the audio for redaction. Available values: \"Fast\", \"Normal\", or \"Advanced\". Defaults to \"Normal\" when not specified.
100
+ attr_accessor :speech_recognition_mode
101
+
102
+ # Attribute mapping from ruby-style variable name to JSON key.
103
+ def self.attribute_map
104
+ {
105
+ :'input_file' => :'InputFile',
106
+ :'language_code' => :'LanguageCode',
107
+ :'allow_email_address' => :'AllowEmailAddress',
108
+ :'allow_phone_number' => :'AllowPhoneNumber',
109
+ :'allow_street_address' => :'AllowStreetAddress',
110
+ :'allow_person_name' => :'AllowPersonName',
111
+ :'allow_birth_date' => :'AllowBirthDate',
112
+ :'allow_passport_number' => :'AllowPassportNumber',
113
+ :'allow_drivers_license' => :'AllowDriversLicense',
114
+ :'allow_social_security_number' => :'AllowSocialSecurityNumber',
115
+ :'allow_taxpayer_id' => :'AllowTaxpayerID',
116
+ :'allow_credit_card_number' => :'AllowCreditCardNumber',
117
+ :'allow_credit_card_expiration_date' => :'AllowCreditCardExpirationDate',
118
+ :'allow_credit_card_verification_code' => :'AllowCreditCardVerificationCode',
119
+ :'allow_bank_account_number' => :'AllowBankAccountNumber',
120
+ :'allow_iban' => :'AllowIBAN',
121
+ :'allow_health_insurance_number' => :'AllowHealthInsuranceNumber',
122
+ :'allow_bearer_token' => :'AllowBearerToken',
123
+ :'allow_http_cookie' => :'AllowHttpCookie',
124
+ :'allow_private_keys' => :'AllowPrivateKeys',
125
+ :'allow_credentials' => :'AllowCredentials',
126
+ :'allow_deep_web_urls' => :'AllowDeepWebUrls',
127
+ :'allow_source_code' => :'AllowSourceCode',
128
+ :'allow_ip_address' => :'AllowIpAddress',
129
+ :'allow_mac_address' => :'AllowMacAddress',
130
+ :'redaction_mode' => :'RedactionMode',
131
+ :'transcript_redaction_mode' => :'TranscriptRedactionMode',
132
+ :'speech_recognition_mode' => :'SpeechRecognitionMode'
133
+ }
134
+ end
135
+
136
+ # Attribute type mapping.
137
+ def self.swagger_types
138
+ {
139
+ :'input_file' => :'String',
140
+ :'language_code' => :'String',
141
+ :'allow_email_address' => :'BOOLEAN',
142
+ :'allow_phone_number' => :'BOOLEAN',
143
+ :'allow_street_address' => :'BOOLEAN',
144
+ :'allow_person_name' => :'BOOLEAN',
145
+ :'allow_birth_date' => :'BOOLEAN',
146
+ :'allow_passport_number' => :'BOOLEAN',
147
+ :'allow_drivers_license' => :'BOOLEAN',
148
+ :'allow_social_security_number' => :'BOOLEAN',
149
+ :'allow_taxpayer_id' => :'BOOLEAN',
150
+ :'allow_credit_card_number' => :'BOOLEAN',
151
+ :'allow_credit_card_expiration_date' => :'BOOLEAN',
152
+ :'allow_credit_card_verification_code' => :'BOOLEAN',
153
+ :'allow_bank_account_number' => :'BOOLEAN',
154
+ :'allow_iban' => :'BOOLEAN',
155
+ :'allow_health_insurance_number' => :'BOOLEAN',
156
+ :'allow_bearer_token' => :'BOOLEAN',
157
+ :'allow_http_cookie' => :'BOOLEAN',
158
+ :'allow_private_keys' => :'BOOLEAN',
159
+ :'allow_credentials' => :'BOOLEAN',
160
+ :'allow_deep_web_urls' => :'BOOLEAN',
161
+ :'allow_source_code' => :'BOOLEAN',
162
+ :'allow_ip_address' => :'BOOLEAN',
163
+ :'allow_mac_address' => :'BOOLEAN',
164
+ :'redaction_mode' => :'String',
165
+ :'transcript_redaction_mode' => :'String',
166
+ :'speech_recognition_mode' => :'String'
167
+ }
168
+ end
169
+
170
+ # Initializes the object
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ def initialize(attributes = {})
173
+ return unless attributes.is_a?(Hash)
174
+
175
+ # convert string to symbol for hash key
176
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
177
+
178
+ if attributes.has_key?(:'InputFile')
179
+ self.input_file = attributes[:'InputFile']
180
+ end
181
+
182
+ if attributes.has_key?(:'LanguageCode')
183
+ self.language_code = attributes[:'LanguageCode']
184
+ end
185
+
186
+ if attributes.has_key?(:'AllowEmailAddress')
187
+ self.allow_email_address = attributes[:'AllowEmailAddress']
188
+ end
189
+
190
+ if attributes.has_key?(:'AllowPhoneNumber')
191
+ self.allow_phone_number = attributes[:'AllowPhoneNumber']
192
+ end
193
+
194
+ if attributes.has_key?(:'AllowStreetAddress')
195
+ self.allow_street_address = attributes[:'AllowStreetAddress']
196
+ end
197
+
198
+ if attributes.has_key?(:'AllowPersonName')
199
+ self.allow_person_name = attributes[:'AllowPersonName']
200
+ end
201
+
202
+ if attributes.has_key?(:'AllowBirthDate')
203
+ self.allow_birth_date = attributes[:'AllowBirthDate']
204
+ end
205
+
206
+ if attributes.has_key?(:'AllowPassportNumber')
207
+ self.allow_passport_number = attributes[:'AllowPassportNumber']
208
+ end
209
+
210
+ if attributes.has_key?(:'AllowDriversLicense')
211
+ self.allow_drivers_license = attributes[:'AllowDriversLicense']
212
+ end
213
+
214
+ if attributes.has_key?(:'AllowSocialSecurityNumber')
215
+ self.allow_social_security_number = attributes[:'AllowSocialSecurityNumber']
216
+ end
217
+
218
+ if attributes.has_key?(:'AllowTaxpayerID')
219
+ self.allow_taxpayer_id = attributes[:'AllowTaxpayerID']
220
+ end
221
+
222
+ if attributes.has_key?(:'AllowCreditCardNumber')
223
+ self.allow_credit_card_number = attributes[:'AllowCreditCardNumber']
224
+ end
225
+
226
+ if attributes.has_key?(:'AllowCreditCardExpirationDate')
227
+ self.allow_credit_card_expiration_date = attributes[:'AllowCreditCardExpirationDate']
228
+ end
229
+
230
+ if attributes.has_key?(:'AllowCreditCardVerificationCode')
231
+ self.allow_credit_card_verification_code = attributes[:'AllowCreditCardVerificationCode']
232
+ end
233
+
234
+ if attributes.has_key?(:'AllowBankAccountNumber')
235
+ self.allow_bank_account_number = attributes[:'AllowBankAccountNumber']
236
+ end
237
+
238
+ if attributes.has_key?(:'AllowIBAN')
239
+ self.allow_iban = attributes[:'AllowIBAN']
240
+ end
241
+
242
+ if attributes.has_key?(:'AllowHealthInsuranceNumber')
243
+ self.allow_health_insurance_number = attributes[:'AllowHealthInsuranceNumber']
244
+ end
245
+
246
+ if attributes.has_key?(:'AllowBearerToken')
247
+ self.allow_bearer_token = attributes[:'AllowBearerToken']
248
+ end
249
+
250
+ if attributes.has_key?(:'AllowHttpCookie')
251
+ self.allow_http_cookie = attributes[:'AllowHttpCookie']
252
+ end
253
+
254
+ if attributes.has_key?(:'AllowPrivateKeys')
255
+ self.allow_private_keys = attributes[:'AllowPrivateKeys']
256
+ end
257
+
258
+ if attributes.has_key?(:'AllowCredentials')
259
+ self.allow_credentials = attributes[:'AllowCredentials']
260
+ end
261
+
262
+ if attributes.has_key?(:'AllowDeepWebUrls')
263
+ self.allow_deep_web_urls = attributes[:'AllowDeepWebUrls']
264
+ end
265
+
266
+ if attributes.has_key?(:'AllowSourceCode')
267
+ self.allow_source_code = attributes[:'AllowSourceCode']
268
+ end
269
+
270
+ if attributes.has_key?(:'AllowIpAddress')
271
+ self.allow_ip_address = attributes[:'AllowIpAddress']
272
+ end
273
+
274
+ if attributes.has_key?(:'AllowMacAddress')
275
+ self.allow_mac_address = attributes[:'AllowMacAddress']
276
+ end
277
+
278
+ if attributes.has_key?(:'RedactionMode')
279
+ self.redaction_mode = attributes[:'RedactionMode']
280
+ end
281
+
282
+ if attributes.has_key?(:'TranscriptRedactionMode')
283
+ self.transcript_redaction_mode = attributes[:'TranscriptRedactionMode']
284
+ end
285
+
286
+ if attributes.has_key?(:'SpeechRecognitionMode')
287
+ self.speech_recognition_mode = attributes[:'SpeechRecognitionMode']
288
+ end
289
+ end
290
+
291
+ # Show invalid properties with the reasons. Usually used together with valid?
292
+ # @return Array for valid properties with the reasons
293
+ def list_invalid_properties
294
+ invalid_properties = Array.new
295
+ if !@input_file.nil? && @input_file !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
296
+ invalid_properties.push('invalid value for "input_file", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
297
+ end
298
+
299
+ invalid_properties
300
+ end
301
+
302
+ # Check to see if the all the properties in the model are valid
303
+ # @return true if the model is valid
304
+ def valid?
305
+ return false if !@input_file.nil? && @input_file !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
306
+ true
307
+ end
308
+
309
+ # Custom attribute writer method with validation
310
+ # @param [Object] input_file Value to be assigned
311
+ def input_file=(input_file)
312
+ if !input_file.nil? && input_file !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
313
+ fail ArgumentError, 'invalid value for "input_file", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
314
+ end
315
+
316
+ @input_file = input_file
317
+ end
318
+
319
+ # Checks equality by comparing each attribute.
320
+ # @param [Object] Object to be compared
321
+ def ==(o)
322
+ return true if self.equal?(o)
323
+ self.class == o.class &&
324
+ input_file == o.input_file &&
325
+ language_code == o.language_code &&
326
+ allow_email_address == o.allow_email_address &&
327
+ allow_phone_number == o.allow_phone_number &&
328
+ allow_street_address == o.allow_street_address &&
329
+ allow_person_name == o.allow_person_name &&
330
+ allow_birth_date == o.allow_birth_date &&
331
+ allow_passport_number == o.allow_passport_number &&
332
+ allow_drivers_license == o.allow_drivers_license &&
333
+ allow_social_security_number == o.allow_social_security_number &&
334
+ allow_taxpayer_id == o.allow_taxpayer_id &&
335
+ allow_credit_card_number == o.allow_credit_card_number &&
336
+ allow_credit_card_expiration_date == o.allow_credit_card_expiration_date &&
337
+ allow_credit_card_verification_code == o.allow_credit_card_verification_code &&
338
+ allow_bank_account_number == o.allow_bank_account_number &&
339
+ allow_iban == o.allow_iban &&
340
+ allow_health_insurance_number == o.allow_health_insurance_number &&
341
+ allow_bearer_token == o.allow_bearer_token &&
342
+ allow_http_cookie == o.allow_http_cookie &&
343
+ allow_private_keys == o.allow_private_keys &&
344
+ allow_credentials == o.allow_credentials &&
345
+ allow_deep_web_urls == o.allow_deep_web_urls &&
346
+ allow_source_code == o.allow_source_code &&
347
+ allow_ip_address == o.allow_ip_address &&
348
+ allow_mac_address == o.allow_mac_address &&
349
+ redaction_mode == o.redaction_mode &&
350
+ transcript_redaction_mode == o.transcript_redaction_mode &&
351
+ speech_recognition_mode == o.speech_recognition_mode
352
+ end
353
+
354
+ # @see the `==` method
355
+ # @param [Object] Object to be compared
356
+ def eql?(o)
357
+ self == o
358
+ end
359
+
360
+ # Calculates hash code according to all attributes.
361
+ # @return [Fixnum] Hash code
362
+ def hash
363
+ [input_file, language_code, allow_email_address, allow_phone_number, allow_street_address, allow_person_name, allow_birth_date, allow_passport_number, allow_drivers_license, allow_social_security_number, allow_taxpayer_id, allow_credit_card_number, allow_credit_card_expiration_date, allow_credit_card_verification_code, allow_bank_account_number, allow_iban, allow_health_insurance_number, allow_bearer_token, allow_http_cookie, allow_private_keys, allow_credentials, allow_deep_web_urls, allow_source_code, allow_ip_address, allow_mac_address, redaction_mode, transcript_redaction_mode, speech_recognition_mode].hash
364
+ end
365
+
366
+ # Builds the object from hash
367
+ # @param [Hash] attributes Model attributes in the form of hash
368
+ # @return [Object] Returns the model itself
369
+ def build_from_hash(attributes)
370
+ return nil unless attributes.is_a?(Hash)
371
+ self.class.swagger_types.each_pair do |key, type|
372
+ if type =~ /\AArray<(.*)>/i
373
+ # check to ensure the input is an array given that the attribute
374
+ # is documented as an array but the input is not
375
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
376
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
377
+ end
378
+ elsif !attributes[self.class.attribute_map[key]].nil?
379
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
380
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
381
+ end
382
+
383
+ self
384
+ end
385
+
386
+ # Deserializes the data based on type
387
+ # @param string type Data type
388
+ # @param string value Value to be deserialized
389
+ # @return [Object] Deserialized data
390
+ def _deserialize(type, value)
391
+ case type.to_sym
392
+ when :DateTime
393
+ DateTime.parse(value)
394
+ when :Date
395
+ Date.parse(value)
396
+ when :String
397
+ value.to_s
398
+ when :Integer
399
+ value.to_i
400
+ when :Float
401
+ value.to_f
402
+ when :BOOLEAN
403
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
404
+ true
405
+ else
406
+ false
407
+ end
408
+ when :Object
409
+ # generic object (usually a Hash), return directly
410
+ value
411
+ when /\AArray<(?<inner_type>.+)>\z/
412
+ inner_type = Regexp.last_match[:inner_type]
413
+ value.map { |v| _deserialize(inner_type, v) }
414
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
415
+ k_type = Regexp.last_match[:k_type]
416
+ v_type = Regexp.last_match[:v_type]
417
+ {}.tap do |hash|
418
+ value.each do |k, v|
419
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
420
+ end
421
+ end
422
+ else # model
423
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
424
+ temp_model.build_from_hash(value)
425
+ end
426
+ end
427
+
428
+ # Returns the string representation of the object
429
+ # @return [String] String presentation of the object
430
+ def to_s
431
+ to_hash.to_s
432
+ end
433
+
434
+ # to_body is an alias to to_hash (backward compatibility)
435
+ # @return [Hash] Returns the object in the form of hash
436
+ def to_body
437
+ to_hash
438
+ end
439
+
440
+ # Returns the object in the form of hash
441
+ # @return [Hash] Returns the object in the form of hash
442
+ def to_hash
443
+ hash = {}
444
+ self.class.attribute_map.each_pair do |attr, param|
445
+ value = self.send(attr)
446
+ next if value.nil?
447
+ hash[param] = _to_hash(value)
448
+ end
449
+ hash
450
+ end
451
+
452
+ # Outputs non-array value in the form of hash
453
+ # For object, use to_hash. Otherwise, just return the value
454
+ # @param [Object] value Any valid value
455
+ # @return [Hash] Returns the value in the form of hash
456
+ def _to_hash(value)
457
+ if value.is_a?(Array)
458
+ value.compact.map { |v| _to_hash(v) }
459
+ elsif value.is_a?(Hash)
460
+ {}.tap do |hash|
461
+ value.each { |k, v| hash[k] = _to_hash(v) }
462
+ end
463
+ elsif value.respond_to? :to_hash
464
+ value.to_hash
465
+ else
466
+ value
467
+ end
468
+ end
469
+
470
+ end
471
+ end