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.



149
150
151
152
153
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
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 149

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 unless application_id == SKIP
  @account_id =  unless  == SKIP
  @call_id = call_id unless call_id == SKIP
  @parent_call_id = parent_call_id unless parent_call_id == SKIP
  @recording_id = recording_id unless recording_id == SKIP
  @to = to unless to == SKIP
  @from = from unless from == SKIP
  @transfer_caller_id = transfer_caller_id unless transfer_caller_id == SKIP
  @transfer_to = transfer_to unless transfer_to == SKIP
  @duration = duration unless duration == SKIP
  @direction = direction unless direction == SKIP
  @channels = channels unless channels == SKIP
  @start_time = start_time unless start_time == SKIP
  @end_time = end_time unless end_time == SKIP
  @file_format = file_format unless file_format == SKIP
  @status = status unless status == SKIP
  @media_url = media_url unless media_url == SKIP
  @transcription = transcription unless transcription == SKIP
end

Instance Attribute Details

#account_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_id
end

#application_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def application_id
  @application_id
end

#call_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def call_id
  @call_id
end

#channelsInteger

Format is ISO-8601

Returns:

  • (Integer)


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

def channels
  @channels
end

#directionDirectionEnum

Format is ISO-8601

Returns:



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

def direction
  @direction
end

#durationString

Format is ISO-8601

Returns:

  • (String)


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

def duration
  @duration
end

#end_timeDateTime

Format is ISO-8601

Returns:

  • (DateTime)


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

def end_time
  @end_time
end

#file_formatFileFormatEnum

Format is ISO-8601

Returns:



71
72
73
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 71

def file_format
  @file_format
end

#fromString

TODO: Write general description for this method

Returns:

  • (String)


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

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)


85
86
87
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 85

def media_url
  @media_url
end

#parent_call_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def parent_call_id
  @parent_call_id
end

#recording_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def recording_id
  @recording_id
end

#start_timeDateTime

Format is ISO-8601

Returns:

  • (DateTime)


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

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)


78
79
80
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 78

def status
  @status
end

#toString

TODO: Write general description for this method

Returns:

  • (String)


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

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.



92
93
94
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 92

def transcription
  @transcription
end

#transfer_caller_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def transfer_caller_id
  @transfer_caller_id
end

#transfer_toString

TODO: Write general description for this method

Returns:

  • (String)


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

def transfer_to
  @transfer_to
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 188

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP
   = hash.key?('accountId') ? hash['accountId'] : SKIP
  call_id = hash.key?('callId') ? hash['callId'] : SKIP
  parent_call_id = hash.key?('parentCallId') ? hash['parentCallId'] : SKIP
  recording_id = hash.key?('recordingId') ? hash['recordingId'] : SKIP
  to = hash.key?('to') ? hash['to'] : SKIP
  from = hash.key?('from') ? hash['from'] : SKIP
  transfer_caller_id =
    hash.key?('transferCallerId') ? hash['transferCallerId'] : SKIP
  transfer_to = hash.key?('transferTo') ? hash['transferTo'] : SKIP
  duration = hash.key?('duration') ? hash['duration'] : SKIP
  direction = hash.key?('direction') ? hash['direction'] : SKIP
  channels = hash.key?('channels') ? hash['channels'] : SKIP
  start_time = if hash.key?('startTime')
                 (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime'])
               else
                 SKIP
               end
  end_time = if hash.key?('endTime')
               (DateTimeHelper.from_rfc3339(hash['endTime']) if hash['endTime'])
             else
               SKIP
             end
  file_format = hash.key?('fileFormat') ? hash['fileFormat'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  media_url = hash.key?('mediaUrl') ? hash['mediaUrl'] : SKIP
  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.



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

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

#nullablesObject

An array for nullable fields



143
144
145
146
147
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 143

def nullables
  %w[
    parent_call_id
  ]
end

#optionalsObject

An array for optional fields



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 119

def optionals
  %w[
    application_id
    account_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

#to_end_timeObject



246
247
248
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 246

def to_end_time
  DateTimeHelper.to_rfc3339(end_time)
end

#to_start_timeObject



242
243
244
# File 'lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb', line 242

def to_start_time
  DateTimeHelper.to_rfc3339(start_time)
end