bandwidth-sdk 6.1.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +89 -12
  3. data/lib/bandwidth.rb +5 -2
  4. data/lib/bandwidth/api_helper.rb +5 -17
  5. data/lib/bandwidth/client.rb +23 -9
  6. data/lib/bandwidth/configuration.rb +54 -18
  7. data/lib/bandwidth/http/auth/{two_factor_auth_basic_auth.rb → multi_factor_auth_basic_auth.rb} +3 -3
  8. data/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb +22 -0
  9. data/lib/bandwidth/http/faraday_client.rb +5 -2
  10. data/lib/bandwidth/messaging_lib/messaging/client.rb +14 -5
  11. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +25 -29
  12. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +47 -2
  13. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +5 -75
  14. data/lib/bandwidth/models/base_model.rb +19 -8
  15. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb +23 -0
  16. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/client.rb +15 -6
  17. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/controllers/base_controller.rb +0 -0
  18. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/controllers/mfa_controller.rb +7 -7
  19. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/error_with_request_exception.rb +0 -0
  20. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/forbidden_request_exception.rb +0 -0
  21. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/unauthorized_request_exception.rb +0 -0
  22. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_code_request_schema.rb +0 -0
  23. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_messaging_response.rb +0 -0
  24. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_verify_code_response.rb +0 -0
  25. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_verify_request_schema.rb +0 -0
  26. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_voice_response.rb +0 -0
  27. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb +20 -0
  28. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb +60 -0
  29. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +1551 -0
  30. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +49 -0
  31. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +29 -0
  32. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +35 -0
  33. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +45 -0
  34. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +74 -0
  35. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +107 -0
  36. data/lib/bandwidth/utilities/date_time_helper.rb +156 -0
  37. data/lib/bandwidth/voice_lib/voice.rb +14 -18
  38. data/lib/bandwidth/voice_lib/voice/client.rb +14 -5
  39. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +248 -230
  40. data/lib/bandwidth/voice_lib/voice/exceptions/{api_error_response_exception.rb → api_error_exception.rb} +2 -2
  41. data/lib/bandwidth/voice_lib/voice/models/{recording_metadata_response.rb → call_recording_metadata.rb} +47 -28
  42. data/lib/bandwidth/voice_lib/voice/models/call_state.rb +232 -0
  43. data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +2 -20
  44. data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +2 -20
  45. data/lib/bandwidth/voice_lib/voice/models/{conference_member_detail.rb → conference_member_state.rb} +8 -8
  46. data/lib/bandwidth/voice_lib/voice/models/{conference_recording_metadata_response.rb → conference_recording_metadata.rb} +34 -18
  47. data/lib/bandwidth/voice_lib/voice/models/{conference_detail.rb → conference_state.rb} +22 -14
  48. data/lib/bandwidth/voice_lib/voice/models/{api_create_call_request.rb → create_call_request.rb} +35 -59
  49. data/lib/bandwidth/voice_lib/voice/models/{api_call_response.rb → create_call_response.rb} +28 -23
  50. data/lib/bandwidth/voice_lib/voice/models/{modify_call_recording_state.rb → modify_call_recording_request.rb} +4 -4
  51. data/lib/bandwidth/voice_lib/voice/models/{api_modify_call_request.rb → modify_call_request.rb} +25 -25
  52. data/lib/bandwidth/voice_lib/voice/models/{api_modify_conference_request.rb → modify_conference_request.rb} +11 -11
  53. data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +7 -4
  54. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +4 -7
  55. data/lib/bandwidth/voice_lib/voice/models/{api_transcribe_recording_request.rb → transcribe_recording_request.rb} +8 -8
  56. data/lib/bandwidth/voice_lib/voice/models/{transcription.rb → transcription_metadata.rb} +19 -10
  57. data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +7 -2
  58. data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +14 -5
  59. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +14 -14
  60. data/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +2 -2
  61. data/test/controllers/controller_test_base.rb +21 -0
  62. data/test/http_response_catcher.rb +19 -0
  63. data/test/integration/test_integration.rb +39 -13
  64. data/test/test_helper.rb +94 -0
  65. metadata +47 -37
  66. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +0 -22
  67. data/lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb +0 -164
  68. data/lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb +0 -47
  69. data/lib/bandwidth/voice_lib/voice/models/state2_enum.rb +0 -20
  70. data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +0 -29
  71. data/lib/bandwidth/voice_lib/voice/models/status3_enum.rb +0 -32
@@ -5,8 +5,8 @@
5
5
 
6
6
  require 'date'
7
7
  module Bandwidth
