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,252 @@
1
+ =begin
2
+ #dlpapi
3
+
4
+ #Easily and directly scan and detect sensitive data (PII) in input text.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveDlpApiClient
16
+ # Result of performing a DLP batch job operation
17
+ class DlpBatchJobStatusResult
18
+ # True if the operation to check the status of the job was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Returns the job status of the Async Job, if applicable. Possible states are STARTED and COMPLETED
22
+ attr_accessor :async_job_status
23
+
24
+ # Job ID
25
+ attr_accessor :async_job_id
26
+
27
+ attr_accessor :detect_audio_result
28
+
29
+ attr_accessor :detect_audio_advanced_result
30
+
31
+ attr_accessor :redact_audio_result
32
+
33
+ attr_accessor :redact_audio_advanced_result
34
+
35
+ # Error message (if any)
36
+ attr_accessor :error_message
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'successful' => :'Successful',
42
+ :'async_job_status' => :'AsyncJobStatus',
43
+ :'async_job_id' => :'AsyncJobID',
44
+ :'detect_audio_result' => :'DetectAudioResult',
45
+ :'detect_audio_advanced_result' => :'DetectAudioAdvancedResult',
46
+ :'redact_audio_result' => :'RedactAudioResult',
47
+ :'redact_audio_advanced_result' => :'RedactAudioAdvancedResult',
48
+ :'error_message' => :'ErrorMessage'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'successful' => :'BOOLEAN',
56
+ :'async_job_status' => :'String',
57
+ :'async_job_id' => :'String',
58
+ :'detect_audio_result' => :'DlpAudioDetectionResponse',
59
+ :'detect_audio_advanced_result' => :'DlpAdvancedAudioDetectionResponse',
60
+ :'redact_audio_result' => :'DlpAudioRedactionResponse',
61
+ :'redact_audio_advanced_result' => :'DlpAdvancedAudioRedactionResponse',
62
+ :'error_message' => :'String'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.has_key?(:'Successful')
75
+ self.successful = attributes[:'Successful']
76
+ end
77
+
78
+ if attributes.has_key?(:'AsyncJobStatus')
79
+ self.async_job_status = attributes[:'AsyncJobStatus']
80
+ end
81
+
82
+ if attributes.has_key?(:'AsyncJobID')
83
+ self.async_job_id = attributes[:'AsyncJobID']
84
+ end
85
+
86
+ if attributes.has_key?(:'DetectAudioResult')
87
+ self.detect_audio_result = attributes[:'DetectAudioResult']
88
+ end
89
+
90
+ if attributes.has_key?(:'DetectAudioAdvancedResult')
91
+ self.detect_audio_advanced_result = attributes[:'DetectAudioAdvancedResult']
92
+ end
93
+
94
+ if attributes.has_key?(:'RedactAudioResult')
95
+ self.redact_audio_result = attributes[:'RedactAudioResult']
96
+ end
97
+
98
+ if attributes.has_key?(:'RedactAudioAdvancedResult')
99
+ self.redact_audio_advanced_result = attributes[:'RedactAudioAdvancedResult']
100
+ end
101
+
102
+ if attributes.has_key?(:'ErrorMessage')
103
+ self.error_message = attributes[:'ErrorMessage']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ successful == o.successful &&
126
+ async_job_status == o.async_job_status &&
127
+ async_job_id == o.async_job_id &&
128
+ detect_audio_result == o.detect_audio_result &&
129
+ detect_audio_advanced_result == o.detect_audio_advanced_result &&
130
+ redact_audio_result == o.redact_audio_result &&
131
+ redact_audio_advanced_result == o.redact_audio_advanced_result &&
132
+ error_message == o.error_message
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Fixnum] Hash code
143
+ def hash
144
+ [successful, async_job_status, async_job_id, detect_audio_result, detect_audio_advanced_result, redact_audio_result, redact_audio_advanced_result, error_message].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ self.class.swagger_types.each_pair do |key, type|
153
+ if type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
158
+ end
159
+ elsif !attributes[self.class.attribute_map[key]].nil?
160
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
161
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :DateTime
174
+ DateTime.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :BOOLEAN
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else # model
204
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
205
+ temp_model.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ next if value.nil?
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
234
+ # For object, use to_hash. Otherwise, just return the value
235
+ # @param [Object] value Any valid value
236
+ # @return [Hash] Returns the value in the form of hash
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map { |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+
251
+ end
252
+ end
@@ -15,13 +15,13 @@ require 'date'
15
15
  module CloudmersiveDlpApiClient
16
16
  # Request object for DLP document detection with 23 PII detection types.
17
17
  class DlpDocumentDetectionRequest
18
- # Document file bytes (PDF, DOCX, PNG, or JPG) to scan for PII and sensitive data.
18
+ # Document file bytes (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG, or WEBP) to scan for PII and sensitive data.
19
19
  attr_accessor :input_file
20
20
 
21
21
  # Optional. Name of the input file including extension, used for format detection. If not provided, format is detected from file contents.
22
22
  attr_accessor :file_name
23
23
 
24
- # Optional. Recognition mode for image processing. Options: null (default), \"Fast\", \"FastPlus\", \"FastMini\".
24
+ # Optional. Recognition mode for image processing. Options: null (default), \"Normal\", \"Advanced\", \"Fast\", \"FastPlus\", \"FastMini\".
25
25
  attr_accessor :recognition_mode
26
26
 
27
27
  # Set to true to allow email addresses in the document and not flag them as PII.
@@ -15,13 +15,13 @@ require 'date'
15
15
  module CloudmersiveDlpApiClient
16
16
  # Request object for DLP document redaction with 23 PII detection types.
17
17
  class DlpDocumentRedactionRequest
18
- # Document file bytes (PDF, DOCX, PNG, or JPG) to scan for PII and redact.
18
+ # Document file bytes (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG, or WEBP) to scan for PII and redact.
19
19
  attr_accessor :input_file
20
20
 
21
21
  # Optional. Name of the input file including extension, used for format detection. If not provided, format is detected from file contents.
22
22
  attr_accessor :file_name
23
23
 
24
- # Optional. Recognition mode for image processing. Options: null (default), \"Fast\", \"FastPlus\", \"FastMini\".
24
+ # Optional. Recognition mode for image processing. Options: null (default), \"Normal\", \"Advanced\", \"Fast\", \"FastPlus\", \"FastMini\".
25
25
  attr_accessor :recognition_mode
26
26
 
27
27
  # Redaction mode for PII regions. Options: \"BlackOut\" (default) draws black rectangles over PII rows, \"Blur\" applies Gaussian blur to PII rows, \"BlackOutEntirePage\" blacks out entire dirty pages, \"BlurEntirePage\" blurs entire dirty pages.
@@ -87,7 +87,7 @@ module CloudmersiveDlpApiClient
87
87
  # Set to true to allow MAC addresses in the input text and not redact them.
88
88
  attr_accessor :allow_mac_address
89
89
 
90
- # Redaction mode: \"Delete\" to remove PII entirely, or \"ReplaceWithAsterisk\" to replace PII characters with asterisks (*).
90
+ # Redaction mode: \"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 (*).
91
91
  attr_accessor :redaction_mode
92
92
 
93
93
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,206 @@
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
+ # Represents a time range in the audio that was redacted.
17
+ class RedactedAudioSegment
18
+ # Start time of the redacted segment in the audio, in milliseconds.
19
+ attr_accessor :start_time_ms
20
+
21
+ # End time of the redacted segment in the audio, in milliseconds.
22
+ attr_accessor :end_time_ms
23
+
24
+ # The original text that was redacted in this segment.
25
+ attr_accessor :redacted_text
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'start_time_ms' => :'StartTimeMs',
31
+ :'end_time_ms' => :'EndTimeMs',
32
+ :'redacted_text' => :'RedactedText'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'start_time_ms' => :'Integer',
40
+ :'end_time_ms' => :'Integer',
41
+ :'redacted_text' => :'String'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'StartTimeMs')
54
+ self.start_time_ms = attributes[:'StartTimeMs']
55
+ end
56
+
57
+ if attributes.has_key?(:'EndTimeMs')
58
+ self.end_time_ms = attributes[:'EndTimeMs']
59
+ end
60
+
61
+ if attributes.has_key?(:'RedactedText')
62
+ self.redacted_text = attributes[:'RedactedText']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ start_time_ms == o.start_time_ms &&
85
+ end_time_ms == o.end_time_ms &&
86
+ redacted_text == o.redacted_text
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [start_time_ms, end_time_ms, redacted_text].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ temp_model = CloudmersiveDlpApiClient.const_get(type).new
159
+ temp_model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveDlpApiClient
14
- VERSION = '2.2.0'
14
+ VERSION = '2.2.1'
15
15
  end
