Class: Bandwidth::CreateCallResponse

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

Overview

CreateCallResponse 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, call_id = nil, application_id = nil, to = nil, from = nil, call_url = nil, answer_url = nil, answer_method = nil, disconnect_method = nil, start_time = nil, call_timeout = nil, callback_timeout = nil, answer_fallback_url = nil, answer_fallback_method = nil, disconnect_url = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, tag = nil) ⇒ CreateCallResponse

Returns a new instance of CreateCallResponse.



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
152
153
154
155
156
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 116

def initialize( = nil,
               call_id = nil,
               application_id = nil,
               to = nil,
               from = nil,
               call_url = nil,
               answer_url = nil,
               answer_method = nil,
               disconnect_method = nil,
               start_time = nil,
               call_timeout = nil,
               callback_timeout = nil,
               answer_fallback_url = nil,
               answer_fallback_method = nil,
               disconnect_url = nil,
               username = nil,
               password = nil,
               fallback_username = nil,
               fallback_password = nil,
               tag = nil)
  @account_id = 
  @call_id = call_id
  @application_id = application_id
  @to = to
  @from = from
  @start_time = start_time
  @call_url = call_url
  @call_timeout = call_timeout
  @callback_timeout = callback_timeout
  @answer_url = answer_url
  @answer_method = answer_method
  @answer_fallback_url = answer_fallback_url
  @answer_fallback_method = answer_fallback_method
  @disconnect_url = disconnect_url
  @disconnect_method = disconnect_method
  @username = username
  @password = password
  @fallback_username = fallback_username
  @fallback_password = fallback_password
  @tag = tag
end

Instance Attribute Details

#account_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_id
end

#answer_fallback_methodAnswerFallbackMethodEnum

TODO: Write general description for this method



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

def answer_fallback_method
  @answer_fallback_method
end

#answer_fallback_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def answer_fallback_url
  @answer_fallback_url
end

#answer_methodAnswerMethodEnum

TODO: Write general description for this method

Returns:



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

def answer_method
  @answer_method
end

#answer_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def answer_url
  @answer_url
end

#application_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def application_id
  @application_id
end

#call_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def call_id
  @call_id
end

#call_timeoutFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def call_timeout
  @call_timeout
end

#call_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def call_url
  @call_url
end

#callback_timeoutFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def callback_timeout
  @callback_timeout
end

#disconnect_methodDisconnectMethodEnum

TODO: Write general description for this method



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

def disconnect_method
  @disconnect_method
end

#disconnect_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def disconnect_url
  @disconnect_url
end

#fallback_passwordString

TODO: Write general description for this method

Returns:

  • (String)


84
85
86
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 84

def fallback_password
  @fallback_password
end

#fallback_usernameString

TODO: Write general description for this method

Returns:

  • (String)


80
81
82
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 80

def fallback_username
  @fallback_username
end

#fromString

TODO: Write general description for this method

Returns:

  • (String)


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

def from
  @from
end

#passwordString

TODO: Write general description for this method

Returns:

  • (String)


76
77
78
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 76

def password
  @password
end

#start_timeDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def start_time
  @start_time
end

#tagString

TODO: Write general description for this method

Returns:

  • (String)


88
89
90
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 88

def tag
  @tag
end

#toString

TODO: Write general description for this method

Returns:

  • (String)


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

def to
  @to
end

#usernameString

TODO: Write general description for this method

Returns:

  • (String)


72
73
74
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 72

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
200
201
202
203
204
205
206
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 159

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash['accountId']
  call_id = hash['callId']
  application_id = hash['applicationId']
  to = hash['to']
  from = hash['from']
  call_url = hash['callUrl']
  answer_url = hash['answerUrl']
  answer_method = hash['answerMethod']
  disconnect_method = hash['disconnectMethod']
  start_time = DateTimeHelper.from_rfc3339(hash['startTime']) if
    hash['startTime']
  call_timeout = hash['callTimeout']
  callback_timeout = hash['callbackTimeout']
  answer_fallback_url = hash['answerFallbackUrl']
  answer_fallback_method = hash['answerFallbackMethod']
  disconnect_url = hash['disconnectUrl']
  username = hash['username']
  password = hash['password']
  fallback_username = hash['fallbackUsername']
  fallback_password = hash['fallbackPassword']
  tag = hash['tag']

  # Create object from extracted values.
  CreateCallResponse.new(,
                         call_id,
                         application_id,
                         to,
                         from,
                         call_url,
                         answer_url,
                         answer_method,
                         disconnect_method,
                         start_time,
                         call_timeout,
                         callback_timeout,
                         answer_fallback_url,
                         answer_fallback_method,
                         disconnect_url,
                         username,
                         password,
                         fallback_username,
                         fallback_password,
                         tag)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'accountId'
  @_hash['call_id'] = 'callId'
  @_hash['application_id'] = 'applicationId'
  @_hash['to'] = 'to'
  @_hash['from'] = 'from'
  @_hash['start_time'] = 'startTime'
  @_hash['call_url'] = 'callUrl'
  @_hash['call_timeout'] = 'callTimeout'
  @_hash['callback_timeout'] = 'callbackTimeout'
  @_hash['answer_url'] = 'answerUrl'
  @_hash['answer_method'] = 'answerMethod'
  @_hash['answer_fallback_url'] = 'answerFallbackUrl'
  @_hash['answer_fallback_method'] = 'answerFallbackMethod'
  @_hash['disconnect_url'] = 'disconnectUrl'
  @_hash['disconnect_method'] = 'disconnectMethod'
  @_hash['username'] = 'username'
  @_hash['password'] = 'password'
  @_hash['fallback_username'] = 'fallbackUsername'
  @_hash['fallback_password'] = 'fallbackPassword'
  @_hash['tag'] = 'tag'
  @_hash
end

Instance Method Details

#to_start_timeObject



208
209
210
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 208

def to_start_time
  DateTimeHelper.to_rfc3339(start_time)
end