8
- # ConferenceDetail Model.
9
- class ConferenceDetail < BaseModel
8
+ # ConferenceState Model.
9
+ class ConferenceState < BaseModel
10
10
  # TODO: Write general description for this method
11
11
  # @return [String]
12
12
  attr_accessor :id
@@ -36,7 +36,7 @@ module Bandwidth
36
36
  attr_accessor :tag
37
37
 
38
38
  # TODO: Write general description for this method
39
- # @return [List of ConferenceMemberDetail]
39
+ # @return [List of ConferenceMemberState]
40
40
  attr_accessor :active_members
41
41
 
42
42
  # A mapping from model property names to API property names.
@@ -78,9 +78,9 @@ module Bandwidth
78
78
  # Extract variables from the hash.
79
79
  id = hash['id']
80
80
  name = hash['name']
81
- created_time = APIHelper.rfc3339(hash['createdTime']) if
81
+ created_time = DateTimeHelper.from_rfc3339(hash['createdTime']) if
82
82
  hash['createdTime']
83
- completed_time = APIHelper.rfc3339(hash['completedTime']) if
83
+ completed_time = DateTimeHelper.from_rfc3339(hash['completedTime']) if
84
84
  hash['completedTime']
85
85
  conference_event_url = hash['conferenceEventUrl']
86
86
  conference_event_method = hash['conferenceEventMethod']
@@ -90,19 +90,27 @@ module Bandwidth
90
90
  unless hash['activeMembers'].nil?
91
91
  active_members = []
92
92
  hash['activeMembers'].each do |structure|
93
- active_members << (ConferenceMemberDetail.from_hash(structure) if structure)
93
+ active_members << (ConferenceMemberState.from_hash(structure) if structure)
94
94
  end
95
95
  end
96
96
 
97
97
  # Create object from extracted values.
98
- ConferenceDetail.new(id,
99
- name,
100
- created_time,
101
- completed_time,
102
- conference_event_url,
103
- conference_event_method,
104
- tag,
105
- active_members)
98
+ ConferenceState.new(id,
99
+ name,
100
+ created_time,
101
+ completed_time,
102
+ conference_event_url,
103
+ conference_event_method,
104
+ tag,
105
+ active_members)
106
+ end
107
+
108
+ def to_created_time
109
+ DateTimeHelper.to_rfc3339(created_time)
110
+ end
111
+
112
+ def to_completed_time
113
+ DateTimeHelper.to_rfc3339(completed_time)
106
114
  end
107
115
  end
108
116
  end
@@ -4,8 +4,8 @@
4
4
  # ( https://apimatic.io ).
5
5
 
6
6
  module Bandwidth
7
- # ApiCreateCallRequest Model.
8
- class ApiCreateCallRequest < BaseModel
7
+ # CreateCallRequest Model.
8
+ class CreateCallRequest < BaseModel
9
9
  # Format is E164
10
10
  # @return [String]
11
11
  attr_accessor :from
@@ -15,124 +15,110 @@ module Bandwidth
15
15
  attr_accessor :to
16
16
 
17
17
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
18
- # within the initial INVITE. An 'encoding' parameter must be specified as
18
+ # within the initial INVITE. It must end with an 'encoding' parameter as
19
19
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
20
20
  # exceed 256 characters, including the encoding parameter.
21
21
  # @return [String]
22
22
  attr_accessor :uui
23
23
 
24
24
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
25
- # within the initial INVITE. An 'encoding' parameter must be specified as
25
+ # within the initial INVITE. It must end with an 'encoding' parameter as
26
26
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
27
27
  # exceed 256 characters, including the encoding parameter.
28
28
  # @return [Float]
29
29
  attr_accessor :call_timeout
30
30
 
31
31
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
32
- # within the initial INVITE. An 'encoding' parameter must be specified as
32
+ # within the initial INVITE. It must end with an 'encoding' parameter as
33
33
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
34
34
  # exceed 256 characters, including the encoding parameter.
35
35
  # @return [Float]
36
36
  attr_accessor :callback_timeout
37
37
 
38
38
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
39
- # within the initial INVITE. An 'encoding' parameter must be specified as
39
+ # within the initial INVITE. It must end with an 'encoding' parameter as
40
40
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
41
41
  # exceed 256 characters, including the encoding parameter.
42
42
  # @return [String]
43
43
  attr_accessor :answer_url
44
44
 
45
45
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
46
- # within the initial INVITE. An 'encoding' parameter must be specified as
46
+ # within the initial INVITE. It must end with an 'encoding' parameter as
47
47
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
48
48
  # exceed 256 characters, including the encoding parameter.
49
49
  # @return [String]
50
50
  attr_accessor :answer_fallback_url
51
51
 