@@ -17,6 +17,12 @@ require 'cloudmersive-dlp-api-client/version'
17
17
  require 'cloudmersive-dlp-api-client/configuration'
18
18
 
19
19
  # Models
20
+ require 'cloudmersive-dlp-api-client/models/audio_timestamp'
21
+ require 'cloudmersive-dlp-api-client/models/custom_pii_field'
22
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_audio_detection_request'
23
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_audio_detection_response'
24
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_audio_redaction_request'
25
+ require 'cloudmersive-dlp-api-client/models/dlp_advanced_audio_redaction_response'
20
26
  require 'cloudmersive-dlp-api-client/models/dlp_advanced_detection_request'
21
27
  require 'cloudmersive-dlp-api-client/models/dlp_advanced_detection_response'
22
28
  require 'cloudmersive-dlp-api-client/models/dlp_advanced_document_detection_request'
@@ -24,6 +30,12 @@ require 'cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_requ
24
30
  require 'cloudmersive-dlp-api-client/models/dlp_advanced_document_redaction_response'
25
31
  require 'cloudmersive-dlp-api-client/models/dlp_advanced_redaction_request'
26
32
  require 'cloudmersive-dlp-api-client/models/dlp_advanced_redaction_response'
33
+ require 'cloudmersive-dlp-api-client/models/dlp_audio_detection_request'
34
+ require 'cloudmersive-dlp-api-client/models/dlp_audio_detection_response'
35
+ require 'cloudmersive-dlp-api-client/models/dlp_audio_redaction_request'
36
+ require 'cloudmersive-dlp-api-client/models/dlp_audio_redaction_response'
37
+ require 'cloudmersive-dlp-api-client/models/dlp_batch_job_result'
38
+ require 'cloudmersive-dlp-api-client/models/dlp_batch_job_status_result'
27
39
  require 'cloudmersive-dlp-api-client/models/dlp_detection_request'
