bandwidth-sdk 8.0.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bandwidth/api_helper.rb +19 -17
  3. data/lib/bandwidth/configuration.rb +7 -19
  4. data/lib/bandwidth/http/faraday_client.rb +1 -1
  5. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +53 -42
  6. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +3 -5
  7. data/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb +5 -2
  8. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb +31 -11
  9. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +54 -25
  10. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +65 -32
  11. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +23 -4
  12. data/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb +20 -4
  13. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +23 -6
  14. data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +32 -14
  15. data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +28 -8
  16. data/lib/bandwidth/messaging_lib/messaging/models/tag.rb +20 -4
  17. data/lib/bandwidth/models/base_model.rb +11 -0
  18. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb +3 -5
  19. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb +21 -16
  20. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb +5 -2
  21. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb +4 -1
  22. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb +4 -1
  23. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb +27 -12
  24. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb +17 -2
  25. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb +17 -2
  26. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb +29 -10
  27. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb +17 -2
  28. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +212 -210
  29. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +3 -5
  30. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +4 -1
  31. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +17 -2
  32. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +20 -4
  33. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +28 -7
  34. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +43 -18
  35. data/lib/bandwidth/utilities/date_time_helper.rb +2 -2
  36. data/lib/bandwidth/utilities/file_wrapper.rb +1 -2
  37. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +171 -150
  38. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +3 -5
  39. data/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb +6 -3
  40. data/lib/bandwidth/voice_lib/voice/models/call_callback.rb +343 -0
  41. data/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb +78 -37
  42. data/lib/bandwidth/voice_lib/voice/models/call_state.rb +94 -42
  43. data/lib/bandwidth/voice_lib/voice/models/conference_callback.rb +211 -0
  44. data/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb +35 -12
  45. data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb +55 -24
  46. data/lib/bandwidth/voice_lib/voice/models/conference_state.rb +54 -17
  47. data/lib/bandwidth/voice_lib/voice/models/create_call_request.rb +173 -96
  48. data/lib/bandwidth/voice_lib/voice/models/create_call_response.rb +85 -41
  49. data/lib/bandwidth/voice_lib/voice/models/diversion.rb +80 -0
  50. data/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb +17 -0
  51. data/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb +218 -0
  52. data/lib/bandwidth/voice_lib/voice/models/mode_enum.rb +20 -0
  53. data/lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb +15 -2
  54. data/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb +59 -19
  55. data/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb +55 -18
  56. data/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb +40 -12
  57. data/lib/bandwidth/voice_lib/voice/models/transcript.rb +20 -4
  58. data/lib/bandwidth/voice_lib/voice/models/transcription.rb +80 -0
  59. data/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb +26 -8
  60. data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +18 -1
  61. data/lib/bandwidth/voice_lib/voice.rb +7 -1
  62. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +61 -50
  63. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +3 -5
  64. data/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +5 -2
  65. data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +20 -5
  66. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +37 -14
  67. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +15 -2
  68. data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +20 -4
  69. data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +20 -3
  70. data/lib/bandwidth.rb +19 -18
  71. data/test/integration/test_integration.rb +75 -53
  72. metadata +9 -2
