class Rev::Input
Input
for order (aka source file)
Constants
- SUPPORTED_ACCENTS
Attributes
accents[R]
Optional, list of accents.
audio_length_seconds[R]
Length of audio in seconds (mandatory in case of inability to determine it automatically). Used within {Rev::OrderRequest::TranscriptionInfo}
external_link[R]
External URL, if sources wasn't POSTed as input (YouTube, Vimeo, Dropbox, etc)
glossary[R]
Optional, list of glossary entries.
speakers[R]
Optional, list of speaker names.
uri[R]
Mandatory, URI of the media, as returned from the call to POST /inputs. :external_link might substitute :uri for Transcription or Caption.
video_length_seconds[R]
Length of video in seconds (mandatory in case of inability to determine it automatically). Used within {Rev::OrderRequest::CaptionInfo}
Public Instance Methods
validate_accents()
click to toggle source
# File lib/rev-api/models/order_request.rb, line 260 def validate_accents if accents if accents.length > SUPPORTED_ACCENTS.length raise(ArgumentError, "Length of accents list cannot exceed number of supported accents.") end if accents.any?{ |accent| !Rev::Input::SUPPORTED_ACCENTS.has_value?(accent) } raise(ArgumentError, 'Unsupported accent provided') end end end
validate_glossary()
click to toggle source
# File lib/rev-api/models/order_request.rb, line 234 def validate_glossary if glossary if glossary.length > GLOSSARY_ENTRIES_LIMIT raise(ArgumentError, "Glossary must not exceed #{GLOSSARY_ENTRIES_LIMIT} entries") end glossary.each { |term| if term.length > GLOSSARY_ENTRY_LENGTH_LIMIT raise(ArgumentError, "Glossary entries cannot exceed #{GLOSSARY_ENTRY_LENGTH_LIMIT} characters") end } end end
validate_speakers()
click to toggle source
# File lib/rev-api/models/order_request.rb, line 247 def validate_speakers if speakers if speakers.length > SPEAKER_ENTRIES_LIMIT raise(ArgumentError, "Speaker list must not exceed #{SPEAKER_ENTRIES_LIMIT} entries") end speakers.each { |speaker| if speaker.length > SPEAKER_ENTRY_LENGTH_LIMIT raise(ArgumentError, "Speaker name cannot exceed #{SPEAKER_ENTRY_LENGTH_LIMIT} characters") end } end end