Class: CloudmersiveDlpApiClient::DlpAudioDetectionResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb

Overview

Response object for DLP audio detection with 23 PII detection types, transcript, and timestamps.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DlpAudioDetectionResponse

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 162

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'CleanResult')
    self.clean_result = attributes[:'CleanResult']
  end

  if attributes.has_key?(:'Transcript')
    self.transcript = attributes[:'Transcript']
  end

  if attributes.has_key?(:'Timestamps')
    if (value = attributes[:'Timestamps']).is_a?(Array)
      self.timestamps = value
    end
  end

  if attributes.has_key?(:'ContainsEmailAddress')
    self.contains_email_address = attributes[:'ContainsEmailAddress']
  end

  if attributes.has_key?(:'ContainsPhoneNumber')
    self.contains_phone_number = attributes[:'ContainsPhoneNumber']
  end

  if attributes.has_key?(:'ContainsStreetAddress')
    self.contains_street_address = attributes[:'ContainsStreetAddress']
  end

  if attributes.has_key?(:'ContainsPersonName')
    self.contains_person_name = attributes[:'ContainsPersonName']
  end

  if attributes.has_key?(:'ContainsBirthDate')
    self.contains_birth_date = attributes[:'ContainsBirthDate']
  end

  if attributes.has_key?(:'ContainsPassportNumber')
    self.contains_passport_number = attributes[:'ContainsPassportNumber']
  end

  if attributes.has_key?(:'ContainsDriversLicense')
    self.contains_drivers_license = attributes[:'ContainsDriversLicense']
  end

  if attributes.has_key?(:'ContainsSocialSecurityNumber')
    self.contains_social_security_number = attributes[:'ContainsSocialSecurityNumber']
  end

  if attributes.has_key?(:'ContainsTaxpayerID')
    self.contains_taxpayer_id = attributes[:'ContainsTaxpayerID']
  end

  if attributes.has_key?(:'ContainsCreditCardNumber')
    self.contains_credit_card_number = attributes[:'ContainsCreditCardNumber']
  end

  if attributes.has_key?(:'ContainsCreditCardExpirationDate')
    self.contains_credit_card_expiration_date = attributes[:'ContainsCreditCardExpirationDate']
  end

  if attributes.has_key?(:'ContainsCreditCardVerificationCode')
    self.contains_credit_card_verification_code = attributes[:'ContainsCreditCardVerificationCode']
  end

  if attributes.has_key?(:'ContainsBankAccountNumber')
    self. = attributes[:'ContainsBankAccountNumber']
  end

  if attributes.has_key?(:'ContainsIBAN')
    self.contains_iban = attributes[:'ContainsIBAN']
  end

  if attributes.has_key?(:'ContainsHealthInsuranceNumber')
    self.contains_health_insurance_number = attributes[:'ContainsHealthInsuranceNumber']
  end

  if attributes.has_key?(:'ContainsBearerToken')
    self.contains_bearer_token = attributes[:'ContainsBearerToken']
  end

  if attributes.has_key?(:'ContainsHttpCookie')
    self.contains_http_cookie = attributes[:'ContainsHttpCookie']
  end

  if attributes.has_key?(:'ContainsPrivateKeys')
    self.contains_private_keys = attributes[:'ContainsPrivateKeys']
  end

  if attributes.has_key?(:'ContainsCredentials')
    self.contains_credentials = attributes[:'ContainsCredentials']
  end

  if attributes.has_key?(:'ContainsDeepWebUrls')
    self.contains_deep_web_urls = attributes[:'ContainsDeepWebUrls']
  end

  if attributes.has_key?(:'ContainsSourceCode')
    self.contains_source_code = attributes[:'ContainsSourceCode']
  end

  if attributes.has_key?(:'ContainsIpAddress')
    self.contains_ip_address = attributes[:'ContainsIpAddress']
  end

  if attributes.has_key?(:'ContainsMacAddress')
    self.contains_mac_address = attributes[:'ContainsMacAddress']
  end
end

Instance Attribute Details

#clean_resultObject

True if no disallowed PII or sensitive data types were detected; false if any disallowed type was found.



19
20
21
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 19

def clean_result
  @clean_result
end

#contains_bank_account_numberObject

True if the audio transcript contains bank account numbers.



64
65
66
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 64

def 
  @contains_bank_account_number
end

#contains_bearer_tokenObject

True if the audio transcript contains bearer tokens.



73
74
75
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 73

