Method: AssemblyAI::Transcripts::SentencesResponse.validate_raw

Defined in:
lib/assemblyai/transcripts/types/sentences_response.rb

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


77
78
79
80
81
82
# File 'lib/assemblyai/transcripts/types/sentences_response.rb', line 77

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
  obj.audio_duration.is_a?(Float) != false || raise("Passed value for field obj.audio_duration is not the expected type, validation failed.")
  obj.sentences.is_a?(Array) != false || raise("Passed value for field obj.sentences is not the expected type, validation failed.")
end