28
40
  require 'cloudmersive-dlp-api-client/models/dlp_detection_response'
29
41
  require 'cloudmersive-dlp-api-client/models/dlp_document_detection_request'
@@ -31,11 +43,13 @@ require 'cloudmersive-dlp-api-client/models/dlp_document_redaction_request'
31
43
  require 'cloudmersive-dlp-api-client/models/dlp_document_redaction_response'
32
44
  require 'cloudmersive-dlp-api-client/models/dlp_redaction_request'
33
45
  require 'cloudmersive-dlp-api-client/models/dlp_redaction_response'
46
+ require 'cloudmersive-dlp-api-client/models/redacted_audio_segment'
34
47
  require 'cloudmersive-dlp-api-client/models/redacted_page_info'
35
48
 
36
49
  # APIs
37
50
  require 'cloudmersive-dlp-api-client/api/detect_api'
38
51
  require 'cloudmersive-dlp-api-client/api/redact_api'
52
+ require 'cloudmersive-dlp-api-client/api/tasks_batch_job_api'
39
53
 
40
54
  module CloudmersiveDlpApiClient
41
55
  class << self
@@ -32,9 +32,33 @@ describe 'DetectApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for detect_audio
36
+ # Detect User Data in Audio File
37
+ # Transcribes an audio file (WAV, MP3, M4A, FLAC, OGG, WMA) and detects 23 configurable types of user data in the transcript using Advanced AI. Returns the full transcript, token timestamps, and detection results.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [DlpAudioDetectionRequest] :body Input request
40
+ # @return [DlpAudioDetectionResponse]
41
+ describe 'detect_audio test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ # unit tests for detect_audio_advanced
48
+ # Detect User Data in Audio File (Advanced)
49
+ # Transcribes an audio file (WAV, MP3, M4A, FLAC, OGG, WMA) and detects 29 configurable types of user data including health-related PHI in the transcript using Advanced AI. Returns the full transcript, token timestamps, detection results, and optional rationale.
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [DlpAdvancedAudioDetectionRequest] :body Input request
52
+ # @return [DlpAdvancedAudioDetectionResponse]
53
+ describe 'detect_audio_advanced test' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
35
59
  # unit tests for detect_document
