Class: Bandwidth::ConferenceRecordingMetadata

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

Overview

ConferenceRecordingMetadata Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_id = nil, conference_id = nil, name = nil, recording_id = nil, duration = nil, channels = nil, start_time = nil, end_time = nil, file_format = nil, status = nil, media_url = nil) ⇒ ConferenceRecordingMetadata

Returns a new instance of ConferenceRecordingMetadata.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 102

def initialize( = nil,
               conference_id = nil,
               name = nil,
               recording_id = nil,
               duration = nil,
               channels = nil,
               start_time = nil,
               end_time = nil,
               file_format = nil,
               status = nil,
               media_url = nil)
  @account_id =  unless  == SKIP
  @conference_id = conference_id unless conference_id == SKIP
  @name = name unless name == SKIP
  @recording_id = recording_id unless recording_id == SKIP
  @duration = duration unless duration == 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
end

Instance Attribute Details

#account_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_id
end

#channelsInteger

Format is ISO-8601

Returns:

  • (Integer)


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

def channels
  @channels
end

#conference_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def conference_id
  @conference_id
end

#durationString

Format is ISO-8601

Returns:

  • (String)


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

def duration
  @duration
end

#end_timeDateTime

Format is ISO-8601

Returns:

  • (DateTime)


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

def end_time
  @end_time
end

#file_formatFileFormatEnum

Format is ISO-8601

Returns:



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

def file_format
  @file_format
end

#media_urlString

The current status of the recording. Current possible 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)


61
62
63
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 61

def media_url
  @media_url
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#recording_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def recording_id
  @recording_id
end

#start_timeDateTime

Format is ISO-8601

Returns:

  • (DateTime)


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

def start_time
  @start_time
end

#statusString

The current status of the recording. Current possible 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)


54
55
56
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 54

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 127

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountId') ? hash['accountId'] : SKIP
  conference_id = hash.key?('conferenceId') ? hash['conferenceId'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  recording_id = hash.key?('recordingId') ? hash['recordingId'] : SKIP
  duration = hash.key?('duration') ? hash['duration'] : 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

  # Create object from extracted values.
  ConferenceRecordingMetadata.new(,
                                  conference_id,
                                  name,
                                  recording_id,
                                  duration,
                                  channels,
                                  start_time,
                                  end_time,
                                  file_format,
                                  status,
                                  media_url)
end

.namesObject

A mapping from model property names to API property names.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 64

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'accountId'
  @_hash['conference_id'] = 'conferenceId'
  @_hash['name'] = 'name'
  @_hash['recording_id'] = 'recordingId'
  @_hash['duration'] = 'duration'
  @_hash['channels'] = 'channels'
  @_hash['start_time'] = 'startTime'
  @_hash['end_time'] = 'endTime'
  @_hash['file_format'] = 'fileFormat'
  @_hash['status'] = 'status'
  @_hash['media_url'] = 'mediaUrl'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



98
99
100
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 98

def nullables
  []
end

#optionalsObject

An array for optional fields



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 81

def optionals
  %w[
    account_id
    conference_id
    name
    recording_id
    duration
    channels
    start_time
    end_time
    file_format
    status
    media_url
  ]
end

#to_end_timeObject



169
170
171
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 169

def to_end_time
  DateTimeHelper.to_rfc3339(end_time)
end

#to_start_timeObject



165
166
167
# File 'lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb', line 165

def to_start_time
  DateTimeHelper.to_rfc3339(start_time)
end