52
52
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
53
- # within the initial INVITE. An 'encoding' parameter must be specified as
53
+ # within the initial INVITE. It must end with an 'encoding' parameter as
54
54
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
55
55
  # exceed 256 characters, including the encoding parameter.
56
56
  # @return [String]
57
57
  attr_accessor :username
58
58
 
59
59
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
60
- # within the initial INVITE. An 'encoding' parameter must be specified as
60
+ # within the initial INVITE. It must end with an 'encoding' parameter as
61
61
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
62
62
  # exceed 256 characters, including the encoding parameter.
63
63
  # @return [String]
64
64
  attr_accessor :password
65
65
 
66
66
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
67
- # within the initial INVITE. An 'encoding' parameter must be specified as
67
+ # within the initial INVITE. It must end with an 'encoding' parameter as
68
68
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
69
69
  # exceed 256 characters, including the encoding parameter.
70
70
  # @return [String]
71
71
  attr_accessor :fallback_username
72
72
 
73
73
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
74
- # within the initial INVITE. An 'encoding' parameter must be specified as
74
+ # within the initial INVITE. It must end with an 'encoding' parameter as
75
75
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
76
76
  # exceed 256 characters, including the encoding parameter.
77
77
  # @return [String]
78
78
  attr_accessor :fallback_password
79
79
 
80
80
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
81
- # within the initial INVITE. An 'encoding' parameter must be specified as
81
+ # within the initial INVITE. It must end with an 'encoding' parameter as
82
82
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
83
83
  # exceed 256 characters, including the encoding parameter.
84
84
  # @return [AnswerMethodEnum]
85
85
  attr_accessor :answer_method
86
86
 
87
87
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
88
- # within the initial INVITE. An 'encoding' parameter must be specified as
88
+ # within the initial INVITE. It must end with an 'encoding' parameter as
89
89
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
90
90
  # exceed 256 characters, including the encoding parameter.
91
91
  # @return [AnswerFallbackMethodEnum]
92
92
  attr_accessor :answer_fallback_method
93
93
 
94
94
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
95
- # within the initial INVITE. An 'encoding' parameter must be specified as
95
+ # within the initial INVITE. It must end with an 'encoding' parameter as
96
96
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
97
97
  # exceed 256 characters, including the encoding parameter.
98
98
  # @return [String]
99
99
  attr_accessor :disconnect_url
100
100
 
101
101
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
102
- # within the initial INVITE. An 'encoding' parameter must be specified as
102
+ # within the initial INVITE. It must end with an 'encoding' parameter as
103
103
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
104
104
  # exceed 256 characters, including the encoding parameter.
105
105
  # @return [DisconnectMethodEnum]
106
106
  attr_accessor :disconnect_method
107
107
 
108
108
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
109
- # within the initial INVITE. An 'encoding' parameter must be specified as
109
+ # within the initial INVITE. It must end with an 'encoding' parameter as
110
110
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
111
111
  # exceed 256 characters, including the encoding parameter.
112
112
  # @return [String]
113
113
  attr_accessor :tag
114
114
 
115
115
  # When calling a SIP URI, this will be sent as the 'User-To-User' header
116
- # within the initial INVITE. An 'encoding' parameter must be specified as
116
+ # within the initial INVITE. It must end with an 'encoding' parameter as
117
117
  # described in https://tools.ietf.org/html/rfc7433. This header cannot
118
118
  # exceed 256 characters, including the encoding parameter.
119
119
  # @return [String]
120
120
  attr_accessor :application_id
121
121
 
122
- # When calling a SIP URI, this will be sent as the 'User-To-User' header
123
- # within the initial INVITE. An 'encoding' parameter must be specified as
124
- # described in https://tools.ietf.org/html/rfc7433. This header cannot
125
- # exceed 256 characters, including the encoding parameter.
126
- # @return [String]
127
- attr_accessor :obfuscated_to
128
-
129
- # When calling a SIP URI, this will be sent as the 'User-To-User' header
130
- # within the initial INVITE. An 'encoding' parameter must be specified as
131
- # described in https://tools.ietf.org/html/rfc7433. This header cannot
132
- # exceed 256 characters, including the encoding parameter.
133
- # @return [String]
134
- attr_accessor :obfuscated_from
135
-
136
122
  # A mapping from model property names to API property names.
137
123
  def self.names
138
124
  @_hash = {} if @_hash.nil?
@@ -153,8 +139,6 @@ module Bandwidth
153
139
  @_hash['disconnect_method'] = 'disconnectMethod'
154
140
  @_hash['tag'] = 'tag'
155
141
  @_hash['application_id'] = 'applicationId'