@@ -0,0 +1,218 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # MachineDetectionConfiguration Model.
8
+ class MachineDetectionConfiguration < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The machine detection mode. If set to 'async', the detection result will
13
+ # be sent in a 'machineDetectionComplete' callback. If set to 'sync', the
14
+ # 'answer' callback will wait for the machine detection to complete and will
15
+ # include its result. Default is 'async'.
16
+ # @return [ModeEnum]
17
+ attr_accessor :mode
18
+
19
+ # Total amount of time (in seconds) before giving up.
20
+ # @return [Float]
21
+ attr_accessor :detection_timeout
22
+
23
+ # If no speech is detected in this period, a callback with a 'silence'
24
+ # result is sent. Default is 10 seconds.
25
+ # @return [Float]
26
+ attr_accessor :silence_timeout
27
+
28
+ # When speech has ended and a result couldn't be determined based on the
29
+ # audio content itself, this value is used to determine if the speaker is a
30
+ # machine based on the speech duration. If the length of the speech detected
31
+ # is greater than or equal to this threshold, the result will be
32
+ # 'answering-machine'. If the length of speech detected is below this
33
+ # threshold, the result will be 'human'. Default is 10 seconds.
34
+ # @return [Float]
35
+ attr_accessor :speech_threshold
36
+
37
+ # Amount of silence (in seconds) before assuming the callee has finished
38
+ # speaking.
39
+ # @return [Float]
40
+ attr_accessor :speech_end_threshold
41
+
42
+ # If set to 'true' and if an answering machine is detected, the
43
+ # 'answering-machine' callback will be delayed until the machine is done
44
+ # speaking or until the 'detectionTimeout' is exceeded. If false, the
45
+ # 'answering-machine' result is sent immediately. Default is 'false'.
46
+ # @return [Boolean]
47
+ attr_accessor :delay_result
48
+
49
+ # The URL to send the 'machineDetectionComplete' callback when the detection
50
+ # is completed. Only for 'async' mode.
51
+ # @return [String]
52
+ attr_accessor :callback_url
53
+
54
+ # The URL to send the 'machineDetectionComplete' callback when the detection
55
+ # is completed. Only for 'async' mode.
56
+ # @return [CallbackMethodEnum]
57
+ attr_accessor :callback_method
58
+
59
+ # The URL to send the 'machineDetectionComplete' callback when the detection
60
+ # is completed. Only for 'async' mode.
61
+ # @return [String]
62
+ attr_accessor :fallback_url
63
+
64
+ # The URL to send the 'machineDetectionComplete' callback when the detection
65
+ # is completed. Only for 'async' mode.
66
+ # @return [FallbackMethodEnum]
67
+ attr_accessor :fallback_method
68
+
69
+ # The URL to send the 'machineDetectionComplete' callback when the detection
70
+ # is completed. Only for 'async' mode.
71
+ # @return [String]
72
+ attr_accessor :username
73
+
74
+ # The URL to send the 'machineDetectionComplete' callback when the detection
75
+ # is completed. Only for 'async' mode.
76
+ # @return [String]
77
+ attr_accessor :password
78
+
79
+ # The URL to send the 'machineDetectionComplete' callback when the detection
80
+ # is completed. Only for 'async' mode.
81
+ # @return [String]
82
+ attr_accessor :fallback_username
83
+
84
+ # The URL to send the 'machineDetectionComplete' callback when the detection
85
+ # is completed. Only for 'async' mode.
86
+ # @return [String]
87
+ attr_accessor :fallback_password
88
+
89
+ # A mapping from model property names to API property names.
90
+ def self.names
91
+ @_hash = {} if @_hash.nil?
92
+ @_hash['mode'] = 'mode'
93
+ @_hash['detection_timeout'] = 'detectionTimeout'
94
+ @_hash['silence_timeout'] = 'silenceTimeout'
95
+ @_hash['speech_threshold'] = 'speechThreshold'
96
+ @_hash['speech_end_threshold'] = 'speechEndThreshold'
97
+ @_hash['delay_result'] = 'delayResult'
98
+ @_hash['callback_url'] = 'callbackUrl'
99
+ @_hash['callback_method'] = 'callbackMethod'
100
+ @_hash['fallback_url'] = 'fallbackUrl'
101
+ @_hash['fallback_method'] = 'fallbackMethod'
102
+ @_hash['username'] = 'username'
103
+ @_hash['password'] = 'password'
104
+ @_hash['fallback_username'] = 'fallbackUsername'
105
+ @_hash['fallback_password'] = 'fallbackPassword'
106
+ @_hash
107
+ end
108
+
109
+ # An array for optional fields
110
+ def optionals
111
+ %w[
112
+ mode
113
+ detection_timeout
114
+ silence_timeout
115
+ speech_threshold
116
+ speech_end_threshold
117
+ delay_result
118
+ callback_url
119
+ callback_method
120
+ fallback_url
121
+ fallback_method
122
+ username
123
+ password
124
+ fallback_username
125
+ fallback_password
126
+ ]
127
+ end
128
+
129
+ # An array for nullable fields
130
+ def nullables
131
+ %w[
132
+ callback_url
133
+ callback_method
134
+ fallback_url
135
+ fallback_method
136
+ username
137
+ password
138
+ fallback_username
139
+ fallback_password
140
+ ]
141
+ end
142
+
143
+ def initialize(mode = nil,
144
+ detection_timeout = nil,
145
+ silence_timeout = nil,
146
+ speech_threshold = nil,
147
+ speech_end_threshold = nil,
148
+ delay_result = nil,
149
+ callback_url = nil,
150
+ callback_method = nil,
151
+ fallback_url = nil,
152
+ fallback_method = nil,
153
+ username = nil,
154
+ password = nil,
155
+ fallback_username = nil,
156
+ fallback_password = nil)
157
+ @mode = mode unless mode == SKIP
158
+ @detection_timeout = detection_timeout unless detection_timeout == SKIP
159
+ @silence_timeout = silence_timeout unless silence_timeout == SKIP
160
+ @speech_threshold = speech_threshold unless speech_threshold == SKIP
161
+ @speech_end_threshold = speech_end_threshold unless speech_end_threshold == SKIP
162
+ @delay_result = delay_result unless delay_result == SKIP
163
+ @callback_url = callback_url unless callback_url == SKIP
164
+ @callback_method = callback_method unless callback_method == SKIP
165
+ @fallback_url = fallback_url unless fallback_url == SKIP
166
+ @fallback_method = fallback_method unless fallback_method == SKIP
167
+ @username = username unless username == SKIP
168
+ @password = password unless password == SKIP
169
+ @fallback_username = fallback_username unless fallback_username == SKIP
170
+ @fallback_password = fallback_password unless fallback_password == SKIP
171
+ end
172
+
173
+ # Creates an instance of the object from a hash.
174
+ def self.from_hash(hash)
175
+ return nil unless hash
176
+
177
+ # Extract variables from the hash.
178
+ mode = hash.key?('mode') ? hash['mode'] : SKIP
179
+ detection_timeout =
180
+ hash.key?('detectionTimeout') ? hash['detectionTimeout'] : SKIP
181
+ silence_timeout =
182
+ hash.key?('silenceTimeout') ? hash['silenceTimeout'] : SKIP
183
+ speech_threshold =
184
+ hash.key?('speechThreshold') ? hash['speechThreshold'] : SKIP
185
+ speech_end_threshold =
186
+ hash.key?('speechEndThreshold') ? hash['speechEndThreshold'] : SKIP
187
+ delay_result = hash.key?('delayResult') ? hash['delayResult'] : SKIP
188
+ callback_url = hash.key?('callbackUrl') ? hash['callbackUrl'] : SKIP
189
+ callback_method =
190
+ hash.key?('callbackMethod') ? hash['callbackMethod'] : SKIP
191
+ fallback_url = hash.key?('fallbackUrl') ? hash['fallbackUrl'] : SKIP
192
+ fallback_method =
193
+ hash.key?('fallbackMethod') ? hash['fallbackMethod'] : SKIP
194
+ username = hash.key?('username') ? hash['username'] : SKIP
195
+ password = hash.key?('password') ? hash['password'] : SKIP
196
+ fallback_username =
197
+ hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP
198
+ fallback_password =
199
+ hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP
200
+
201
+ # Create object from extracted values.
202
+ MachineDetectionConfiguration.new(mode,
203
+ detection_timeout,
204
+ silence_timeout,
205
+ speech_threshold,
206
+ speech_end_threshold,
207
+ delay_result,
208
+ callback_url,
209
+ callback_method,
210
+ fallback_url,
211
+ fallback_method,
212
+ username,
213
+ password,
214
+ fallback_username,
215
+ fallback_password)
216
+ end
217
+ end
218
+ end
@@ -0,0 +1,20 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # The machine detection mode. If set to 'async', the detection result will be
8
+ # sent in a 'machineDetectionComplete' callback. If set to 'sync', the
9
+ # 'answer' callback will wait for the machine detection to complete and will
10
+ # include its result. Default is 'async'.
11
+ class ModeEnum
12
+ MODE_ENUM = [
13
+ # TODO: Write general description for SYNC
14
+ SYNC = 'sync'.freeze,
15
+
16
+ # TODO: Write general description for ASYNC
17
+ ASYNC = 'async'.freeze
18
+ ].freeze
19
+ end
20
+ end
@@ -6,6 +6,9 @@
6
6
  module Bandwidth
