Method: AssemblyAI::Transcripts::TranscriptListItem.validate_raw

Defined in:
lib/assemblyai/transcripts/types/transcript_list_item.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.


104
105
106
107
108
109
110
111
112
# File 'lib/assemblyai/transcripts/types/transcript_list_item.rb', line 104

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.resource_url.is_a?(String) != false || raise("Passed value for field obj.resource_url is not the expected type, validation failed.")
  obj.status.is_a?(AssemblyAI::Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
  obj.completed&.is_a?(DateTime) != false || raise("Passed value for field obj.completed is not the expected type, validation failed.")
  obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
  obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
end