def contains_bearer_token
  @contains_bearer_token
end

#contains_birth_dateObject

True if the audio transcript contains birth dates.



40
41
42
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 40

def contains_birth_date
  @contains_birth_date
end

#contains_credentialsObject

True if the audio transcript contains credentials (usernames/passwords).



82
83
84
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 82

def contains_credentials
  @contains_credentials
end

#contains_credit_card_expiration_dateObject

True if the audio transcript contains credit card expiration dates.



58
59
60
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 58

def contains_credit_card_expiration_date
  @contains_credit_card_expiration_date
end

#contains_credit_card_numberObject

True if the audio transcript contains credit card numbers.



55
56
57
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 55

def contains_credit_card_number
  @contains_credit_card_number
end

#contains_credit_card_verification_codeObject

True if the audio transcript contains credit card verification codes.



61
62
63
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 61

def contains_credit_card_verification_code
  @contains_credit_card_verification_code
end

#contains_deep_web_urlsObject

True if the audio transcript contains deep web URLs (.onion).



85
86
87
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 85

def contains_deep_web_urls
  @contains_deep_web_urls
end

#contains_drivers_licenseObject

True if the audio transcript contains drivers license numbers.



46
47
48
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 46

def contains_drivers_license
  @contains_drivers_license
end

#contains_email_addressObject

True if the audio transcript contains email addresses.



28
29
30
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 28

def contains_email_address
  @contains_email_address
end

#contains_health_insurance_numberObject

True if the audio transcript contains health insurance numbers.



70
71
72
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 70

def contains_health_insurance_number
  @contains_health_insurance_number
end

True if the audio transcript contains HTTP cookies.



76
77
78
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 76

def contains_http_cookie
  @contains_http_cookie
end

#contains_ibanObject

True if the audio transcript contains IBANs.



67
68
69
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 67

def contains_iban
  @contains_iban
end

#contains_ip_addressObject

True if the audio transcript contains IP addresses.



91
92
93
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 91

def contains_ip_address
  @contains_ip_address
end

#contains_mac_addressObject

True if the audio transcript contains MAC addresses.



94
95
96
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 94

def contains_mac_address
  @contains_mac_address
end

#contains_passport_numberObject

True if the audio transcript contains passport numbers.



43
44
45
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 43

def contains_passport_number
  @contains_passport_number
end

#contains_person_nameObject

True if the audio transcript contains person names.



37
38
39
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 37

def contains_person_name
  @contains_person_name
end

#contains_phone_numberObject

True if the audio transcript contains phone numbers.



31
32
33
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 31

def contains_phone_number
  @contains_phone_number
end

#contains_private_keysObject

True if the audio transcript contains private keys.



79
80
81
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 79

def contains_private_keys
  @contains_private_keys
end

#contains_social_security_numberObject

True if the audio transcript contains social security numbers.



49
50
51
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 49

def contains_social_security_number
  @contains_social_security_number
end

#contains_source_codeObject

True if the audio transcript contains source code.



88
89
90
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 88

def contains_source_code
  @contains_source_code
end

#contains_street_addressObject

True if the audio transcript contains street addresses.



34
35
36
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 34

def contains_street_address
  @contains_street_address
end

#contains_taxpayer_idObject

True if the audio transcript contains taxpayer IDs.



52
53
54
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 52

def contains_taxpayer_id
  @contains_taxpayer_id
end

#timestampsObject

Token-level timestamps from speech recognition.



25
26
27
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 25

def timestamps
  @timestamps
end

#transcriptObject

Full transcript of the audio file.



22
23
24
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 22

def transcript
  @transcript
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 97