7
7
  # ModifyCallRecordingRequest Model.
8
8
  class ModifyCallRecordingRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
9
12
  # TODO: Write general description for this method
10
13
  # @return [State1Enum]
11
14
  attr_accessor :state
@@ -17,8 +20,18 @@ module Bandwidth
17
20
  @_hash
18
21
  end
19
22
 
23
+ # An array for optional fields
24
+ def optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def nullables
30
+ []
31
+ end
32
+
20
33
  def initialize(state = nil)
21
- @state = state
34
+ @state = state unless state == SKIP
22
35
  end
23
36
 
24
37
  # Creates an instance of the object from a hash.
@@ -26,7 +39,7 @@ module Bandwidth
26
39
  return nil unless hash
27
40
 
28
41
  # Extract variables from the hash.
29
- state = hash['state']
42
+ state = hash.key?('state') ? hash['state'] : SKIP
30
43
 
31
44
  # Create object from extracted values.
32
45
  ModifyCallRecordingRequest.new(state)
@@ -6,6 +6,9 @@
6
6
  module Bandwidth
7
7
  # ModifyCallRequest Model.
8
8
  class ModifyCallRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
9
12
  # TODO: Write general description for this method
10
13
  # @return [StateEnum]
11
14
  attr_accessor :state
@@ -62,6 +65,38 @@ module Bandwidth
62
65
  @_hash
