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.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +124 -0
- data/Rakefile +8 -0
- data/cloudmersive-dlp-api-client.gemspec +45 -0
- data/docs/DetectApi.md +232 -0
- data/docs/DlpAdvancedDetectionRequest.md +43 -0
- data/docs/DlpAdvancedDetectionResponse.md +44 -0
- data/docs/DlpAdvancedDocumentDetectionRequest.md +46 -0
- data/docs/DlpAdvancedDocumentRedactionRequest.md +47 -0
- data/docs/DlpAdvancedDocumentRedactionResponse.md +46 -0
- data/docs/DlpAdvancedRedactionRequest.md +44 -0
- data/docs/DlpAdvancedRedactionResponse.md +44 -0
- data/docs/DlpDetectionRequest.md +31 -0
- data/docs/DlpDetectionResponse.md +31 -0
- data/docs/DlpDocumentDetectionRequest.md +33 -0
- data/docs/DlpDocumentRedactionRequest.md +34 -0
- data/docs/DlpDocumentRedactionResponse.md +33 -0
- data/docs/DlpRedactionRequest.md +32 -0
- data/docs/DlpRedactionResponse.md +32 -0
- data/docs/RedactApi.md +232 -0
- data/docs/RedactedPageInfo.md +8 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-dlp-api-client/api/detect_api.rb +223 -0
- data/lib/cloudmersive-dlp-api-client/api/redact_api.rb +223 -0
- data/lib/cloudmersive-dlp-api-client/api_client.rb +391 -0
- data/lib/cloudmersive-dlp-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-dlp-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_detection_request.rb +536 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_detection_response.rb +546 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_detection_request.rb +581 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_request.rb +591 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_response.rb +583 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_redaction_request.rb +546 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_advanced_redaction_response.rb +546 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_detection_request.rb +416 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_detection_response.rb +416 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_document_detection_request.rb +451 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_document_redaction_request.rb +461 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_document_redaction_response.rb +453 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_redaction_request.rb +426 -0
- data/lib/cloudmersive-dlp-api-client/models/dlp_redaction_response.rb +426 -0
- data/lib/cloudmersive-dlp-api-client/models/redacted_page_info.rb +186 -0
- data/lib/cloudmersive-dlp-api-client/version.rb +15 -0
- data/lib/cloudmersive-dlp-api-client.rb +56 -0
- data/spec/api/detect_api_spec.rb +83 -0
- data/spec/api/redact_api_spec.rb +83 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/dlp_advanced_detection_request_spec.rb +251 -0
- data/spec/models/dlp_advanced_detection_response_spec.rb +257 -0
- data/spec/models/dlp_advanced_document_detection_request_spec.rb +269 -0
- data/spec/models/dlp_advanced_document_redaction_request_spec.rb +275 -0
- data/spec/models/dlp_advanced_document_redaction_response_spec.rb +269 -0
- data/spec/models/dlp_advanced_redaction_request_spec.rb +257 -0
- data/spec/models/dlp_advanced_redaction_response_spec.rb +257 -0
- data/spec/models/dlp_detection_request_spec.rb +179 -0
- data/spec/models/dlp_detection_response_spec.rb +179 -0
- data/spec/models/dlp_document_detection_request_spec.rb +191 -0
- data/spec/models/dlp_document_redaction_request_spec.rb +197 -0
- data/spec/models/dlp_document_redaction_response_spec.rb +191 -0
- data/spec/models/dlp_redaction_request_spec.rb +185 -0
- data/spec/models/dlp_redaction_response_spec.rb +185 -0
- data/spec/models/redacted_page_info_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +290 -0
|
@@ -0,0 +1,453 @@
|
|
|
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 document redaction with 23 PII detection results and redacted document.
|
|
17
|
+
class DlpDocumentRedactionResponse
|
|
18
|
+
# The redacted document as a rasterized PDF with PII regions blurred, 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
|
+
# List of pages that were redacted (had PII regions blurred).
|
|
94
|
+
attr_accessor :pages_redacted
|
|
95
|
+
|
|
96
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
97
|
+
def self.attribute_map
|
|
98
|
+
{
|
|
99
|
+
:'redacted_document' => :'RedactedDocument',
|
|
100
|
+
:'clean_result' => :'CleanResult',
|
|
101
|
+
:'contains_email_address' => :'ContainsEmailAddress',
|
|
102
|
+
:'contains_phone_number' => :'ContainsPhoneNumber',
|
|
103
|
+
:'contains_street_address' => :'ContainsStreetAddress',
|
|
104
|
+
:'contains_person_name' => :'ContainsPersonName',
|
|
105
|
+
:'contains_birth_date' => :'ContainsBirthDate',
|
|
106
|
+
:'contains_passport_number' => :'ContainsPassportNumber',
|
|
107
|
+
:'contains_drivers_license' => :'ContainsDriversLicense',
|
|
108
|
+
:'contains_social_security_number' => :'ContainsSocialSecurityNumber',
|
|
109
|
+
:'contains_taxpayer_id' => :'ContainsTaxpayerID',
|
|
110
|
+
:'contains_credit_card_number' => :'ContainsCreditCardNumber',
|
|
111
|
+
:'contains_credit_card_expiration_date' => :'ContainsCreditCardExpirationDate',
|
|
112
|
+
:'contains_credit_card_verification_code' => :'ContainsCreditCardVerificationCode',
|
|
113
|
+
:'contains_bank_account_number' => :'ContainsBankAccountNumber',
|
|
114
|
+
:'contains_iban' => :'ContainsIBAN',
|
|
115
|
+
:'contains_health_insurance_number' => :'ContainsHealthInsuranceNumber',
|
|
116
|
+
:'contains_bearer_token' => :'ContainsBearerToken',
|
|
117
|
+
:'contains_http_cookie' => :'ContainsHttpCookie',
|
|
118
|
+
:'contains_private_keys' => :'ContainsPrivateKeys',
|
|
119
|
+
:'contains_credentials' => :'ContainsCredentials',
|
|
120
|
+
:'contains_deep_web_urls' => :'ContainsDeepWebUrls',
|
|
121
|
+
:'contains_source_code' => :'ContainsSourceCode',
|
|
122
|
+
:'contains_ip_address' => :'ContainsIpAddress',
|
|
123
|
+
:'contains_mac_address' => :'ContainsMacAddress',
|
|
124
|
+
:'pages_redacted' => :'PagesRedacted'
|
|
125
|
+
}
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Attribute type mapping.
|
|
129
|
+
def self.swagger_types
|
|
130
|
+
{
|
|
131
|
+
:'redacted_document' => :'String',
|
|
132
|
+
:'clean_result' => :'BOOLEAN',
|
|
133
|
+
:'contains_email_address' => :'BOOLEAN',
|
|
134
|
+
:'contains_phone_number' => :'BOOLEAN',
|
|
135
|
+
:'contains_street_address' => :'BOOLEAN',
|
|
136
|
+
:'contains_person_name' => :'BOOLEAN',
|
|
137
|
+
:'contains_birth_date' => :'BOOLEAN',
|
|
138
|
+
:'contains_passport_number' => :'BOOLEAN',
|
|
139
|
+
:'contains_drivers_license' => :'BOOLEAN',
|
|
140
|
+
:'contains_social_security_number' => :'BOOLEAN',
|
|
141
|
+
:'contains_taxpayer_id' => :'BOOLEAN',
|
|
142
|
+
:'contains_credit_card_number' => :'BOOLEAN',
|
|
143
|
+
:'contains_credit_card_expiration_date' => :'BOOLEAN',
|
|
144
|
+
:'contains_credit_card_verification_code' => :'BOOLEAN',
|
|
145
|
+
:'contains_bank_account_number' => :'BOOLEAN',
|
|
146
|
+
:'contains_iban' => :'BOOLEAN',
|
|
147
|
+
:'contains_health_insurance_number' => :'BOOLEAN',
|
|
148
|
+
:'contains_bearer_token' => :'BOOLEAN',
|
|
149
|
+
:'contains_http_cookie' => :'BOOLEAN',
|
|
150
|
+
:'contains_private_keys' => :'BOOLEAN',
|
|
151
|
+
:'contains_credentials' => :'BOOLEAN',
|
|
152
|
+
:'contains_deep_web_urls' => :'BOOLEAN',
|
|
153
|
+
:'contains_source_code' => :'BOOLEAN',
|
|
154
|
+
:'contains_ip_address' => :'BOOLEAN',
|
|
155
|
+
:'contains_mac_address' => :'BOOLEAN',
|
|
156
|
+
:'pages_redacted' => :'Array<RedactedPageInfo>'
|
|
157
|
+
}
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Initializes the object
|
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
162
|
+
def initialize(attributes = {})
|
|
163
|
+
return unless attributes.is_a?(Hash)
|
|
164
|
+
|
|
165
|
+
# convert string to symbol for hash key
|
|
166
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
167
|
+
|
|
168
|
+
if attributes.has_key?(:'RedactedDocument')
|
|
169
|
+
self.redacted_document = attributes[:'RedactedDocument']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.has_key?(:'CleanResult')
|
|
173
|
+
self.clean_result = attributes[:'CleanResult']
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.has_key?(:'ContainsEmailAddress')
|
|
177
|
+
self.contains_email_address = attributes[:'ContainsEmailAddress']
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if attributes.has_key?(:'ContainsPhoneNumber')
|
|
181
|
+
self.contains_phone_number = attributes[:'ContainsPhoneNumber']
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if attributes.has_key?(:'ContainsStreetAddress')
|
|
185
|
+
self.contains_street_address = attributes[:'ContainsStreetAddress']
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if attributes.has_key?(:'ContainsPersonName')
|
|
189
|
+
self.contains_person_name = attributes[:'ContainsPersonName']
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if attributes.has_key?(:'ContainsBirthDate')
|
|
193
|
+
self.contains_birth_date = attributes[:'ContainsBirthDate']
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if attributes.has_key?(:'ContainsPassportNumber')
|
|
197
|
+
self.contains_passport_number = attributes[:'ContainsPassportNumber']
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.has_key?(:'ContainsDriversLicense')
|
|
201
|
+
self.contains_drivers_license = attributes[:'ContainsDriversLicense']
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if attributes.has_key?(:'ContainsSocialSecurityNumber')
|
|
205
|
+
self.contains_social_security_number = attributes[:'ContainsSocialSecurityNumber']
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if attributes.has_key?(:'ContainsTaxpayerID')
|
|
209
|
+
self.contains_taxpayer_id = attributes[:'ContainsTaxpayerID']
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if attributes.has_key?(:'ContainsCreditCardNumber')
|
|
213
|
+
self.contains_credit_card_number = attributes[:'ContainsCreditCardNumber']
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if attributes.has_key?(:'ContainsCreditCardExpirationDate')
|
|
217
|
+
self.contains_credit_card_expiration_date = attributes[:'ContainsCreditCardExpirationDate']
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
if attributes.has_key?(:'ContainsCreditCardVerificationCode')
|
|
221
|
+
self.contains_credit_card_verification_code = attributes[:'ContainsCreditCardVerificationCode']
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if attributes.has_key?(:'ContainsBankAccountNumber')
|
|
225
|
+
self.contains_bank_account_number = attributes[:'ContainsBankAccountNumber']
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if attributes.has_key?(:'ContainsIBAN')
|
|
229
|
+
self.contains_iban = attributes[:'ContainsIBAN']
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if attributes.has_key?(:'ContainsHealthInsuranceNumber')
|
|
233
|
+
self.contains_health_insurance_number = attributes[:'ContainsHealthInsuranceNumber']
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if attributes.has_key?(:'ContainsBearerToken')
|
|
237
|
+
self.contains_bearer_token = attributes[:'ContainsBearerToken']
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if attributes.has_key?(:'ContainsHttpCookie')
|
|
241
|
+
self.contains_http_cookie = attributes[:'ContainsHttpCookie']
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
if attributes.has_key?(:'ContainsPrivateKeys')
|
|
245
|
+
self.contains_private_keys = attributes[:'ContainsPrivateKeys']
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if attributes.has_key?(:'ContainsCredentials')
|
|
249
|
+
self.contains_credentials = attributes[:'ContainsCredentials']
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
if attributes.has_key?(:'ContainsDeepWebUrls')
|
|
253
|
+
self.contains_deep_web_urls = attributes[:'ContainsDeepWebUrls']
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
if attributes.has_key?(:'ContainsSourceCode')
|
|
257
|
+
self.contains_source_code = attributes[:'ContainsSourceCode']
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if attributes.has_key?(:'ContainsIpAddress')
|
|
261
|
+
self.contains_ip_address = attributes[:'ContainsIpAddress']
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
if attributes.has_key?(:'ContainsMacAddress')
|
|
265
|
+
self.contains_mac_address = attributes[:'ContainsMacAddress']
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
if attributes.has_key?(:'PagesRedacted')
|
|
269
|
+
if (value = attributes[:'PagesRedacted']).is_a?(Array)
|
|
270
|
+
self.pages_redacted = value
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
276
|
+
# @return Array for valid properties with the reasons
|
|
277
|
+
def list_invalid_properties
|
|
278
|
+
invalid_properties = Array.new
|
|
279
|
+
if !@redacted_document.nil? && @redacted_document !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
|
280
|
+
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}=)?$/.')
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
invalid_properties
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Check to see if the all the properties in the model are valid
|
|
287
|
+
# @return true if the model is valid
|
|
288
|
+
def valid?
|
|
289
|
+
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}=)?$/)
|
|
290
|
+
true
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Custom attribute writer method with validation
|
|
294
|
+
# @param [Object] redacted_document Value to be assigned
|
|
295
|
+
def redacted_document=(redacted_document)
|
|
296
|
+
if !redacted_document.nil? && redacted_document !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
|
297
|
+
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}=)?$/.'
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
@redacted_document = redacted_document
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Checks equality by comparing each attribute.
|
|
304
|
+
# @param [Object] Object to be compared
|
|
305
|
+
def ==(o)
|
|
306
|
+
return true if self.equal?(o)
|
|
307
|
+
self.class == o.class &&
|
|
308
|
+
redacted_document == o.redacted_document &&
|
|
309
|
+
clean_result == o.clean_result &&
|
|
310
|
+
contains_email_address == o.contains_email_address &&
|
|
311
|
+
contains_phone_number == o.contains_phone_number &&
|
|
312
|
+
contains_street_address == o.contains_street_address &&
|
|
313
|
+
contains_person_name == o.contains_person_name &&
|
|
314
|
+
contains_birth_date == o.contains_birth_date &&
|
|
315
|
+
contains_passport_number == o.contains_passport_number &&
|
|
316
|
+
contains_drivers_license == o.contains_drivers_license &&
|
|
317
|
+
contains_social_security_number == o.contains_social_security_number &&
|
|
318
|
+
contains_taxpayer_id == o.contains_taxpayer_id &&
|
|
319
|
+
contains_credit_card_number == o.contains_credit_card_number &&
|
|
320
|
+
contains_credit_card_expiration_date == o.contains_credit_card_expiration_date &&
|
|
321
|
+
contains_credit_card_verification_code == o.contains_credit_card_verification_code &&
|
|
322
|
+
contains_bank_account_number == o.contains_bank_account_number &&
|
|
323
|
+
contains_iban == o.contains_iban &&
|
|
324
|
+
contains_health_insurance_number == o.contains_health_insurance_number &&
|
|
325
|
+
contains_bearer_token == o.contains_bearer_token &&
|
|
326
|
+
contains_http_cookie == o.contains_http_cookie &&
|
|
327
|
+
contains_private_keys == o.contains_private_keys &&
|
|
328
|
+
contains_credentials == o.contains_credentials &&
|
|
329
|
+
contains_deep_web_urls == o.contains_deep_web_urls &&
|
|
330
|
+
contains_source_code == o.contains_source_code &&
|
|
331
|
+
contains_ip_address == o.contains_ip_address &&
|
|
332
|
+
contains_mac_address == o.contains_mac_address &&
|
|
333
|
+
pages_redacted == o.pages_redacted
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# @see the `==` method
|
|
337
|
+
# @param [Object] Object to be compared
|
|
338
|
+
def eql?(o)
|
|
339
|
+
self == o
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
# Calculates hash code according to all attributes.
|
|
343
|
+
# @return [Fixnum] Hash code
|
|
344
|
+
def hash
|
|
345
|
+
[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, pages_redacted].hash
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# Builds the object from hash
|
|
349
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
350
|
+
# @return [Object] Returns the model itself
|
|
351
|
+
def build_from_hash(attributes)
|
|
352
|
+
return nil unless attributes.is_a?(Hash)
|
|
353
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
354
|
+
if type =~ /\AArray<(.*)>/i
|
|
355
|
+
# check to ensure the input is an array given that the attribute
|
|
356
|
+
# is documented as an array but the input is not
|
|
357
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
358
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
359
|
+
end
|
|
360
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
361
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
362
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
self
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Deserializes the data based on type
|
|
369
|
+
# @param string type Data type
|
|
370
|
+
# @param string value Value to be deserialized
|
|
371
|
+
# @return [Object] Deserialized data
|
|
372
|
+
def _deserialize(type, value)
|
|
373
|
+
case type.to_sym
|
|
374
|
+
when :DateTime
|
|
375
|
+
DateTime.parse(value)
|
|
376
|
+
when :Date
|
|
377
|
+
Date.parse(value)
|
|
378
|
+
when :String
|
|
379
|
+
value.to_s
|
|
380
|
+
when :Integer
|
|
381
|
+
value.to_i
|
|
382
|
+
when :Float
|
|
383
|
+
value.to_f
|
|
384
|
+
when :BOOLEAN
|
|
385
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
386
|
+
true
|
|
387
|
+
else
|
|
388
|
+
false
|
|
389
|
+
end
|
|
390
|
+
when :Object
|
|
391
|
+
# generic object (usually a Hash), return directly
|
|
392
|
+
value
|
|
393
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
394
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
395
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
396
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
397
|
+
k_type = Regexp.last_match[:k_type]
|
|
398
|
+
v_type = Regexp.last_match[:v_type]
|
|
399
|
+
{}.tap do |hash|
|
|
400
|
+
value.each do |k, v|
|
|
401
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
else # model
|
|
405
|
+
temp_model = CloudmersiveDlpApiClient.const_get(type).new
|
|
406
|
+
temp_model.build_from_hash(value)
|
|
407
|
+
end
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
# Returns the string representation of the object
|
|
411
|
+
# @return [String] String presentation of the object
|
|
412
|
+
def to_s
|
|
413
|
+
to_hash.to_s
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
417
|
+
# @return [Hash] Returns the object in the form of hash
|
|
418
|
+
def to_body
|
|
419
|
+
to_hash
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
# Returns the object in the form of hash
|
|
423
|
+
# @return [Hash] Returns the object in the form of hash
|
|
424
|
+
def to_hash
|
|
425
|
+
hash = {}
|
|
426
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
427
|
+
value = self.send(attr)
|
|
428
|
+
next if value.nil?
|
|
429
|
+
hash[param] = _to_hash(value)
|
|
430
|
+
end
|
|
431
|
+
hash
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
# Outputs non-array value in the form of hash
|
|
435
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
436
|
+
# @param [Object] value Any valid value
|
|
437
|
+
# @return [Hash] Returns the value in the form of hash
|
|
438
|
+
def _to_hash(value)
|
|
439
|
+
if value.is_a?(Array)
|
|
440
|
+
value.compact.map { |v| _to_hash(v) }
|
|
441
|
+
elsif value.is_a?(Hash)
|
|
442
|
+
{}.tap do |hash|
|
|
443
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
444
|
+
end
|
|
445
|
+
elsif value.respond_to? :to_hash
|
|
446
|
+
value.to_hash
|
|
447
|
+
else
|
|
448
|
+
value
|
|
449
|
+
end
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
end
|
|
453
|
+
end
|