Class: Bandwidth::TranscriptionMetadata
- Defined in:
- lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb
Overview
TranscriptionMetadata Model.
Instance Attribute Summary collapse
-
#completed_time ⇒ String
The current status of the transcription.
-
#id ⇒ String
TODO: Write general description for this method.
-
#status ⇒ String
The current status of the transcription.
-
#url ⇒ String
The current status of the transcription.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(id = nil, status = nil, completed_time = nil, url = nil) ⇒ TranscriptionMetadata
constructor
A new instance of TranscriptionMetadata.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, status = nil, completed_time = nil, url = nil) ⇒ TranscriptionMetadata
Returns a new instance of TranscriptionMetadata.
62 63 64 65 66 67 68 69 70 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 62 def initialize(id = nil, status = nil, completed_time = nil, url = nil) @id = id unless id == SKIP @status = status unless status == SKIP @completed_time = completed_time unless completed_time == SKIP @url = url unless url == SKIP end |
Instance Attribute Details
#completed_time ⇒ String
The current status of the transcription. Current values are ‘none’, ‘processing’, ‘available’, ‘error’, ‘timeout’, ‘file-size-too-big’, and ‘file-size-too-small’. Additional states may be added in the future, so your application must be tolerant of unknown values.
28 29 30 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 28 def completed_time @completed_time end |
#id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 14 def id @id end |
#status ⇒ String
The current status of the transcription. Current values are ‘none’, ‘processing’, ‘available’, ‘error’, ‘timeout’, ‘file-size-too-big’, and ‘file-size-too-small’. Additional states may be added in the future, so your application must be tolerant of unknown values.
21 22 23 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 21 def status @status end |
#url ⇒ String
The current status of the transcription. Current values are ‘none’, ‘processing’, ‘available’, ‘error’, ‘timeout’, ‘file-size-too-big’, and ‘file-size-too-small’. Additional states may be added in the future, so your application must be tolerant of unknown values.
35 36 37 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 35 def url @url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 73 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP completed_time = hash.key?('completedTime') ? hash['completedTime'] : SKIP url = hash.key?('url') ? hash['url'] : SKIP # Create object from extracted values. TranscriptionMetadata.new(id, status, completed_time, url) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['status'] = 'status' @_hash['completed_time'] = 'completedTime' @_hash['url'] = 'url' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 58 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
48 49 50 51 52 53 54 55 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 48 def optionals %w[ id status completed_time url ] end |