36
60
  # Detect User Data in Document Image
37
- # Detects configurable types of user data in a document image (PDF, DOCX, PNG, JPG) using Advanced AI.
61
+ # Detects configurable types of user data in a document (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG, WEBP) using Advanced AI.
38
62
  # @param [Hash] opts the optional parameters
39
63
  # @option opts [DlpDocumentDetectionRequest] :body Input request
40
64
  # @return [DlpDetectionResponse]
@@ -46,7 +70,7 @@ describe 'DetectApi' do
46
70
 
47
71
  # unit tests for detect_document_advanced
48
72
  # Detect User Data in Document Image (Advanced)
49
- # Detects 29 configurable types of user data including health-related PHI in a document image (PDF, DOCX, PNG, JPG) using Advanced AI.
73
+ # Detects 29 configurable types of user data including health-related PHI in a document (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG, WEBP) using Advanced AI.
50
74
  # @param [Hash] opts the optional parameters
51
75
  # @option opts [DlpAdvancedDocumentDetectionRequest] :body Input request
52
76
  # @return [DlpAdvancedDetectionResponse]
@@ -32,9 +32,33 @@ describe 'RedactApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for redact_audio
36
+ # Redact User Data in Audio File
37
+ # Transcribes an audio file (WAV, MP3, M4A, FLAC, OGG, WMA), detects 23 configurable types of user data in the transcript, and redacts audio segments containing PII. Returns the redacted audio, redacted transcript, detection results, and redacted segment timestamps.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [DlpAudioRedactionRequest] :body Input request
40
+ # @return [DlpAudioRedactionResponse]
41
+ describe 'redact_audio test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ # unit tests for redact_audio_advanced
48
+ # Redact User Data in Audio File (Advanced)
49
+ # Transcribes an audio file (WAV, MP3, M4A, FLAC, OGG, WMA), detects 34 configurable types of user data including health-related PHI in the transcript, and redacts audio segments containing PII. Returns the redacted audio, redacted transcript, detection results, redacted segment timestamps, and optional rationale.
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [DlpAdvancedAudioRedactionRequest] :body Input request
52
+ # @return [DlpAdvancedAudioRedactionResponse]
53
+ describe 'redact_audio_advanced test' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
35
59
  # unit tests for redact_document
36
60
  # Redact User Data in Document
37
- # Detects and redacts configurable types of user data in a document (PDF, DOCX, PNG, JPG) using Advanced AI. Rasterizes document pages, detects PII regions using a grid-overlay approach, blurs those regions, and returns a rasterized PDF.
61
+ # Detects and redacts configurable types of user data in a document (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG, WEBP) using Advanced AI. Rasterizes document pages, detects PII regions using a grid-overlay approach, blurs those regions, and returns a rasterized PDF.
38
62
  # @param [Hash] opts the optional parameters
39
63
  # @option opts [DlpDocumentRedactionRequest] :body Input request
40
64
  # @return [DlpDocumentRedactionResponse]
@@ -46,7 +70,7 @@ describe 'RedactApi' do
46
70
 
47
71
  # unit tests for redact_document_advanced
48
72
  # Redact User Data in Document (Advanced)
49
- # Detects and redacts 35 configurable types of user data including health-related PHI in a document (PDF, DOCX, PNG, JPG) using Advanced AI. Rasterizes document pages, detects PII regions using a row-overlay approach, redacts those regions, and returns a rasterized PDF.
73
+ # Detects and redacts 35 configurable types of user data including health-related PHI in a document (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG, WEBP) using Advanced AI. Rasterizes document pages, detects PII regions using a row-overlay approach, redacts those regions, and returns a rasterized PDF.
50
74
  # @param [Hash] opts the optional parameters
51
75
  # @option opts [DlpAdvancedDocumentRedactionRequest] :body Input request
52
76
  # @return [DlpAdvancedDocumentRedactionResponse]