Class: Bandwidth::CreateCallRequest

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

Overview

CreateCallRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(from = nil, to = nil, answer_url = nil, application_id = nil, uui = nil, call_timeout = nil, callback_timeout = nil, answer_fallback_url = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, answer_method = nil, answer_fallback_method = nil, disconnect_url = nil, disconnect_method = nil, tag = nil, machine_detection = nil, priority = nil) ⇒ CreateCallRequest

Returns a new instance of CreateCallRequest.



142
143
144
145
146
147
148
149
150
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
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 142

def initialize(from = nil,
               to = nil,
               answer_url = nil,
               application_id = nil,
               uui = nil,
               call_timeout = nil,
               callback_timeout = nil,
               answer_fallback_url = nil,
               username = nil,
               password = nil,
               fallback_username = nil,
               fallback_password = nil,
               answer_method = nil,
               answer_fallback_method = nil,
               disconnect_url = nil,
               disconnect_method = nil,
               tag = nil,
               machine_detection = nil,
               priority = nil)
  @from = from unless from == SKIP
  @to = to unless to == SKIP
  @uui = uui unless uui == 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_fallback_url = answer_fallback_url unless answer_fallback_url == 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
  @answer_method = answer_method unless answer_method == 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
  @tag = tag unless tag == SKIP
  @application_id = application_id unless application_id == SKIP
  @machine_detection = machine_detection unless machine_detection == SKIP
  @priority = priority unless priority == SKIP
end

Instance Attribute Details

#answer_fallback_methodAnswerFallbackMethodEnum



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

def answer_fallback_method
  @answer_fallback_method
end

#answer_fallback_urlString

Returns:

  • (String)


38
39
40
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 38

def answer_fallback_url
  @answer_fallback_url
end

#answer_methodAnswerMethodEnum

Returns:



53
54
55
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 53

def answer_method
  @answer_method
end

#answer_urlString

Returns:

  • (String)


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

def answer_url
  @answer_url
end

#application_idString

Returns:

  • (String)


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

def application_id
  @application_id
end

#call_timeoutFloat

Returns:

  • (Float)


29
30
31
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 29

def call_timeout
  @call_timeout
end

#callback_timeoutFloat

Returns:

  • (Float)


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

def callback_timeout
  @callback_timeout
end

#disconnect_methodDisconnectMethodEnum



62
63
64
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 62

def disconnect_method
  @disconnect_method
end

#disconnect_urlString

Returns:

  • (String)


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

def disconnect_url
  @disconnect_url
end

#fallback_passwordString

Returns:

  • (String)


50
51
52
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 50

def fallback_password
  @fallback_password
end

#fallback_usernameString

Returns:

  • (String)


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

def fallback_username
  @fallback_username
end

#fromString

Format is E164

Returns:

  • (String)


14
15
16
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 14

def from
  @from
end

#machine_detectionMachineDetectionRequest

Returns:

  • (MachineDetectionRequest)


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

def machine_detection
  @machine_detection
end

#passwordString

Returns:

  • (String)


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

def password
  @password
end

#priorityInteger

Returns:

  • (Integer)


74
75
76
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 74

def priority
  @priority
end

#tagString

Returns:

  • (String)


65
66
67
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 65

def tag
  @tag
end

#toString

Format is E164 or SIP URI

Returns:

  • (String)


18
19
20
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 18

def to
  @to
end

#usernameString

Returns:

  • (String)


41
42
43
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 41

def username
  @username
end

#uuiString

A comma-separated list of ‘User-To-User’ headers to be sent in the INVITE when calling a SIP URI. Each value must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. Only ‘jwt’ and ‘base64’ encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.

Returns:

  • (String)


26
27
28
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 26

def uui
  @uui
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



183
184
185
186
187
188
189
190
191
192
193
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
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 183

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  from = hash.key?('from') ? hash['from'] : SKIP
  to = hash.key?('to') ? hash['to'] : SKIP
  answer_url = hash.key?('answerUrl') ? hash['answerUrl'] : SKIP
  application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP
  uui = hash.key?('uui') ? hash['uui'] : SKIP
  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
  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
  answer_method = hash.key?('answerMethod') ? hash['answerMethod'] : SKIP
  answer_fallback_method =
    hash.key?('answerFallbackMethod') ? hash['answerFallbackMethod'] : SKIP
  disconnect_url = hash.key?('disconnectUrl') ? hash['disconnectUrl'] : SKIP
  disconnect_method =
    hash.key?('disconnectMethod') ? hash['disconnectMethod'] : SKIP
  tag = hash.key?('tag') ? hash['tag'] : SKIP
  machine_detection = MachineDetectionConfiguration.from_hash(hash['machineDetection']) if
    hash['machineDetection']
  priority = hash.key?('priority') ? hash['priority'] : SKIP

  # Create object from extracted values.
  CreateCallRequest.new(from,
                        to,
                        answer_url,
                        application_id,
                        uui,
                        call_timeout,
                        callback_timeout,
                        answer_fallback_url,
                        username,
                        password,
                        fallback_username,
                        fallback_password,
                        answer_method,
                        answer_fallback_method,
                        disconnect_url,
                        disconnect_method,
                        tag,
                        machine_detection,
                        priority)
end

.namesObject

A mapping from model property names to API property names.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 77

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['from'] = 'from'
  @_hash['to'] = 'to'
  @_hash['uui'] = 'uui'
  @_hash['call_timeout'] = 'callTimeout'
  @_hash['callback_timeout'] = 'callbackTimeout'
  @_hash['answer_url'] = 'answerUrl'
  @_hash['answer_fallback_url'] = 'answerFallbackUrl'
  @_hash['username'] = 'username'
  @_hash['password'] = 'password'
  @_hash['fallback_username'] = 'fallbackUsername'
  @_hash['fallback_password'] = 'fallbackPassword'
  @_hash['answer_method'] = 'answerMethod'
  @_hash['answer_fallback_method'] = 'answerFallbackMethod'
  @_hash['disconnect_url'] = 'disconnectUrl'
  @_hash['disconnect_method'] = 'disconnectMethod'
  @_hash['tag'] = 'tag'
  @_hash['application_id'] = 'applicationId'
  @_hash['machine_detection'] = 'machineDetection'
  @_hash['priority'] = 'priority'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



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

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

#optionalsObject

An array for optional fields



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

def optionals
  %w[
    uui
    call_timeout
    callback_timeout
    answer_fallback_url
    username
    password
    fallback_username
    fallback_password
    answer_method
    answer_fallback_method
    disconnect_url
    disconnect_method
    tag
    machine_detection
    priority
  ]
end