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.



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_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)


28
29
30
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 28

def completed_time
  @completed_time
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 14

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)


21
22
23
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 21

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)


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

.namesObject

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

#nullablesObject

An array for nullable fields



58
59
60
# File 'lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb', line 58

def nullables
  []
end

#optionalsObject

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