Class: Bandwidth::CallRecordingMetadata

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

Overview

CallRecordingMetadata Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(application_id = nil, account_id = nil, call_id = nil, parent_call_id = nil, recording_id = nil, to = nil, from = nil, transfer_caller_id = nil, transfer_to = nil, duration = nil, direction = nil, channels = nil, start_time = nil, end_time = nil, file_format = nil, status = nil, media_url = nil, transcription = nil) ⇒ CallRecordingMetadata

Returns a new instance of CallRecordingMetadata.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 115

def initialize(application_id = nil,
                = nil,
               call_id = nil,
               parent_call_id = nil,
               recording_id = nil,
               to = nil,
               from = nil,
               transfer_caller_id = nil,
               transfer_to = nil,
               duration = nil,
               direction = nil,
               channels = nil,
               start_time = nil,
               end_time = nil,
               file_format = nil,
               status = nil,
               media_url = nil,
               transcription = nil)
  @application_id = application_id
  @account_id = 
  @call_id = call_id
  @parent_call_id = parent_call_id
  @recording_id = recording_id
  @to = to
  @from = from
  @transfer_caller_id = transfer_caller_id
  @transfer_to = transfer_to
  @duration = duration
  @direction = direction
  @channels = channels
  @start_time = start_time
  @end_time = end_time
  @file_format = file_format
  @status = status
  @media_url = media_url
  @transcription = transcription
end

Instance Attribute Details

#account_idString

TODO: Write general description for this method

Returns:

  • (String)


16
17
18
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 16

def 
  @account_id
end

#application_idString

TODO: Write general description for this method

Returns:

  • (String)


12
13
14
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 12

def application_id
  @application_id
end

#call_idString

TODO: Write general description for this method

Returns:

  • (String)


20
21
22
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 20

def call_id
  @call_id
end

#channelsInteger

Format is ISO-8601

Returns:

  • (Integer)


56
57
58
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 56

def channels
  @channels
end

#directionDirectionEnum

Format is ISO-8601

Returns:



52
53
54
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 52

def direction
  @direction
end

#durationString

Format is ISO-8601

Returns:

  • (String)


48
49
50
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 48

def duration
  @duration
end

#end_timeDateTime

Format is ISO-8601

Returns:

  • (DateTime)


64
65
66
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 64

def end_time
  @end_time
end

#file_formatFileFormatEnum

Format is ISO-8601

Returns:



68
69
70
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 68

def file_format
  @file_format
end

#fromString

TODO: Write general description for this method

Returns:

  • (String)


36
37
38
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 36

def from
  @from
end

#media_urlString

The current status of the recording. Current values are ‘processing’, ‘partial’, ‘complete’, ‘deleted’ and ‘error’. Additional states may be added in the future, so your application must be tolerant of unknown values.

Returns:

  • (String)


82
83
84
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 82

def media_url
  @media_url
end

#parent_call_idString

TODO: Write general description for this method

Returns:

  • (String)


24
25
26
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 24

def parent_call_id
  @parent_call_id
end

#recording_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def recording_id
  @recording_id
end

#start_timeDateTime

Format is ISO-8601

Returns:

  • (DateTime)


60
61
62
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 60

def start_time
  @start_time
end

#statusString

The current status of the recording. Current values are ‘processing’, ‘partial’, ‘complete’, ‘deleted’ and ‘error’. Additional states may be added in the future, so your application must be tolerant of unknown values.

Returns:

  • (String)


75
76
77
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 75

def status
  @status
end

#toString

TODO: Write general description for this method

Returns:

  • (String)


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

def to
  @to
end

#transcriptionTranscriptionMetadata

The current status of the recording. Current values are ‘processing’, ‘partial’, ‘complete’, ‘deleted’ and ‘error’. Additional states may be added in the future, so your application must be tolerant of unknown values.



89
90
91
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 89

def transcription
  @transcription
end

#transfer_caller_idString

TODO: Write general description for this method

Returns:

  • (String)


40
41
42
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 40

def transfer_caller_id
  @transfer_caller_id
end

#transfer_toString

TODO: Write general description for this method

Returns:

  • (String)


44
45
46
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 44

def transfer_to
  @transfer_to
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 154

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  application_id = hash['applicationId']
   = hash['accountId']
  call_id = hash['callId']
  parent_call_id = hash['parentCallId']
  recording_id = hash['recordingId']
  to = hash['to']
  from = hash['from']
  transfer_caller_id = hash['transferCallerId']
  transfer_to = hash['transferTo']
  duration = hash['duration']
  direction = hash['direction']
  channels = hash['channels']
  start_time = DateTimeHelper.from_rfc3339(hash['startTime']) if
    hash['startTime']
  end_time = DateTimeHelper.from_rfc3339(hash['endTime']) if
    hash['endTime']
  file_format = hash['fileFormat']
  status = hash['status']
  media_url = hash['mediaUrl']
  transcription = TranscriptionMetadata.from_hash(hash['transcription']) if
    hash['transcription']

  # Create object from extracted values.
  CallRecordingMetadata.new(application_id,
                            ,
                            call_id,
                            parent_call_id,
                            recording_id,
                            to,
                            from,
                            transfer_caller_id,
                            transfer_to,
                            duration,
                            direction,
                            channels,
                            start_time,
                            end_time,
                            file_format,
                            status,
                            media_url,
                            transcription)
end

.namesObject

A mapping from model property names to API property names.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 92

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['application_id'] = 'applicationId'
  @_hash['account_id'] = 'accountId'
  @_hash['call_id'] = 'callId'
  @_hash['parent_call_id'] = 'parentCallId'
  @_hash['recording_id'] = 'recordingId'
  @_hash['to'] = 'to'
  @_hash['from'] = 'from'
  @_hash['transfer_caller_id'] = 'transferCallerId'
  @_hash['transfer_to'] = 'transferTo'
  @_hash['duration'] = 'duration'
  @_hash['direction'] = 'direction'
  @_hash['channels'] = 'channels'
  @_hash['start_time'] = 'startTime'
  @_hash['end_time'] = 'endTime'
  @_hash['file_format'] = 'fileFormat'
  @_hash['status'] = 'status'
  @_hash['media_url'] = 'mediaUrl'
  @_hash['transcription'] = 'transcription'
  @_hash
end

Instance Method Details

#to_end_timeObject



205
206
207
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 205

def to_end_time
  DateTimeHelper.to_rfc3339(end_time)
end

#to_start_timeObject



201
202
203
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 201

def to_start_time
  DateTimeHelper.to_rfc3339(start_time)
end