156
- @_hash['obfuscated_to'] = 'obfuscatedTo'
157
- @_hash['obfuscated_from'] = 'obfuscatedFrom'
158
142
  @_hash
159
143
  end
160
144
 
@@ -174,9 +158,7 @@ module Bandwidth
174
158
  answer_fallback_method = nil,
175
159
  disconnect_url = nil,
176
160
  disconnect_method = nil,
177
- tag = nil,
178
- obfuscated_to = nil,
179
- obfuscated_from = nil)
161
+ tag = nil)
180
162
  @from = from
181
163
  @to = to
182
164
  @uui = uui
@@ -194,8 +176,6 @@ module Bandwidth
194
176
  @disconnect_method = disconnect_method
195
177
  @tag = tag
196
178
  @application_id = application_id
197
- @obfuscated_to = obfuscated_to
198
- @obfuscated_from = obfuscated_from
199
179
  end
200
180
 
201
181
  # Creates an instance of the object from a hash.
@@ -220,29 +200,25 @@ module Bandwidth
220
200
  disconnect_url = hash['disconnectUrl']
221
201
  disconnect_method = hash['disconnectMethod']
222
202
  tag = hash['tag']
223
- obfuscated_to = hash['obfuscatedTo']
224
- obfuscated_from = hash['obfuscatedFrom']
225
203
 
226
204
  # Create object from extracted values.
227
- ApiCreateCallRequest.new(from,
228
- to,
229
- answer_url,
230
- application_id,
231
- uui,
232
- call_timeout,
233
- callback_timeout,
234
- answer_fallback_url,
235
- username,
236
- password,
237
- fallback_username,
238
- fallback_password,
239
- answer_method,
240
- answer_fallback_method,
241
- disconnect_url,
242
- disconnect_method,
243
- tag,
244
- obfuscated_to,
245
- obfuscated_from)
205
+ CreateCallRequest.new(from,
206
+ to,
207
+ answer_url,
208
+ application_id,
209
+ uui,
210
+ call_timeout,
211
+ callback_timeout,
212
+ answer_fallback_url,
213
+ username,
214
+ password,
215
+ fallback_username,
216
+ fallback_password,
217
+ answer_method,
218
+ answer_fallback_method,
219
+ disconnect_url,
220
+ disconnect_method,
221
+ tag)
246
222
  end
247
223
  end
248
224
  end
@@ -5,8 +5,8 @@
5
5
 
6
6
  require 'date'
7
7
  module Bandwidth
8
- # ApiCallResponse Model.
9
- class ApiCallResponse < BaseModel
8
+ # CreateCallResponse Model.
9
+ class CreateCallResponse < BaseModel
10
10
  # TODO: Write general description for this method
11
11
  # @return [String]
12
12
  attr_accessor :account_id
@@ -169,7 +169,8 @@ module Bandwidth
169
169
  answer_url = hash['answerUrl']
170
170
  answer_method = hash['answerMethod']
171
171
  disconnect_method = hash['disconnectMethod']
172
- start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
172
+ start_time = DateTimeHelper.from_rfc3339(hash['startTime']) if
173
+ hash['startTime']
173
174
  call_timeout = hash['callTimeout']
174
175
  callback_timeout = hash['callbackTimeout']
175
176
  answer_fallback_url = hash['answerFallbackUrl']
@@ -182,26 +183,30 @@ module Bandwidth
182
183
  tag = hash['tag']
183
184
 
184
185
  # Create object from extracted values.
185
- ApiCallResponse.new(account_id,
186
- call_id,
187
- application_id,
188
- to,
189
- from,
190
- call_url,
191
- answer_url,
192
- answer_method,
193
- disconnect_method,
194
- start_time,
195
- call_timeout,
196
- callback_timeout,
197
- answer_fallback_url,
198
- answer_fallback_method,
199
- disconnect_url,
200
- username,
201
- password,
202
- fallback_username,
203
- fallback_password,
204
- tag)
186
+ CreateCallResponse.new(account_id,
187
+ call_id,
188
+ application_id,
189
+ to,
190
+ from,
191
+ call_url,
192
+ answer_url,
193
+ answer_method,
194
+ disconnect_method,
195
+ start_time,
196
+ call_timeout,
197
+ callback_timeout,
198
+ answer_fallback_url,
199
+ answer_fallback_method,
200
+ disconnect_url,
201
+ username,
202
+ password,
203
+ fallback_username,
204
+ fallback_password,
205
+ tag)
206
+ end
207
+
208
+ def to_start_time
209
+ DateTimeHelper.to_rfc3339(start_time)
205
210
  end
206
211
  end
207
212
  end
