Class: Bandwidth::ApiCallStateResponse

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

Overview

ApiCallStateResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(call_id = nil, parent_call_id = nil, application_id = nil, account_id = nil, to = nil, from = nil, direction = nil, state = nil, start_time = nil, answer_time = nil, end_time = nil, disconnect_cause = nil, error_message = nil, error_id = nil, last_update = nil) ⇒ ApiCallStateResponse

Returns a new instance of ApiCallStateResponse.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb', line 91

def initialize(call_id = nil,
               parent_call_id = nil,
               application_id = nil,
                = nil,
               to = nil,
               from = nil,
               direction = nil,
               state = nil,
               start_time = nil,
               answer_time = nil,
               end_time = nil,
               disconnect_cause = nil,
               error_message = nil,
               error_id = nil,
               last_update = nil)
  @call_id = call_id
  @parent_call_id = parent_call_id
  @application_id = application_id
  @account_id = 
  @to = to
  @from = from
  @direction = direction
  @state = state
  @start_time = start_time
  @answer_time = answer_time
  @end_time = end_time
  @disconnect_cause = disconnect_cause
  @error_message = error_message
  @error_id = error_id
  @last_update = last_update
end

Instance Attribute Details

#account_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_id
end

#answer_timeDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def answer_time
  @answer_time
end

#application_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def application_id
  @application_id
end

#call_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def call_id
  @call_id
end

#directionString

TODO: Write general description for this method

Returns:

  • (String)


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

def direction
  @direction
end

#disconnect_causeDisconnectCauseEnum

TODO: Write general description for this method

Returns:



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

def disconnect_cause
  @disconnect_cause
end

#end_timeDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def end_time
  @end_time
end

#error_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def error_id
  @error_id
end

#error_messageString

TODO: Write general description for this method

Returns:

  • (String)


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

def error_message
  @error_message
end

#fromString

TODO: Write general description for this method

Returns:

  • (String)


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

def from
  @from
end

#last_updateDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def last_update
  @last_update
end

#parent_call_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def parent_call_id
  @parent_call_id
end

#start_timeDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def start_time
  @start_time
end

#stateStateEnum

TODO: Write general description for this method

Returns:



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

def state
  @state
end

#toString

TODO: Write general description for this method

Returns:

  • (String)


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

def to
  @to
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  call_id = hash['callId']
  parent_call_id = hash['parentCallId']
  application_id = hash['applicationId']
   = hash['accountId']
  to = hash['to']
  from = hash['from']
  direction = hash['direction']
  state = hash['state']
  start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
  answer_time = APIHelper.rfc3339(hash['answerTime']) if
    hash['answerTime']
  end_time = APIHelper.rfc3339(hash['endTime']) if hash['endTime']
  disconnect_cause = hash['disconnectCause']
  error_message = hash['errorMessage']
  error_id = hash['errorId']
  last_update = APIHelper.rfc3339(hash['lastUpdate']) if
    hash['lastUpdate']

  # Create object from extracted values.
  ApiCallStateResponse.new(call_id,
                           parent_call_id,
                           application_id,
                           ,
                           to,
                           from,
                           direction,
                           state,
                           start_time,
                           answer_time,
                           end_time,
                           disconnect_cause,
                           error_message,
                           error_id,
                           last_update)
end

.namesObject

A mapping from model property names to API property names.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb', line 71

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['call_id'] = 'callId'
  @_hash['parent_call_id'] = 'parentCallId'
  @_hash['application_id'] = 'applicationId'
  @_hash['account_id'] = 'accountId'
  @_hash['to'] = 'to'
  @_hash['from'] = 'from'
  @_hash['direction'] = 'direction'
  @_hash['state'] = 'state'
  @_hash['start_time'] = 'startTime'
  @_hash['answer_time'] = 'answerTime'
  @_hash['end_time'] = 'endTime'
  @_hash['disconnect_cause'] = 'disconnectCause'
  @_hash['error_message'] = 'errorMessage'
  @_hash['error_id'] = 'errorId'
  @_hash['last_update'] = 'lastUpdate'
  @_hash
end