63
66
  end
64
67
 
68
+ # An array for optional fields
69
+ def optionals
70
+ %w[
71
+ state
72
+ redirect_url
73
+ redirect_fallback_url
74
+ redirect_method
75
+ redirect_fallback_method
76
+ username
77
+ password
78
+ fallback_username
79
+ fallback_password
80
+ tag
81
+ ]
82
+ end
83
+
84
+ # An array for nullable fields
85
+ def nullables
86
+ %w[
87
+ state
88
+ redirect_url
89
+ redirect_fallback_url
90
+ redirect_method
91
+ redirect_fallback_method
92
+ username
93
+ password
94
+ fallback_username
95
+ fallback_password
96
+ tag
97
+ ]
98
+ end
99
+
65
100
  def initialize(state = StateEnum::ACTIVE,
66
101
  redirect_url = nil,
67
102
  redirect_fallback_url = nil,
@@ -72,16 +107,16 @@ module Bandwidth
72
107
  fallback_username = nil,
73
108
  fallback_password = nil,
74
109
  tag = nil)
75
- @state = state
76
- @redirect_url = redirect_url
77
- @redirect_fallback_url = redirect_fallback_url
78
- @redirect_method = redirect_method
79
- @redirect_fallback_method = redirect_fallback_method
80
- @username = username
81
- @password = password
82
- @fallback_username = fallback_username
83
- @fallback_password = fallback_password
84
- @tag = tag
110
+ @state = state unless state == SKIP
111
+ @redirect_url = redirect_url unless redirect_url == SKIP
112
+ @redirect_fallback_url = redirect_fallback_url unless redirect_fallback_url == SKIP
113
+ @redirect_method = redirect_method unless redirect_method == SKIP
114
+ @redirect_fallback_method = redirect_fallback_method unless redirect_fallback_method == SKIP
115
+ @username = username unless username == SKIP
116
+ @password = password unless password == SKIP
117
+ @fallback_username = fallback_username unless fallback_username == SKIP
118
+ @fallback_password = fallback_password unless fallback_password == SKIP
119
+ @tag = tag unless tag == SKIP
85
120
  end
