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.



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
186
187
188
189
190
191
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 151

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 =  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
  @start_time = start_time unless start_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
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

#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

#start_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 start_time
  @start_time
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.



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
241
242
243
244
245
246
247
248
249
250
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 194

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
  start_time = if hash.key?('startTime')
                 (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime'])
               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

  # 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.



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

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

#nullablesObject

An array for nullable fields



137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 137

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

#optionalsObject

An array for optional fields



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 120

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

#to_start_timeObject



252
253
254
# File 'lib/bandwidth/voice_lib/voice/models/create_call_response.rb', line 252

def to_start_time
  DateTimeHelper.to_rfc3339(start_time)
end