@@ -4,10 +4,10 @@
4
4
  # ( https://apimatic.io ).
5
5
 
6
6
  module Bandwidth
7
- # ModifyCallRecordingState Model.
8
- class ModifyCallRecordingState < BaseModel
7
+ # ModifyCallRecordingRequest Model.
8
+ class ModifyCallRecordingRequest < BaseModel
9
9
  # TODO: Write general description for this method
10
- # @return [State2Enum]
10
+ # @return [State1Enum]
11
11
  attr_accessor :state
12
12
 
13
13
  # A mapping from model property names to API property names.
@@ -29,7 +29,7 @@ module Bandwidth
29
29
  state = hash['state']
30
30
 
31
31
  # Create object from extracted values.
32
- ModifyCallRecordingState.new(state)
32
+ ModifyCallRecordingRequest.new(state)
33
33
  end
34
34
  end
35
35
  end
@@ -4,45 +4,45 @@
4
4
  # ( https://apimatic.io ).
5
5
 
6
6
  module Bandwidth
7
- # ApiModifyCallRequest Model.
8
- class ApiModifyCallRequest < BaseModel
7
+ # ModifyCallRequest Model.
8
+ class ModifyCallRequest < BaseModel
9
9
  # TODO: Write general description for this method
10
- # @return [State1Enum]
10
+ # @return [StateEnum]
11
11
  attr_accessor :state
12
12
 
13
- # TODO: Write general description for this method
13
+ # Required if state is 'active'
14
14
  # @return [String]
15
15
  attr_accessor :redirect_url
16
16
 
17
- # TODO: Write general description for this method
17
+ # Required if state is 'active'
18
18
  # @return [String]
19
19
  attr_accessor :redirect_fallback_url
20
20
 
21
- # TODO: Write general description for this method
21
+ # Required if state is 'active'
22
22
  # @return [RedirectMethodEnum]
23
23
  attr_accessor :redirect_method
24
24
 
25
- # TODO: Write general description for this method
25
+ # Required if state is 'active'
26
26
  # @return [RedirectFallbackMethodEnum]
27
27
  attr_accessor :redirect_fallback_method
28
28
 
29
- # TODO: Write general description for this method
29
+ # Required if state is 'active'
30
30
  # @return [String]
31
31
  attr_accessor :username
32
32
 
33
- # TODO: Write general description for this method
33
+ # Required if state is 'active'
34
34
  # @return [String]
35
35
  attr_accessor :password
36
36
 
37
- # TODO: Write general description for this method
37
+ # Required if state is 'active'
38
38
  # @return [String]
39
39
  attr_accessor :fallback_username
40
40
 
41
- # TODO: Write general description for this method
41
+ # Required if state is 'active'
42
42
  # @return [String]
43
43
  attr_accessor :fallback_password
44
44
 
45
- # TODO: Write general description for this method
45
+ # Required if state is 'active'
46
46
  # @return [String]
47
47
  attr_accessor :tag
48
48
 
@@ -62,8 +62,8 @@ module Bandwidth
62
62
  @_hash
63
63
  end
64
64
 
65
- def initialize(redirect_url = nil,
66
- state = nil,
65
+ def initialize(state = StateEnum::ACTIVE,
66
+ redirect_url = nil,
67
67
  redirect_fallback_url = nil,
68
68
  redirect_method = nil,
69
69
  redirect_fallback_method = nil,
@@ -89,8 +89,8 @@ module Bandwidth
89
89
  return nil unless hash
90
90
 
91
91
  # Extract variables from the hash.
92
+ state = hash['state'] ||= StateEnum::ACTIVE
92
93
  redirect_url = hash['redirectUrl']
93
- state = hash['state']
94
94
  redirect_fallback_url = hash['redirectFallbackUrl']
95
95
  redirect_method = hash['redirectMethod']
96
96
  redirect_fallback_method = hash['redirectFallbackMethod']
@@ -101,16 +101,16 @@ module Bandwidth
101
101
  tag = hash['tag']
102
102
 
103
103
  # Create object from extracted values.
104
- ApiModifyCallRequest.new(redirect_url,
105
- state,
106
- redirect_fallback_url,
107
- redirect_method,
108
- redirect_fallback_method,
109
- username,
110
- password,
111
- fallback_username,
112
- fallback_password,
113
- tag)
104
+ ModifyCallRequest.new(state,
105
+ redirect_url,
106
+ redirect_fallback_url,
107
+ redirect_method,
108
+ redirect_fallback_method,
109
+ username,
110
+ password,
111
+ fallback_username,
112
+ fallback_password,
113
+ tag)
114
114
  end
115
115
  end
116
116
  end