86
121
 
87
122
  # Creates an instance of the object from a hash.
@@ -90,15 +125,20 @@ module Bandwidth
90
125
 
91
126
  # Extract variables from the hash.
92
127
  state = hash['state'] ||= StateEnum::ACTIVE
93
- redirect_url = hash['redirectUrl']
94
- redirect_fallback_url = hash['redirectFallbackUrl']
95
- redirect_method = hash['redirectMethod']
96
- redirect_fallback_method = hash['redirectFallbackMethod']
97
- username = hash['username']
98
- password = hash['password']
99
- fallback_username = hash['fallbackUsername']
100
- fallback_password = hash['fallbackPassword']
101
- tag = hash['tag']
128
+ redirect_url = hash.key?('redirectUrl') ? hash['redirectUrl'] : SKIP
129
+ redirect_fallback_url =
130
+ hash.key?('redirectFallbackUrl') ? hash['redirectFallbackUrl'] : SKIP
131
+ redirect_method =
132
+ hash.key?('redirectMethod') ? hash['redirectMethod'] : SKIP
133
+ redirect_fallback_method =
134
+ hash.key?('redirectFallbackMethod') ? hash['redirectFallbackMethod'] : SKIP
135
+ username = hash.key?('username') ? hash['username'] : SKIP
136
+ password = hash.key?('password') ? hash['password'] : SKIP
137
+ fallback_username =
138
+ hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP
139
+ fallback_password =
140
+ hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP
141
+ tag = hash.key?('tag') ? hash['tag'] : SKIP
102
142
 
103
143
  # Create object from extracted values.
