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,426 @@
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 text redaction with 23 PII detection results and redacted text.
17
+ class DlpRedactionResponse
18
+ # The redacted text with PII removed or replaced, or the original text if no disallowed PII was found.
19
+ attr_accessor :redacted_text
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 input contains email addresses.
25
+ attr_accessor :contains_email_address
26
+
27
+ # True if the input contains phone numbers.
28
+ attr_accessor :contains_phone_number
29
+
30
+ # True if the input contains street addresses.
31
+ attr_accessor :contains_street_address
32
+
33
+ # True if the input contains person names.
34
+ attr_accessor :contains_person_name
35
+
36
+ # True if the input contains birth dates.
37
+ attr_accessor :contains_birth_date
38
+
39
+ # True if the input contains passport numbers.
40
+ attr_accessor :contains_passport_number
41
+
42
+ # True if the input contains drivers license numbers.
43
+ attr_accessor :contains_drivers_license
44
+
45
+ # True if the input contains social security numbers.
46
+ attr_accessor :contains_social_security_number
47
+
48
+ # True if the input contains taxpayer IDs.
49
+ attr_accessor :contains_taxpayer_id
50
+
51
+ # True if the input contains credit card numbers.
52
+ attr_accessor :contains_credit_card_number
53
+
54
+ # True if the input contains credit card expiration dates.
55
+ attr_accessor :contains_credit_card_expiration_date
56
+
57
+ # True if the input contains credit card verification codes.
58
+ attr_accessor :contains_credit_card_verification_code
59
+
60
+ # True if the input contains bank account numbers.
61
+ attr_accessor :contains_bank_account_number
62
+
63
+ # True if the input contains IBANs.
64
+ attr_accessor :contains_iban
65
+
66
+ # True if the input contains health insurance numbers.
67
+ attr_accessor :contains_health_insurance_number
68
+
69
+ # True if the input contains bearer tokens.
70
+ attr_accessor :contains_bearer_token
71
+
72
+ # True if the input contains HTTP cookies.
73
+ attr_accessor :contains_http_cookie
74
+
75
+ # True if the input contains private keys.
76
+ attr_accessor :contains_private_keys
77
+
78
+ # True if the input contains credentials (usernames/passwords).
79
+ attr_accessor :contains_credentials
80
+
81
+ # True if the input contains deep web URLs (.onion).
82
+ attr_accessor :contains_deep_web_urls
83
+
84
+ # True if the input contains source code.
85
+ attr_accessor :contains_source_code
86
+
87
+ # True if the input contains IP addresses.
88
+ attr_accessor :contains_ip_address
89
+
90
+ # True if the input contains MAC addresses.
91
+ attr_accessor :contains_mac_address
92
+
93
+ # Attribute mapping from ruby-style variable name to JSON key.
94
+ def self.attribute_map
95
+ {
96
+ :'redacted_text' => :'RedactedText',
97
+ :'clean_result' => :'CleanResult',
98
+ :'contains_email_address' => :'ContainsEmailAddress',
99
+ :'contains_phone_number' => :'ContainsPhoneNumber',
100
+ :'contains_street_address' => :'ContainsStreetAddress',
101
+ :'contains_person_name' => :'ContainsPersonName',
102
+ :'contains_birth_date' => :'ContainsBirthDate',
103
+ :'contains_passport_number' => :'ContainsPassportNumber',
104
+ :'contains_drivers_license' => :'ContainsDriversLicense',
105
+ :'contains_social_security_number' => :'ContainsSocialSecurityNumber',
106
+ :'contains_taxpayer_id' => :'ContainsTaxpayerID',
107
+ :'contains_credit_card_number' => :'ContainsCreditCardNumber',
108
+ :'contains_credit_card_expiration_date' => :'ContainsCreditCardExpirationDate',
109
+ :'contains_credit_card_verification_code' => :'ContainsCreditCardVerificationCode',
110
+ :'contains_bank_account_number' => :'ContainsBankAccountNumber',
111
+ :'contains_iban' => :'ContainsIBAN',
112
+ :'contains_health_insurance_number' => :'ContainsHealthInsuranceNumber',
113
+ :'contains_bearer_token' => :'ContainsBearerToken',
114
+ :'contains_http_cookie' => :'ContainsHttpCookie',
115
+ :'contains_private_keys' => :'ContainsPrivateKeys',
116
+ :'contains_credentials' => :'ContainsCredentials',
117
+ :'contains_deep_web_urls' => :'ContainsDeepWebUrls',
118
+ :'contains_source_code' => :'ContainsSourceCode',
119
+ :'contains_ip_address' => :'ContainsIpAddress',
120
+ :'contains_mac_address' => :'ContainsMacAddress'
121
+ }
122
+ end
123
+
124
+ # Attribute type mapping.
125
+ def self.swagger_types
126
+ {
127
+ :'redacted_text' => :'String',
128
+ :'clean_result' => :'BOOLEAN',
129
+ :'contains_email_address' => :'BOOLEAN',
130
+ :'contains_phone_number' => :'BOOLEAN',
131
+ :'contains_street_address' => :'BOOLEAN',
132
+ :'contains_person_name' => :'BOOLEAN',
133
+ :'contains_birth_date' => :'BOOLEAN',
134
+ :'contains_passport_number' => :'BOOLEAN',
135
+ :'contains_drivers_license' => :'BOOLEAN',
136
+ :'contains_social_security_number' => :'BOOLEAN',
137
+ :'contains_taxpayer_id' => :'BOOLEAN',
138
+ :'contains_credit_card_number' => :'BOOLEAN',
139
+ :'contains_credit_card_expiration_date' => :'BOOLEAN',
140
+ :'contains_credit_card_verification_code' => :'BOOLEAN',
141
+ :'contains_bank_account_number' => :'BOOLEAN',
142
+ :'contains_iban' => :'BOOLEAN',
143
+ :'contains_health_insurance_number' => :'BOOLEAN',
144
+ :'contains_bearer_token' => :'BOOLEAN',
145
+ :'contains_http_cookie' => :'BOOLEAN',
146
+ :'contains_private_keys' => :'BOOLEAN',
147
+ :'contains_credentials' => :'BOOLEAN',
148
+ :'contains_deep_web_urls' => :'BOOLEAN',
149
+ :'contains_source_code' => :'BOOLEAN',
150
+ :'contains_ip_address' => :'BOOLEAN',
151
+ :'contains_mac_address' => :'BOOLEAN'
152
+ }
153
+ end
154
+
155
+ # Initializes the object
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ def initialize(attributes = {})
158
+ return unless attributes.is_a?(Hash)
159
+
160
+ # convert string to symbol for hash key
161
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
162
+
163
+ if attributes.has_key?(:'RedactedText')
164
+ self.redacted_text = attributes[:'RedactedText']
165
+ end
166
+
167
+ if attributes.has_key?(:'CleanResult')
168
+ self.clean_result = attributes[:'CleanResult']
169
+ end
170
+
171
+ if attributes.has_key?(:'ContainsEmailAddress')
172
+ self.contains_email_address = attributes[:'ContainsEmailAddress']
173
+ end
174
+
175
+ if attributes.has_key?(:'ContainsPhoneNumber')
176
+ self.contains_phone_number = attributes[:'ContainsPhoneNumber']
177
+ end
178
+
179
+ if attributes.has_key?(:'ContainsStreetAddress')
180
+ self.contains_street_address = attributes[:'ContainsStreetAddress']
181
+ end
182
+
183
+ if attributes.has_key?(:'ContainsPersonName')
184
+ self.contains_person_name = attributes[:'ContainsPersonName']
185
+ end
186
+
187
+ if attributes.has_key?(:'ContainsBirthDate')
188
+ self.contains_birth_date = attributes[:'ContainsBirthDate']
189
+ end
190
+
191
+ if attributes.has_key?(:'ContainsPassportNumber')
192
+ self.contains_passport_number = attributes[:'ContainsPassportNumber']
193
+ end
194
+
195
+ if attributes.has_key?(:'ContainsDriversLicense')
196
+ self.contains_drivers_license = attributes[:'ContainsDriversLicense']
197
+ end
198
+
199
+ if attributes.has_key?(:'ContainsSocialSecurityNumber')
200
+ self.contains_social_security_number = attributes[:'ContainsSocialSecurityNumber']
201
+ end
202
+
203
+ if attributes.has_key?(:'ContainsTaxpayerID')
204
+ self.contains_taxpayer_id = attributes[:'ContainsTaxpayerID']
205
+ end
206
+
207
+ if attributes.has_key?(:'ContainsCreditCardNumber')
208
+ self.contains_credit_card_number = attributes[:'ContainsCreditCardNumber']
209
+ end
210
+
211
+ if attributes.has_key?(:'ContainsCreditCardExpirationDate')
212
+ self.contains_credit_card_expiration_date = attributes[:'ContainsCreditCardExpirationDate']
213
+ end
214
+
215
+ if attributes.has_key?(:'ContainsCreditCardVerificationCode')
216
+ self.contains_credit_card_verification_code = attributes[:'ContainsCreditCardVerificationCode']
217
+ end
218
+
219
+ if attributes.has_key?(:'ContainsBankAccountNumber')
220
+ self.contains_bank_account_number = attributes[:'ContainsBankAccountNumber']
221
+ end
222
+
223
+ if attributes.has_key?(:'ContainsIBAN')
224
+ self.contains_iban = attributes[:'ContainsIBAN']
225
+ end
226
+
227
+ if attributes.has_key?(:'ContainsHealthInsuranceNumber')
228
+ self.contains_health_insurance_number = attributes[:'ContainsHealthInsuranceNumber']
229
+ end
230
+
231
+ if attributes.has_key?(:'ContainsBearerToken')
232
+ self.contains_bearer_token = attributes[:'ContainsBearerToken']
233
+ end
234
+
235
+ if attributes.has_key?(:'ContainsHttpCookie')
236
+ self.contains_http_cookie = attributes[:'ContainsHttpCookie']
237
+ end
238
+
239
+ if attributes.has_key?(:'ContainsPrivateKeys')
240
+ self.contains_private_keys = attributes[:'ContainsPrivateKeys']
241
+ end
242
+
243
+ if attributes.has_key?(:'ContainsCredentials')
244
+ self.contains_credentials = attributes[:'ContainsCredentials']
245
+ end
246
+
247
+ if attributes.has_key?(:'ContainsDeepWebUrls')
248
+ self.contains_deep_web_urls = attributes[:'ContainsDeepWebUrls']
249
+ end
250
+
251
+ if attributes.has_key?(:'ContainsSourceCode')
252
+ self.contains_source_code = attributes[:'ContainsSourceCode']
253
+ end
254
+
255
+ if attributes.has_key?(:'ContainsIpAddress')
256
+ self.contains_ip_address = attributes[:'ContainsIpAddress']
257
+ end
258
+
259
+ if attributes.has_key?(:'ContainsMacAddress')
260
+ self.contains_mac_address = attributes[:'ContainsMacAddress']
261
+ end
262
+ end
263
+
264
+ # Show invalid properties with the reasons. Usually used together with valid?
265
+ # @return Array for valid properties with the reasons
266
+ def list_invalid_properties
267
+ invalid_properties = Array.new
268
+ invalid_properties
269
+ end
270
+
271
+ # Check to see if the all the properties in the model are valid
272
+ # @return true if the model is valid
273
+ def valid?
274
+ true
275
+ end
276
+
277
+ # Checks equality by comparing each attribute.
278
+ # @param [Object] Object to be compared
279
+ def ==(o)
280
+ return true if self.equal?(o)
281
+ self.class == o.class &&
282
+ redacted_text == o.redacted_text &&
283
+ clean_result == o.clean_result &&
284
+ contains_email_address == o.contains_email_address &&
285
+ contains_phone_number == o.contains_phone_number &&
286
+ contains_street_address == o.contains_street_address &&
287
+ contains_person_name == o.contains_person_name &&
288
+ contains_birth_date == o.contains_birth_date &&
289
+ contains_passport_number == o.contains_passport_number &&
290
+ contains_drivers_license == o.contains_drivers_license &&
291
+ contains_social_security_number == o.contains_social_security_number &&
292
+ contains_taxpayer_id == o.contains_taxpayer_id &&
293
+ contains_credit_card_number == o.contains_credit_card_number &&
294
+ contains_credit_card_expiration_date == o.contains_credit_card_expiration_date &&
295
+ contains_credit_card_verification_code == o.contains_credit_card_verification_code &&
296
+ contains_bank_account_number == o.contains_bank_account_number &&
297
+ contains_iban == o.contains_iban &&
298
+ contains_health_insurance_number == o.contains_health_insurance_number &&
299
+ contains_bearer_token == o.contains_bearer_token &&
300
+ contains_http_cookie == o.contains_http_cookie &&
301
+ contains_private_keys == o.contains_private_keys &&
302
+ contains_credentials == o.contains_credentials &&
303
+ contains_deep_web_urls == o.contains_deep_web_urls &&
304
+ contains_source_code == o.contains_source_code &&
305
+ contains_ip_address == o.contains_ip_address &&
306
+ contains_mac_address == o.contains_mac_address
307
+ end
308
+
309
+ # @see the `==` method
310
+ # @param [Object] Object to be compared
311
+ def eql?(o)
312
+ self == o
313
+ end
314
+
315
+ # Calculates hash code according to all attributes.
316
+ # @return [Fixnum] Hash code
317
+ def hash
318
+ [redacted_text, 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
319
+ end
320
+
321
+ # Builds the object from hash
322
+ # @param [Hash] attributes Model attributes in the form of hash
323
+ # @return [Object] Returns the model itself
324
+ def build_from_hash(attributes)
325
+ return nil unless attributes.is_a?(Hash)
326
+ self.class.swagger_types.each_pair do |key, type|
327
+ if type =~ /\AArray<(.*)>/i
328
+ # check to ensure the input is an array given that the attribute
329
+ # is documented as an array but the input is not
330
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
331
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
332
+ end
333
+ elsif !attributes[self.class.attribute_map[key]].nil?
334
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
335
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
336
+ end
337
+
338
+ self
339
+ end
340
+
341
+ # Deserializes the data based on type
342
+ # @param string type Data type
343
+ # @param string value Value to be deserialized
344
+ # @return [Object] Deserialized data
345
+ def _deserialize(type, value)
346
+ case type.to_sym
347
+ when :DateTime
348
+ DateTime.parse(value)
349
+ when :Date
350
+ Date.parse(value)
351
+ when :String
352
+ value.to_s
353
+ when :Integer
354
+ value.to_i
355
+ when :Float
356
+ value.to_f
357
+ when :BOOLEAN
358
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
359
+ true
360
+ else
361
+ false
362
+ end
363
+ when :Object
364
+ # generic object (usually a Hash), return directly
365
+ value
366
+ when /\AArray<(?<inner_type>.+)>\z/
367
+ inner_type = Regexp.last_match[:inner_type]
368
+ value.map { |v| _deserialize(inner_type, v) }
369
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
370
+ k_type = Regexp.last_match[:k_type]
371
+ v_type = Regexp.last_match[:v_type]
372
+ {}.tap do |hash|
373
+ value.each do |k, v|
374
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
375
+ end
376
+ end
377
+ else # model
378
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
379
+ temp_model.build_from_hash(value)
380
+ end
381
+ end
382
+
383
+ # Returns the string representation of the object
384
+ # @return [String] String presentation of the object
385
+ def to_s
386
+ to_hash.to_s
387
+ end
388
+
389
+ # to_body is an alias to to_hash (backward compatibility)
390
+ # @return [Hash] Returns the object in the form of hash
391
+ def to_body
392
+ to_hash
393
+ end
394
+
395
+ # Returns the object in the form of hash
396
+ # @return [Hash] Returns the object in the form of hash
397
+ def to_hash
398
+ hash = {}
399
+ self.class.attribute_map.each_pair do |attr, param|
400
+ value = self.send(attr)
401
+ next if value.nil?
402
+ hash[param] = _to_hash(value)
403
+ end
404
+ hash
405
+ end
406
+
407
+ # Outputs non-array value in the form of hash
408
+ # For object, use to_hash. Otherwise, just return the value
409
+ # @param [Object] value Any valid value
410
+ # @return [Hash] Returns the value in the form of hash
411
+ def _to_hash(value)
412
+ if value.is_a?(Array)
413
+ value.compact.map { |v| _to_hash(v) }
414
+ elsif value.is_a?(Hash)
415
+ {}.tap do |hash|
416
+ value.each { |k, v| hash[k] = _to_hash(v) }
417
+ end
418
+ elsif value.respond_to? :to_hash
419
+ value.to_hash
420
+ else
421
+ value
422
+ end
423
+ end
424
+
425
+ end
426
+ end
@@ -0,0 +1,186 @@
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
+ # Information about a redacted page.
17
+ class RedactedPageInfo
18
+ # 1-based page number that was redacted.
19
+ attr_accessor :page_number
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'page_number' => :'PageNumber'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'page_number' => :'Integer'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
42
+
43
+ if attributes.has_key?(:'PageNumber')
44
+ self.page_number = attributes[:'PageNumber']
45
+ end
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properties with the reasons
50
+ def list_invalid_properties
51
+ invalid_properties = Array.new
52
+ invalid_properties
53
+ end
54
+
55
+ # Check to see if the all the properties in the model are valid
56
+ # @return true if the model is valid
57
+ def valid?
58
+ true
59
+ end
60
+
61
+ # Checks equality by comparing each attribute.
62
+ # @param [Object] Object to be compared
63
+ def ==(o)
64
+ return true if self.equal?(o)
65
+ self.class == o.class &&
66
+ page_number == o.page_number
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [page_number].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+ self.class.swagger_types.each_pair do |key, type|
87
+ if type =~ /\AArray<(.*)>/i
88
+ # check to ensure the input is an array given that the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
92
+ end
93
+ elsif !attributes[self.class.attribute_map[key]].nil?
94
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
95
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
96
+ end
97
+
98
+ self
99
+ end
100
+
101
+ # Deserializes the data based on type
102
+ # @param string type Data type
103
+ # @param string value Value to be deserialized
104
+ # @return [Object] Deserialized data
105
+ def _deserialize(type, value)
106
+ case type.to_sym
107
+ when :DateTime
108
+ DateTime.parse(value)
109
+ when :Date
110
+ Date.parse(value)
111
+ when :String
112
+ value.to_s
113
+ when :Integer
114
+ value.to_i
115
+ when :Float
116
+ value.to_f
117
+ when :BOOLEAN
118
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
119
+ true
120
+ else
121
+ false
122
+ end
123
+ when :Object
124
+ # generic object (usually a Hash), return directly
125
+ value
126
+ when /\AArray<(?<inner_type>.+)>\z/
127
+ inner_type = Regexp.last_match[:inner_type]
128
+ value.map { |v| _deserialize(inner_type, v) }
129
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
130
+ k_type = Regexp.last_match[:k_type]
131
+ v_type = Regexp.last_match[:v_type]
132
+ {}.tap do |hash|
133
+ value.each do |k, v|
134
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
135
+ end
136
+ end
137
+ else # model
138
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
139
+ temp_model.build_from_hash(value)
140
+ end
141
+ end
142
+
143
+ # Returns the string representation of the object
144
+ # @return [String] String presentation of the object
145
+ def to_s
146
+ to_hash.to_s
147
+ end
148
+
149
+ # to_body is an alias to to_hash (backward compatibility)
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_body
152
+ to_hash
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ next if value.nil?
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map { |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+
185
+ end
186
+ end
@@ -0,0 +1,15 @@
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
+ module CloudmersiveDlpApiClient
14
+ VERSION = '2.2.0'
15
+ end
@@ -0,0 +1,56 @@
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
+ # Common files
14
+ require 'cloudmersive-dlp-api-client/api_client'
15
+ require 'cloudmersive-dlp-api-client/api_error'
16
+ require 'cloudmersive-dlp-api-client/version'
17
+ require 'cloudmersive-dlp-api-client/configuration'
18
+
19
+ # Models
20
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_detection_request'
21
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_detection_response'
22
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_document_detection_request'
23
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_request'
24
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_response'
25
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_redaction_request'
26
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_redaction_response'
27
+ require 'cloudmersive-dlp-api-client/models/dlp_detection_request'
28
+ require 'cloudmersive-dlp-api-client/models/dlp_detection_response'
29
+ require 'cloudmersive-dlp-api-client/models/dlp_document_detection_request'
30
+ require 'cloudmersive-dlp-api-client/models/dlp_document_redaction_request'
31
+ require 'cloudmersive-dlp-api-client/models/dlp_document_redaction_response'
32
+ require 'cloudmersive-dlp-api-client/models/dlp_redaction_request'
33
+ require 'cloudmersive-dlp-api-client/models/dlp_redaction_response'
34
+ require 'cloudmersive-dlp-api-client/models/redacted_page_info'
35
+
36
+ # APIs
37
+ require 'cloudmersive-dlp-api-client/api/detect_api'
38
+ require 'cloudmersive-dlp-api-client/api/redact_api'
39
+
40
+ module CloudmersiveDlpApiClient
41
+ class << self
42
+ # Customize default settings for the SDK using block.
43
+ # CloudmersiveDlpApiClient.configure do |config|
44
+ # config.username = "xxx"
45
+ # config.password = "xxx"
46
+ # end
47
+ # If no block given, return the default Configuration object.
48
+ def configure
49
+ if block_given?
50
+ yield(Configuration.default)
51
+ else
52
+ Configuration.default
53
+ end
54
+ end
55
+ end
56
+ end