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, enqueued_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, priority = nil) ⇒ CreateCallResponse

Returns a new instance of CreateCallResponse.



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/create_call_response.rb', line 157

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,
               enqueued_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,
               priority = nil)
  @account_id =  unless  == SKIP
  @call_id = call_id unless call_id == SKIP
  @application_id = application_id unless application_id == SKIP
  @to = to unless to == SKIP
  @from = from unless from == SKIP
  @enqueued_time = enqueued_time unless enqueued_time == SKIP
  @call_url = call_url unless call_url == SKIP
  @call_timeout = call_timeout unless call_timeout == SKIP
  @callback_timeout = callback_timeout unless callback_timeout == SKIP
  @answer_url = answer_url unless answer_url == SKIP
  @answer_method = answer_method unless answer_method == SKIP
  @answer_fallback_url = answer_fallback_url unless answer_fallback_url == SKIP
  @answer_fallback_method = answer_fallback_method unless answer_fallback_method == SKIP
  @disconnect_url = disconnect_url unless disconnect_url == SKIP
  @disconnect_method = disconnect_method unless disconnect_method == SKIP
  @username = username unless username == SKIP
  @password = password unless password == SKIP
  @fallback_username = fallback_username unless fallback_username == SKIP
  @fallback_password = fallback_password unless fallback_password == SKIP
  @tag = tag unless tag == SKIP
  @priority = priority unless priority == 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/create_call_response.rb', line 15

def 
  @account_id
end

#answer_fallback_methodAnswerFallbackMethodEnum

TODO: Write general description for this method



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

def answer_fallback_method
  @answer_fallback_method
end

#answer_fallback_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def answer_fallback_url
  @answer_fallback_url
end

#answer_methodAnswerMethodEnum

TODO: Write general description for this method

Returns:



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

def answer_method
  @answer_method
end

#answer_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def answer_url
  @answer_url
end

#application_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def application_id
  @application_id
end

#call_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def call_id
  @call_id
end

#call_timeoutFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def call_timeout
  @call_timeout
end

#call_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def call_url
  @call_url
end

#callback_timeoutFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def callback_timeout
  @callback_timeout
end

#disconnect_methodDisconnectMethodEnum

TODO: Write general description for this method



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

def disconnect_method
  @disconnect_method
end

#disconnect_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def disconnect_url
  @disconnect_url
end

#enqueued_timeDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def enqueued_time
  @enqueued_time
end

#fallback_passwordString

TODO: Write general description for this method

Returns:

  • (String)


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

def fallback_password
  @fallback_password
end

#fallback_usernameString

TODO: Write general description for this method

Returns:

  • (String)


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

def fallback_username
  @fallback_username
end

#fromString

TODO: Write general description for this method

Returns:

  • (String)


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

def from
  @from
end

#passwordString

TODO: Write general description for this method

Returns:

  • (String)


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

def password
  @password
end

#priorityInteger

Returns:

  • (Integer)


94
95
96
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 94

def priority
  @priority
end

#tagString

TODO: Write general description for this method

Returns:

  • (String)


91
92
93
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 91

def tag
  @tag
end

#toString

TODO: Write general description for this method

Returns:

  • (String)


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

def to
  @to
end

#usernameString

TODO: Write general description for this method

Returns:

  • (String)


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

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 202

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

   = hash.key?('accountId') ? hash['accountId'] : SKIP
  call_id = hash.key?('callId') ? hash['callId'] : SKIP
  application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP
  to = hash.key?('to') ? hash['to'] : SKIP
  from = hash.key?('from') ? hash['from'] : SKIP
  call_url = hash.key?('callUrl') ? hash['callUrl'] : SKIP
  answer_url = hash.key?('answerUrl') ? hash['answerUrl'] : SKIP
  answer_method = hash.key?('answerMethod') ? hash['answerMethod'] : SKIP
  disconnect_method =
    hash.key?('disconnectMethod') ? hash['disconnectMethod'] : SKIP
    enqueued_time = if hash.key?('enqueuedTime')
                 (DateTimeHelper.from_rfc3339(hash['enqueuedTime']) if hash['enqueuedTime'])
               else
                 SKIP
               end
  call_timeout = hash.key?('callTimeout') ? hash['callTimeout'] : SKIP
  callback_timeout =
    hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP
  answer_fallback_url =
    hash.key?('answerFallbackUrl') ? hash['answerFallbackUrl'] : SKIP
  answer_fallback_method =
    hash.key?('answerFallbackMethod') ? hash['answerFallbackMethod'] : SKIP
  disconnect_url = hash.key?('disconnectUrl') ? hash['disconnectUrl'] : SKIP
  username = hash.key?('username') ? hash['username'] : SKIP
  password = hash.key?('password') ? hash['password'] : SKIP
  fallback_username =
    hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP
  fallback_password =
    hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP
  tag = hash.key?('tag') ? hash['tag'] : SKIP
  priority = hash.key?('priority') ? hash['priority'] : SKIP

  # Create object from extracted values.

  CreateCallResponse.new(,
                         call_id,
                         application_id,
                         to,
                         from,
                         call_url,
                         answer_url,
                         answer_method,
                         disconnect_method,
                         enqueued_time,
                         call_timeout,
                         callback_timeout,
                         answer_fallback_url,
                         answer_fallback_method,
                         disconnect_url,
                         username,
                         password,
                         fallback_username,
                         fallback_password,
                         tag,
                         priority)
end

.namesObject

A mapping from model property names to API property names.



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/create_call_response.rb', line 97

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['enqueued_time'] = 'enqueuedTime '
  @_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['priority'] = 'priority'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 142

def nullables
  %w[
    answer_fallback_url
    answer_fallback_method
    disconnect_url
    disconnect_method
    username
    password
    fallback_username
    fallback_password
    tag
    priority
  ]
end

#optionalsObject

An array for optional fields



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 124

def optionals
  %w[
    enqueued_time
    call_timeout
    callback_timeout
    answer_fallback_url
    answer_fallback_method
    disconnect_url
    username
    password
    fallback_username
    fallback_password
    tag
    priority
  ]
end

#to_enqueued_timeObject



262
263
264
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 262

def to_enqueued_time
  DateTimeHelper.to_rfc3339(enqueued_time)
end