104
144
  ModifyCallRequest.new(state,
@@ -6,6 +6,9 @@
6
6
  module Bandwidth
7
7
  # ModifyConferenceRequest Model.
8
8
  class ModifyConferenceRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
9
12
  # TODO: Write general description for this method
10
13
  # @return [StatusEnum]
11
14
  attr_accessor :status
@@ -57,6 +60,35 @@ module Bandwidth
57
60
  @_hash
58
61
  end
59
62
 
63
+ # An array for optional fields
64
+ def optionals
65
+ %w[
66
+ status
67
+ redirect_url
68
+ redirect_fallback_url
69
+ redirect_method
70
+ redirect_fallback_method
71
+ username
72
+ password
73
+ fallback_username
74
+ fallback_password
75
+ ]
76
+ end
77
+
78
+ # An array for nullable fields
79
+ def nullables
80
+ %w[
81
+ redirect_url
82
+ redirect_fallback_url
83
+ redirect_method
84
+ redirect_fallback_method
85
+ username
86
+ password
87
+ fallback_username
88
+ fallback_password
89
+ ]
90
+ end
91
+
60
92
  def initialize(status = nil,
61
93
  redirect_url = nil,
62
94
  redirect_fallback_url = nil,
@@ -66,15 +98,15 @@ module Bandwidth
66
98
  password = nil,
67
99
  fallback_username = nil,
68
100
  fallback_password = nil)
69
- @status = status
70
- @redirect_url = redirect_url
71
- @redirect_fallback_url = redirect_fallback_url
72
- @redirect_method = redirect_method
73
- @redirect_fallback_method = redirect_fallback_method
74
- @username = username
75
- @password = password
76
- @fallback_username = fallback_username
77
- @fallback_password = fallback_password
101
+ @status = status unless status == SKIP
102
+ @redirect_url = redirect_url unless redirect_url == SKIP
103
+ @redirect_fallback_url = redirect_fallback_url unless redirect_fallback_url == SKIP
104
+ @redirect_method = redirect_method unless redirect_method == SKIP
105
+ @redirect_fallback_method = redirect_fallback_method unless redirect_fallback_method == SKIP
106
+ @username = username unless username == SKIP
107
+ @password = password unless password == SKIP
108
+ @fallback_username = fallback_username unless fallback_username == SKIP
109
+ @fallback_password = fallback_password unless fallback_password == SKIP
78
110
  end
79
111
 
80
112
  # Creates an instance of the object from a hash.
@@ -82,15 +114,20 @@ module Bandwidth
82
114
  return nil unless hash
83
115
 
84
116
  # Extract variables from the hash.
85
- status = hash['status']
86
- redirect_url = hash['redirectUrl']
87
- redirect_fallback_url = hash['redirectFallbackUrl']
88
- redirect_method = hash['redirectMethod']
89
- redirect_fallback_method = hash['redirectFallbackMethod']
90
- username = hash['username']
91
- password = hash['password']
92
- fallback_username = hash['fallbackUsername']
93
- fallback_password = hash['fallbackPassword']
117
+ status = hash.key?('status') ? hash['status'] : SKIP
118
+ redirect_url = hash.key?('redirectUrl') ? hash['redirectUrl'] : SKIP
119
+ redirect_fallback_url =
120
+ hash.key?('redirectFallbackUrl') ? hash['redirectFallbackUrl'] : SKIP
121
+ redirect_method =
122
+ hash.key?('redirectMethod') ? hash['redirectMethod'] : SKIP
123
+ redirect_fallback_method =
124
+ hash.key?('redirectFallbackMethod') ? hash['redirectFallbackMethod'] : SKIP
125
+ username = hash.key?('username') ? hash['username'] : SKIP
126
+ password = hash.key?('password') ? hash['password'] : SKIP
127
+ fallback_username =
128
+ hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP
129
+ fallback_password =
130
+ hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP
94
131
 
95
132
  # Create object from extracted values.
96
133
  ModifyConferenceRequest.new(status,
@@ -6,6 +6,9 @@
6
6
  module Bandwidth
7
7
  # TranscribeRecordingRequest Model.
8
8
  class TranscribeRecordingRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
9
12
  # TODO: Write general description for this method
10
13
  # @return [String]
11
14
  attr_accessor :callback_url
@@ -42,18 +45,41 @@ module Bandwidth
42
45
  @_hash
43
46
  end
44
47
 
48
+ # An array for optional fields
49
+ def optionals
50
+ %w[
51
+ callback_url
52
+ callback_method
53
+ username
54
+ password
55
+ tag
56
+ callback_timeout
57
+ ]
58
+ end
59
+
60
+ # An array for nullable fields
61
+ def nullables
62
+ %w[
63
+ callback_method
64
+ username
65
+ password
66
+ tag
67
+ callback_timeout
68
+ ]
69
+ end
70
+
45
71
  def initialize(callback_url = nil,
46
72
  callback_method = nil,
47
73
  username = nil,
48
74
  password = nil,
49
75
  tag = nil,
50
76
  callback_timeout = nil)
51
- @callback_url = callback_url
52
- @callback_method = callback_method
53
- @username = username
54
- @password = password
55
- @tag = tag
56
- @callback_timeout = callback_timeout
77
+ @callback_url = callback_url unless callback_url == SKIP
78
+ @callback_method = callback_method unless callback_method == SKIP
79
+ @username = username unless username == SKIP
80
+ @password = password unless password == SKIP
81
+ @tag = tag unless tag == SKIP
82
+ @callback_timeout = callback_timeout unless callback_timeout == SKIP
57
83
  end
58
84
 
59
85
  # Creates an instance of the object from a hash.
@@ -61,12 +87,14 @@ module Bandwidth
61
87
  return nil unless hash
62
88
 
63
89
  # Extract variables from the hash.
64
- callback_url = hash['callbackUrl']
65
- callback_method = hash['callbackMethod']
66
- username = hash['username']
67
- password = hash['password']
68
- tag = hash['tag']
69
- callback_timeout = hash['callbackTimeout']
90
+ callback_url = hash.key?('callbackUrl') ? hash['callbackUrl'] : SKIP
91
+ callback_method =
92
+ hash.key?('callbackMethod') ? hash['callbackMethod'] : SKIP
93
+ username = hash.key?('username') ? hash['username'] : SKIP
94
+ password = hash.key?('password') ? hash['password'] : SKIP
95
+ tag = hash.key?('tag') ? hash['tag'] : SKIP
96
+ callback_timeout =
97
+ hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP
70
98
 
71
99
  # Create object from extracted values.
72
100
  TranscribeRecordingRequest.new(callback_url,
@@ -6,6 +6,9 @@
6
6
  module Bandwidth
7
7
  # Transcript Model.
8
8
  class Transcript < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
9
12
  # TODO: Write general description for this method
10
13
  # @return [String]
11
14
  attr_accessor :text
@@ -22,10 +25,23 @@ module Bandwidth
22
25
  @_hash
23
26
  end
24
27
 
28
+ # An array for optional fields
29
+ def optionals
30
+ %w[
31
+ text
32
+ confidence
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def nullables
38
+ []
39
+ end
40
+
25
41
  def initialize(text = nil,
26
42
  confidence = nil)
27
- @text = text
28
- @confidence = confidence
43
+ @text = text unless text == SKIP
44
+ @confidence = confidence unless confidence == SKIP
29
45
  end
30
46
 
31
47
  # Creates an instance of the object from a hash.
@@ -33,8 +49,8 @@ module Bandwidth
33
49
  return nil unless hash
34
50
 
35
51
  # Extract variables from the hash.
36
- text = hash['text']
37
- confidence = hash['confidence']
52
+ text = hash.key?('text') ? hash['text'] : SKIP
53
+ confidence = hash.key?('confidence') ? hash['confidence'] : SKIP
38
54
 
39
55
  # Create object from extracted values.
40
56
  Transcript.new(text,
@@ -0,0 +1,80 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # Transcription Model.
8
+ class Transcription < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :url
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :status
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :completed_time
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['id'] = 'id'
32
+ @_hash['url'] = 'url'
33
+ @_hash['status'] = 'status'
34
+ @_hash['completed_time'] = 'completedTime'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def optionals
40
+ %w[
41
+ id
42
+ url
43
+ status
44
+ completed_time
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def nullables
50
+ []
51
+ end
52
+
53
+ def initialize(id = nil,
54
+ url = nil,
55
+ status = nil,
56
+ completed_time = nil)
57
+ @id = id unless id == SKIP
58
+ @url = url unless url == SKIP
59
+ @status = status unless status == SKIP
60
+ @completed_time = completed_time unless completed_time == SKIP
61
+ end
62
+
63
+ # Creates an instance of the object from a hash.
64
+ def self.from_hash(hash)
65
+ return nil unless hash
66
+
67
+ # Extract variables from the hash.
68
+ id = hash.key?('id') ? hash['id'] : SKIP
69
+ url = hash.key?('url') ? hash['url'] : SKIP
70
+ status = hash.key?('status') ? hash['status'] : SKIP
71
+ completed_time = hash.key?('completedTime') ? hash['completedTime'] : SKIP
72
+
73
+ # Create object from extracted values.
74
+ Transcription.new(id,
75
+ url,
76
+ status,
77
+ completed_time)
78
+ end
79
+ end
80
+ end