def self.attribute_map
  {
    :'clean_result' => :'CleanResult',
    :'transcript' => :'Transcript',
    :'timestamps' => :'Timestamps',
    :'contains_email_address' => :'ContainsEmailAddress',
    :'contains_phone_number' => :'ContainsPhoneNumber',
    :'contains_street_address' => :'ContainsStreetAddress',
    :'contains_person_name' => :'ContainsPersonName',
    :'contains_birth_date' => :'ContainsBirthDate',
    :'contains_passport_number' => :'ContainsPassportNumber',
    :'contains_drivers_license' => :'ContainsDriversLicense',
    :'contains_social_security_number' => :'ContainsSocialSecurityNumber',
    :'contains_taxpayer_id' => :'ContainsTaxpayerID',
    :'contains_credit_card_number' => :'ContainsCreditCardNumber',
    :'contains_credit_card_expiration_date' => :'ContainsCreditCardExpirationDate',
    :'contains_credit_card_verification_code' => :'ContainsCreditCardVerificationCode',
    :'contains_bank_account_number' => :'ContainsBankAccountNumber',
    :'contains_iban' => :'ContainsIBAN',
    :'contains_health_insurance_number' => :'ContainsHealthInsuranceNumber',
    :'contains_bearer_token' => :'ContainsBearerToken',
    :'contains_http_cookie' => :'ContainsHttpCookie',
    :'contains_private_keys' => :'ContainsPrivateKeys',
    :'contains_credentials' => :'ContainsCredentials',
    :'contains_deep_web_urls' => :'ContainsDeepWebUrls',
    :'contains_source_code' => :'ContainsSourceCode',
    :'contains_ip_address' => :'ContainsIpAddress',
    :'contains_mac_address' => :'ContainsMacAddress'
  }
end

.swagger_typesObject

Attribute type mapping.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 129

def self.swagger_types
  {
    :'clean_result' => :'BOOLEAN',
    :'transcript' => :'String',
    :'timestamps' => :'Array<AudioTimestamp>',
    :'contains_email_address' => :'BOOLEAN',
    :'contains_phone_number' => :'BOOLEAN',
    :'contains_street_address' => :'BOOLEAN',
    :'contains_person_name' => :'BOOLEAN',
    :'contains_birth_date' => :'BOOLEAN',
    :'contains_passport_number' => :'BOOLEAN',
    :'contains_drivers_license' => :'BOOLEAN',
    :'contains_social_security_number' => :'BOOLEAN',
    :'contains_taxpayer_id' => :'BOOLEAN',
    :'contains_credit_card_number' => :'BOOLEAN',
    :'contains_credit_card_expiration_date' => :'BOOLEAN',
    :'contains_credit_card_verification_code' => :'BOOLEAN',
    :'contains_bank_account_number' => :'BOOLEAN',
    :'contains_iban' => :'BOOLEAN',
    :'contains_health_insurance_number' => :'BOOLEAN',
    :'contains_bearer_token' => :'BOOLEAN',
    :'contains_http_cookie' => :'BOOLEAN',
    :'contains_private_keys' => :'BOOLEAN',
    :'contains_credentials' => :'BOOLEAN',
    :'contains_deep_web_urls' => :'BOOLEAN',
    :'contains_source_code' => :'BOOLEAN',
    :'contains_ip_address' => :'BOOLEAN',
    :'contains_mac_address' => :'BOOLEAN'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 290

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      clean_result == o.clean_result &&
      transcript == o.transcript &&
      timestamps == o.timestamps &&
      contains_email_address == o.contains_email_address &&
      contains_phone_number == o.contains_phone_number &&
      contains_street_address == o.contains_street_address &&
      contains_person_name == o.contains_person_name &&
      contains_birth_date == o.contains_birth_date &&
      contains_passport_number == o.contains_passport_number &&
      contains_drivers_license == o.contains_drivers_license &&
      contains_social_security_number == o.contains_social_security_number &&
      contains_taxpayer_id == o.contains_taxpayer_id &&
      contains_credit_card_number == o.contains_credit_card_number &&
      contains_credit_card_expiration_date == o.contains_credit_card_expiration_date &&
      contains_credit_card_verification_code == o.contains_credit_card_verification_code &&
       == o. &&
      contains_iban == o.contains_iban &&
      contains_health_insurance_number == o.contains_health_insurance_number &&
      contains_bearer_token == o.contains_bearer_token &&
      contains_http_cookie == o.contains_http_cookie &&
      contains_private_keys == o.contains_private_keys &&
      contains_credentials == o.contains_credentials &&
      contains_deep_web_urls == o.contains_deep_web_urls &&
      contains_source_code == o.contains_source_code &&
      contains_ip_address == o.contains_ip_address &&
      contains_mac_address == o.contains_mac_address
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 357

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CloudmersiveDlpApiClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 423

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 336

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


323
324
325
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 323

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



329
330
331
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 329

def hash
  [clean_result, transcript, timestamps, 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_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
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



277
278
279
280
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 277

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



403
404
405
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 403

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



409
410
411
412
413
414
415
416
417
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 409

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



397
398
399
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 397

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



284
285
286
# File 'lib/cloudmersive-dlp-api-client/models/dlp_audio_detection_response.rb', line 284

def valid?
  true
end