Class: Bandwidth::TranscriptionMetadata

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb

Overview

TranscriptionMetadata Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(id = nil, status = nil, completed_time = nil, url = nil) ⇒ TranscriptionMetadata

Returns a new instance of TranscriptionMetadata.



44
45
46
47
48
49
50
51
52
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 44

def initialize(id = nil,
               status = nil,
               completed_time = nil,
               url = nil)
  @id = id
  @status = status
  @completed_time = completed_time
  @url = url
end

Instance Attribute Details

#completed_timeString

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.

Returns:

  • (String)


25
26
27
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 25

def completed_time
  @completed_time
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


11
12
13
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 11

def id
  @id
end

#statusString

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.

Returns:

  • (String)


18
19
20
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 18

def status
  @status
end

#urlString

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.

Returns:

  • (String)


32
33
34
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 32

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash['id']
  status = hash['status']
  completed_time = hash['completedTime']
  url = hash['url']

  # Create object from extracted values.
  TranscriptionMetadata.new(id,
                            status,
                            completed_time,
                            url)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['status'] = 'status'
  @_hash['completed_time'] = 'completedTime'
  @_hash['url'] = 'url'
  @_hash
end