bandwidth-sdk 18.1.4 → 18.3.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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +24 -24
  3. data/README.md +2 -0
  4. data/bandwidth.yml +65 -4
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +1167 -384
  7. data/coverage/index.html +15779 -7307
  8. data/custom_templates/configuration.mustache +6 -2
  9. data/custom_templates/gem.mustache +1 -0
  10. data/docs/AnswerCallback.md +1 -1
  11. data/docs/BridgeCompleteCallback.md +1 -1
  12. data/docs/BridgeTargetCompleteCallback.md +1 -1
  13. data/docs/ConferenceCompletedCallback.md +1 -1
  14. data/docs/ConferenceCreatedCallback.md +1 -1
  15. data/docs/ConferenceMemberExitCallback.md +1 -1
  16. data/docs/ConferenceMemberJoinCallback.md +1 -1
  17. data/docs/ConferenceRecordingAvailableCallback.md +1 -1
  18. data/docs/ConferenceRedirectCallback.md +1 -1
  19. data/docs/DisconnectCallback.md +1 -1
  20. data/docs/DtmfCallback.md +1 -1
  21. data/docs/GatherCallback.md +1 -1
  22. data/docs/InitiateCallback.md +1 -1
  23. data/docs/MachineDetectionCompleteCallback.md +1 -1
  24. data/docs/MediaApi.md +6 -6
  25. data/docs/RbmActionBase.md +1 -1
  26. data/docs/RbmSuggestionResponse.md +1 -1
  27. data/docs/RecordingAvailableCallback.md +1 -1
  28. data/docs/RecordingCompleteCallback.md +1 -1
  29. data/docs/RedirectCallback.md +1 -1
  30. data/docs/ReferCallStatusEnum.md +15 -0
  31. data/docs/ReferCompleteCallback.md +46 -0
  32. data/docs/TranscriptionAvailableCallback.md +1 -1
  33. data/docs/TransferAnswerCallback.md +1 -1
  34. data/docs/TransferCompleteCallback.md +1 -1
  35. data/docs/TransferDisconnectCallback.md +1 -1
  36. data/lib/bandwidth-sdk/api/media_api.rb +6 -6
  37. data/lib/bandwidth-sdk/configuration.rb +6 -2
  38. data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
  39. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
  40. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
  41. data/lib/bandwidth-sdk/models/bxml/verbs/connect.rb +23 -0
  42. data/lib/bandwidth-sdk/models/bxml/verbs/endpoint.rb +11 -0
  43. data/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +2 -0
  44. data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +22 -14
  45. data/lib/bandwidth-sdk/models/bxml/verbs/record.rb +2 -0
  46. data/lib/bandwidth-sdk/models/bxml/verbs/refer.rb +24 -0
  47. data/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +3 -1
  48. data/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +2 -0
  49. data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +2 -2
  50. data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +2 -0
  51. data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +1 -0
  52. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +1 -1
  53. data/lib/bandwidth-sdk/models/conference_created_callback.rb +1 -1
  54. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
  55. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
  56. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +1 -1
  57. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +1 -1
  58. data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
  59. data/lib/bandwidth-sdk/models/dtmf_callback.rb +1 -1
  60. data/lib/bandwidth-sdk/models/gather_callback.rb +1 -1
  61. data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
  62. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
  63. data/lib/bandwidth-sdk/models/recording_available_callback.rb +1 -1
  64. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +1 -1
  65. data/lib/bandwidth-sdk/models/redirect_callback.rb +1 -1
  66. data/lib/bandwidth-sdk/models/refer_call_status_enum.rb +40 -0
  67. data/lib/bandwidth-sdk/models/refer_complete_callback.rb +309 -0
  68. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +1 -1
  69. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +1 -1
  70. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +1 -1
  71. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +1 -1
  72. data/lib/bandwidth-sdk/version.rb +1 -1
  73. data/lib/bandwidth-sdk.rb +5 -0
  74. data/spec/smoke/media_api_spec.rb +2 -2
  75. data/spec/smoke/messages_api_spec.rb +2 -2
  76. data/spec/unit/api/calls_api_spec.rb +1 -2
  77. data/spec/unit/api/conferences_api_spec.rb +1 -2
  78. data/spec/unit/api/endpoints_api_spec.rb +1 -2
  79. data/spec/unit/api/media_api_spec.rb +1 -2
  80. data/spec/unit/api/messages_api_spec.rb +1 -2
  81. data/spec/unit/api/mfa_api_spec.rb +1 -2
  82. data/spec/unit/api/multi_channel_api_spec.rb +1 -2
  83. data/spec/unit/api/phone_number_lookup_api_spec.rb +1 -2
  84. data/spec/unit/api/recordings_api_spec.rb +1 -2
  85. data/spec/unit/api/statistics_api_spec.rb +1 -2
  86. data/spec/unit/api/toll_free_verification_api_spec.rb +1 -2
  87. data/spec/unit/api/transcriptions_api_spec.rb +1 -2
  88. data/spec/unit/models/bxml/verbs/connect_spec.rb +62 -0
  89. data/spec/unit/models/bxml/verbs/endpoint_spec.rb +16 -0
  90. data/spec/unit/models/bxml/verbs/forward_spec.rb +6 -2
  91. data/spec/unit/models/bxml/verbs/gather_spec.rb +23 -7
  92. data/spec/unit/models/bxml/verbs/record_spec.rb +8 -4
  93. data/spec/unit/models/bxml/verbs/refer_spec.rb +54 -0
  94. data/spec/unit/models/bxml/verbs/start_recording_spec.rb +8 -4
  95. data/spec/unit/models/bxml/verbs/start_stream_spec.rb +5 -5
  96. data/spec/unit/models/bxml/verbs/start_transcription_spec.rb +11 -7
  97. data/spec/unit/models/bxml/verbs/transfer_spec.rb +7 -5
  98. data/spec/unit/models/refer_call_status_enum_spec.rb +31 -0
  99. data/spec/unit/models/refer_complete_callback_spec.rb +123 -0
  100. metadata +19 -2
@@ -0,0 +1,309 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ # This event is sent to the referCompleteUrl of a call's <Refer> verb when the SIP REFER flow completes. On success, the call has been torn down and the BXML returned from this callback is ignored. On failure, the call remains active and the BXML returned from this callback is executed on the call.
18
+ class ReferCompleteCallback < ApiModelBase
19
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, referComplete, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
20
+ attr_accessor :event_type
21
+
22
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
23
+ attr_accessor :event_time
24
+
25
+ # The user account associated with the call.
26
+ attr_accessor :account_id
27
+
28
+ # The id of the application associated with the call.
29
+ attr_accessor :application_id
30
+
31
+ # The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
32
+ attr_accessor :from
33
+
34
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
35
+ attr_accessor :to
36
+
37
+ attr_accessor :direction
38
+
39
+ # The call id associated with the event.
40
+ attr_accessor :call_id
41
+
42
+ # The URL of the call associated with the event.
43
+ attr_accessor :call_url
44
+
45
+ # Time the call was started, in ISO 8601 format.
46
+ attr_accessor :start_time
47
+
48
+ # Time the call was answered, in ISO 8601 format.
49
+ attr_accessor :answer_time
50
+
51
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
52
+ attr_accessor :tag
53
+
54
+ attr_accessor :refer_call_status
55
+
56
+ # (optional) The SIP response code returned for the REFER request itself (e.g. 202, 405, 603). Present when a SIP response was received for the REFER.
57
+ attr_accessor :refer_sip_response_code
58
+
59
+ # (optional) The final SIP response code reported via NOTIFY (message/sipfrag body). Present only when the caller's endpoint sent a final NOTIFY (e.g. 200, 404, 486, 503). Not present on NOTIFY timeout or when the REFER was rejected before a subscription was established.
60
+ attr_accessor :notify_sip_response_code
61
+
62
+ class EnumAttributeValidator
63
+ attr_reader :datatype
64
+ attr_reader :allowable_values
65
+
66
+ def initialize(datatype, allowable_values)
67
+ @allowable_values = allowable_values.map do |value|
68
+ case datatype.to_s
69
+ when /Integer/i
70
+ value.to_i
71
+ when /Float/i
72
+ value.to_f
73
+ else
74
+ value
75
+ end
76
+ end
77
+ end
78
+
79
+ def valid?(value)
80
+ !value || allowable_values.include?(value)
81
+ end
82
+ end
83
+
84
+ # Attribute mapping from ruby-style variable name to JSON key.
85
+ def self.attribute_map
86
+ {
87
+ :'event_type' => :'eventType',
88
+ :'event_time' => :'eventTime',
89
+ :'account_id' => :'accountId',
90
+ :'application_id' => :'applicationId',
91
+ :'from' => :'from',
92
+ :'to' => :'to',
93
+ :'direction' => :'direction',
94
+ :'call_id' => :'callId',
95
+ :'call_url' => :'callUrl',
96
+ :'start_time' => :'startTime',
97
+ :'answer_time' => :'answerTime',
98
+ :'tag' => :'tag',
99
+ :'refer_call_status' => :'referCallStatus',
100
+ :'refer_sip_response_code' => :'referSipResponseCode',
101
+ :'notify_sip_response_code' => :'notifySipResponseCode'
102
+ }
103
+ end
104
+
105
+ # Returns attribute mapping this model knows about
106
+ def self.acceptable_attribute_map
107
+ attribute_map
108
+ end
109
+
110
+ # Returns all the JSON keys this model knows about
111
+ def self.acceptable_attributes
112
+ acceptable_attribute_map.values
113
+ end
114
+
115
+ # Attribute type mapping.
116
+ def self.openapi_types
117
+ {
118
+ :'event_type' => :'String',
119
+ :'event_time' => :'Time',
120
+ :'account_id' => :'String',
121
+ :'application_id' => :'String',
122
+ :'from' => :'String',
123
+ :'to' => :'String',
124
+ :'direction' => :'CallDirectionEnum',
125
+ :'call_id' => :'String',
126
+ :'call_url' => :'String',
127
+ :'start_time' => :'Time',
128
+ :'answer_time' => :'Time',
129
+ :'tag' => :'String',
130
+ :'refer_call_status' => :'ReferCallStatusEnum',
131
+ :'refer_sip_response_code' => :'Integer',
132
+ :'notify_sip_response_code' => :'Integer'
133
+ }
134
+ end
135
+
136
+ # List of attributes with nullable: true
137
+ def self.openapi_nullable
138
+ Set.new([
139
+ :'answer_time',
140
+ :'tag',
141
+ ])
142
+ end
143
+
144
+ # Initializes the object
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ def initialize(attributes = {})
147
+ if (!attributes.is_a?(Hash))
148
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ReferCompleteCallback` initialize method'
149
+ end
150
+
151
+ # check to see if the attribute exists and convert string to symbol for hash key
152
+ acceptable_attribute_map = self.class.acceptable_attribute_map
153
+ attributes = attributes.each_with_object({}) { |(k, v), h|
154
+ if (!acceptable_attribute_map.key?(k.to_sym))
155
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ReferCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
156
+ end
157
+ h[k.to_sym] = v
158
+ }
159
+
160
+ if attributes.key?(:'event_type')
161
+ self.event_type = attributes[:'event_type']
162
+ end
163
+
164
+ if attributes.key?(:'event_time')
165
+ self.event_time = attributes[:'event_time']
166
+ end
167
+
168
+ if attributes.key?(:'account_id')
169
+ self.account_id = attributes[:'account_id']
170
+ end
171
+
172
+ if attributes.key?(:'application_id')
173
+ self.application_id = attributes[:'application_id']
174
+ end
175
+
176
+ if attributes.key?(:'from')
177
+ self.from = attributes[:'from']
178
+ end
179
+
180
+ if attributes.key?(:'to')
181
+ self.to = attributes[:'to']
182
+ end
183
+
184
+ if attributes.key?(:'direction')
185
+ self.direction = attributes[:'direction']
186
+ end
187
+
188
+ if attributes.key?(:'call_id')
189
+ self.call_id = attributes[:'call_id']
190
+ end
191
+
192
+ if attributes.key?(:'call_url')
193
+ self.call_url = attributes[:'call_url']
194
+ end
195
+
196
+ if attributes.key?(:'start_time')
197
+ self.start_time = attributes[:'start_time']
198
+ end
199
+
200
+ if attributes.key?(:'answer_time')
201
+ self.answer_time = attributes[:'answer_time']
202
+ end
203
+
204
+ if attributes.key?(:'tag')
205
+ self.tag = attributes[:'tag']
206
+ end
207
+
208
+ if attributes.key?(:'refer_call_status')
209
+ self.refer_call_status = attributes[:'refer_call_status']
210
+ end
211
+
212
+ if attributes.key?(:'refer_sip_response_code')
213
+ self.refer_sip_response_code = attributes[:'refer_sip_response_code']
214
+ end
215
+
216
+ if attributes.key?(:'notify_sip_response_code')
217
+ self.notify_sip_response_code = attributes[:'notify_sip_response_code']
218
+ end
219
+ end
220
+
221
+ # Show invalid properties with the reasons. Usually used together with valid?
222
+ # @return Array for valid properties with the reasons
223
+ def list_invalid_properties
224
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
225
+ invalid_properties = Array.new
226
+ invalid_properties
227
+ end
228
+
229
+ # Check to see if the all the properties in the model are valid
230
+ # @return true if the model is valid
231
+ def valid?
232
+ warn '[DEPRECATED] the `valid?` method is obsolete'
233
+ true
234
+ end
235
+
236
+ # Checks equality by comparing each attribute.
237
+ # @param [Object] Object to be compared
238
+ def ==(o)
239
+ return true if self.equal?(o)
240
+ self.class == o.class &&
241
+ event_type == o.event_type &&
242
+ event_time == o.event_time &&
243
+ account_id == o.account_id &&
244
+ application_id == o.application_id &&
245
+ from == o.from &&
246
+ to == o.to &&
247
+ direction == o.direction &&
248
+ call_id == o.call_id &&
249
+ call_url == o.call_url &&
250
+ start_time == o.start_time &&
251
+ answer_time == o.answer_time &&
252
+ tag == o.tag &&
253
+ refer_call_status == o.refer_call_status &&
254
+ refer_sip_response_code == o.refer_sip_response_code &&
255
+ notify_sip_response_code == o.notify_sip_response_code
256
+ end
257
+
258
+ # @see the `==` method
259
+ # @param [Object] Object to be compared
260
+ def eql?(o)
261
+ self == o
262
+ end
263
+
264
+ # Calculates hash code according to all attributes.
265
+ # @return [Integer] Hash code
266
+ def hash
267
+ [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, start_time, answer_time, tag, refer_call_status, refer_sip_response_code, notify_sip_response_code].hash
268
+ end
269
+
270
+ # Builds the object from hash
271
+ # @param [Hash] attributes Model attributes in the form of hash
272
+ # @return [Object] Returns the model itself
273
+ def self.build_from_hash(attributes)
274
+ return nil unless attributes.is_a?(Hash)
275
+ attributes = attributes.transform_keys(&:to_sym)
276
+ transformed_hash = {}
277
+ openapi_types.each_pair do |key, type|
278
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
279
+ transformed_hash["#{key}"] = nil
280
+ elsif type =~ /\AArray<(.*)>/i
281
+ # check to ensure the input is an array given that the attribute
282
+ # is documented as an array but the input is not
283
+ if attributes[attribute_map[key]].is_a?(Array)
284
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
285
+ end
286
+ elsif !attributes[attribute_map[key]].nil?
287
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
288
+ end
289
+ end
290
+ new(transformed_hash)
291
+ end
292
+
293
+ # Returns the object in the form of hash
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_hash
296
+ hash = {}
297
+ self.class.attribute_map.each_pair do |attr, param|
298
+ value = self.send(attr)
299
+ if value.nil?
300
+ is_nullable = self.class.openapi_nullable.include?(attr)
301
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
302
+ end
303
+
304
+ hash[param] = _to_hash(value)
305
+ end
306
+ hash
307
+ end
308
+ end
309
+ end
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Bandwidth
17
17
  # The Transcription Available event is sent when the recording transcription is available to be downloaded.
18
18
  class TranscriptionAvailableCallback < ApiModelBase
19
- # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
19
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, referComplete, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
20
20
  attr_accessor :event_type
21
21
 
22
22
  # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Bandwidth
17
17
  # When processing a <Transfer> verb, this event is sent when a called party (B-leg) answers. The event is sent to the endpoint specified in the transferAnswerUrl attribute of the <PhoneNumber> tag that answered. BXML returned by this callback will be executed for the called party only. After all BXML has been executed, the called party will be bridged to the original call. Most BXML verbs are allowed in response to a transferAnswer event, but some are not allowed.
18
18
  class TransferAnswerCallback < ApiModelBase
19
- # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
19
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, referComplete, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
20
20
  attr_accessor :event_type
21
21
 
22
22
  # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Bandwidth
17
17
  # This event is sent to the transferCompleteUrl of the A-leg's <Transfer> verb when the transferred call (B-leg) completes. In a simultaneous ringing scenario, only one B-leg succeeds and this event corresponds to that successful leg. If none of the calls were answered, the transferComplete event corresponds to one of the legs.
18
18
  class TransferCompleteCallback < ApiModelBase
19
- # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
19
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, referComplete, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
20
20
  attr_accessor :event_type
21
21
 
22
22
  # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Bandwidth
17
17
  # This event is sent to the transferDisconnectUrl of each <PhoneNumber> tag when its respective call leg ends for any reason. The event is sent in the normal case, when the transferred leg is answered and later hung up, but is also sent if the new leg was never answered in the first place, if it was rejected, and if the original call leg hung up before the transferred leg.
18
18
  class TransferDisconnectCallback < ApiModelBase
19
- # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
19
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, referComplete, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
20
20
  attr_accessor :event_type
21
21
 
22
22
  # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
@@ -11,5 +11,5 @@ Generator version: 7.24.0
11
11
  =end
12
12
 
13
13
  module Bandwidth
14
- VERSION = '18.1.4'
14
+ VERSION = '18.3.0'
15
15
  end
data/lib/bandwidth-sdk.rb CHANGED
@@ -175,6 +175,8 @@ require 'bandwidth-sdk/models/recording_transcription_metadata'
175
175
  require 'bandwidth-sdk/models/recording_transcriptions'
176
176
  require 'bandwidth-sdk/models/redirect_callback'
177
177
  require 'bandwidth-sdk/models/redirect_method_enum'
178
+ require 'bandwidth-sdk/models/refer_call_status_enum'
179
+ require 'bandwidth-sdk/models/refer_complete_callback'
178
180
  require 'bandwidth-sdk/models/sip_connection_metadata'
179
181
  require 'bandwidth-sdk/models/sip_credentials'
180
182
  require 'bandwidth-sdk/models/sms_message_content'
@@ -226,7 +228,9 @@ require 'bandwidth-sdk/models/bxml/verb'
226
228
  require 'bandwidth-sdk/models/bxml/nestable_verb'
227
229
  require 'bandwidth-sdk/models/bxml/verbs/bridge'
228
230
  require 'bandwidth-sdk/models/bxml/verbs/conference'
231
+ require 'bandwidth-sdk/models/bxml/verbs/connect'
229
232
  require 'bandwidth-sdk/models/bxml/verbs/custom_param'
233
+ require 'bandwidth-sdk/models/bxml/verbs/endpoint'
230
234
  require 'bandwidth-sdk/models/bxml/verbs/forward'
231
235
  require 'bandwidth-sdk/models/bxml/verbs/gather'
232
236
  require 'bandwidth-sdk/models/bxml/verbs/hangup'
@@ -236,6 +240,7 @@ require 'bandwidth-sdk/models/bxml/verbs/phone_number'
236
240
  require 'bandwidth-sdk/models/bxml/verbs/play_audio'
237
241
  require 'bandwidth-sdk/models/bxml/verbs/record'
238
242
  require 'bandwidth-sdk/models/bxml/verbs/redirect'
243
+ require 'bandwidth-sdk/models/bxml/verbs/refer'
239
244
  require 'bandwidth-sdk/models/bxml/verbs/resume_recording'
240
245
  require 'bandwidth-sdk/models/bxml/verbs/ring'
241
246
  require 'bandwidth-sdk/models/bxml/verbs/send_dtmf'
@@ -8,8 +8,8 @@ describe 'MediaApi Integration Tests' do
8
8
  before(:all) do
9
9
  config = Bandwidth::Configuration.new
10
10
  config.configure do |config|
11
- config.username = BW_USERNAME
12
- config.password = BW_PASSWORD
11
+ config.client_id = BW_CLIENT_ID
12
+ config.client_secret = BW_CLIENT_SECRET
13
13
  config.return_binary_data = true
14
14
  end
15
15
  client = Bandwidth::ApiClient.new(config)
@@ -12,8 +12,8 @@ describe 'MessagesApi Integration Tests' do
12
12
  before(:all) do
13
13
  config = Bandwidth::Configuration.new
14
14
  config.configure do |config|
15
- config.username = BW_USERNAME
16
- config.password = BW_PASSWORD
15
+ config.client_id = BW_CLIENT_ID
16
+ config.client_secret = BW_CLIENT_SECRET
17
17
  end
18
18
  client = Bandwidth::ApiClient.new(config)
19
19
  @messaging_api_instance = Bandwidth::MessagesApi.new(client)
@@ -5,8 +5,7 @@ describe 'CallsApi' do
5
5
  before(:all) do
6
6
  Bandwidth.configure do |config|
7
7
  config.debugging = true
8
- config.username = BW_USERNAME
9
- config.password = BW_PASSWORD
8
+ config.access_token = 'abcd1234'
10
9
  config.ignore_operation_servers = true
11
10
  config.host = '127.0.0.1:4010'
12
11
  end
@@ -7,8 +7,7 @@ describe 'ConferencesApi' do
7
7
  before(:all) do
8
8
  Bandwidth.configure do |config|
9
9
  config.debugging = true
10
- config.username = BW_USERNAME
11
- config.password = BW_PASSWORD
10
+ config.access_token = 'abcd1234'
12
11
  config.ignore_operation_servers = true
13
12
  config.return_binary_data = true
14
13
  config.host = '127.0.0.1:4010'
@@ -5,8 +5,7 @@ describe 'EndpointsApi' do
5
5
  before(:all) do
6
6
  Bandwidth.configure do |config|
7
7
  config.debugging = true
8
- config.username = BW_USERNAME
9
- config.password = BW_PASSWORD
8
+ config.access_token = 'abcd1234'
10
9
  config.ignore_operation_servers = true
11
10
  config.host = '127.0.0.1:4010'
12
11
  end
@@ -7,8 +7,7 @@ describe 'MediaApi' do
7
7
  before(:all) do
8
8
  Bandwidth.configure do |config|
9
9
  config.debugging = true
10
- config.username = BW_USERNAME
11
- config.password = BW_PASSWORD
10
+ config.access_token = 'abcd1234'
12
11
  config.ignore_operation_servers = true
13
12
  config.return_binary_data = true
14
13
  config.host = '127.0.0.1:4010'
@@ -3,8 +3,7 @@ describe 'MessagesApi' do
3
3
  before(:all) do
4
4
  Bandwidth.configure do |config|
5
5
  config.debugging = true
6
- config.username = BW_USERNAME
7
- config.password = BW_PASSWORD
6
+ config.access_token = 'abcd1234'
8
7
  config.ignore_operation_servers = true
9
8
  config.host = '127.0.0.1:4010'
10
9
  end
@@ -6,8 +6,7 @@ describe 'MFAApi' do
6
6
  before(:all) do
7
7
  Bandwidth.configure do |config|
8
8
  config.debugging = true
9
- config.username = BW_USERNAME
10
- config.password = BW_PASSWORD
9
+ config.access_token = 'abcd1234'
11
10
  config.ignore_operation_servers = true
12
11
  config.host = '127.0.0.1:4010'
13
12
  end
@@ -3,8 +3,7 @@ describe 'MultiChannelApi' do
3
3
  before(:all) do
4
4
  Bandwidth.configure do |config|
5
5
  config.debugging = true
6
- config.username = BW_USERNAME
7
- config.password = BW_PASSWORD
6
+ config.access_token = 'abcd1234'
8
7
  config.ignore_operation_servers = true
9
8
  config.host = '127.0.0.1:4010'
10
9
  end
@@ -7,8 +7,7 @@ describe 'PhoneNumberLookupApi' do
7
7
  before(:all) do
8
8
  Bandwidth.configure do |config|
9
9
  config.debugging = true
10
- config.username = BW_USERNAME
11
- config.password = BW_PASSWORD
10
+ config.access_token = 'abcd1234'
12
11
  config.ignore_operation_servers = true
13
12
  config.host = '127.0.0.1:4010'
14
13
  end
@@ -6,8 +6,7 @@ describe 'RecordingsApi' do
6
6
  before(:all) do
7
7
  Bandwidth.configure do |config|
8
8
  config.debugging = true
9
- config.username = BW_USERNAME
10
- config.password = BW_PASSWORD
9
+ config.access_token = 'abcd1234'
11
10
  config.return_binary_data = true
12
11
  config.ignore_operation_servers = true
13
12
  config.host = '127.0.0.1:4010'
@@ -3,8 +3,7 @@ describe 'StatisticsApi' do
3
3
  before(:all) do
4
4
  Bandwidth.configure do |config|
5
5
  config.debugging = true
6
- config.username = BW_USERNAME
7
- config.password = BW_PASSWORD
6
+ config.access_token = 'abcd1234'
8
7
  config.ignore_operation_servers = true
9
8
  config.host = '127.0.0.1:4010'
10
9
  end
@@ -45,8 +45,7 @@ describe 'TollFreeVerificationApi' do
45
45
  before(:all) do
46
46
  Bandwidth.configure do |config|
47
47
  config.debugging = true
48
- config.username = BW_USERNAME
49
- config.password = BW_PASSWORD
48
+ config.access_token = 'abcd1234'
50
49
  config.ignore_operation_servers = true
51
50
  config.host = '127.0.0.1:4010'
52
51
  end
@@ -6,8 +6,7 @@ describe 'TranscriptionsApi' do
6
6
  before(:all) do
7
7
  Bandwidth.configure do |config|
8
8
  config.debugging = true
9
- config.username = BW_USERNAME
10
- config.password = BW_PASSWORD
9
+ config.access_token = 'abcd1234'
11
10
  config.ignore_operation_servers = true
12
11
  config.host = '127.0.0.1:4010'
13
12
  end
@@ -0,0 +1,62 @@
1
+ # Unit tests for Bandwidth::Bxml::Connect
2
+ describe 'Bandwidth::Bxml::Connect' do
3
+ let(:initial_attributes) {
4
+ {
5
+ event_callback_url: 'https://initial.com',
6
+ event_fallback_url: 'https://initial.com'
7
+ }
8
+ }
9
+
10
+ let(:new_attributes) {
11
+ {
12
+ event_callback_url: 'https://new.com',
13
+ event_fallback_url: 'https://new.com'
14
+ }
15
+ }
16
+
17
+ let(:endpoint_1) { Bandwidth::Bxml::Endpoint.new('endpoint_id_1') }
18
+ let(:endpoint_2) { Bandwidth::Bxml::Endpoint.new('endpoint_id_2') }
19
+
20
+ let(:instance) { Bandwidth::Bxml::Connect.new([], initial_attributes) }
21
+ let(:instance_nested) { Bandwidth::Bxml::Connect.new(endpoint_1, initial_attributes) }
22
+
23
+ describe 'test an instance of Connect' do
24
+ it 'validates instance of Connect' do
25
+ expect(instance).to be_instance_of(Bandwidth::Bxml::Connect)
26
+ expect(instance).to be_a(Bandwidth::Bxml::Verb)
27
+ end
28
+
29
+ it 'tests the to_bxml method of the Connect instance' do
30
+ expected = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\"/>\n"
31
+ expect(instance.to_bxml).to eq(expected)
32
+ end
33
+
34
+ it 'tests the set_attributes method of the Connect instance' do
35
+ instance.set_attributes(new_attributes)
36
+ expected = "\n<Connect eventCallbackUrl=\"https://new.com\" eventFallbackUrl=\"https://new.com\"/>\n"
37
+ expect(instance.to_bxml).to eq(expected)
38
+ end
39
+ end
40
+
41
+ describe 'test an instance of Connect with nested verbs' do
42
+ it 'validates instance of Connect' do
43
+ expect(instance_nested).to be_instance_of(Bandwidth::Bxml::Connect)
44
+ expect(instance_nested).to be_a(Bandwidth::Bxml::Verb)
45
+ end
46
+
47
+ it 'tests the to_bxml method of the nested Connect instance' do
48
+ expected = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\">\n <Endpoint>endpoint_id_1</Endpoint>\n</Connect>\n"
49
+ expect(instance_nested.to_bxml).to eq(expected)
50
+ end
51
+
52
+ it 'tests the add_endpoints method of the nested Connect instance' do
53
+ expected_single = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\">\n <Endpoint>endpoint_id_1</Endpoint>\n <Endpoint>endpoint_id_2</Endpoint>\n</Connect>\n"
54
+ instance_nested.add_endpoints(endpoint_2)
55
+ expect(instance_nested.to_bxml).to eq(expected_single)
56
+
57
+ expected_multiple = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\">\n <Endpoint>endpoint_id_1</Endpoint>\n <Endpoint>endpoint_id_2</Endpoint>\n <Endpoint>endpoint_id_2</Endpoint>\n <Endpoint>endpoint_id_1</Endpoint>\n</Connect>\n"
58
+ instance_nested.add_endpoints([endpoint_2, endpoint_1])
59
+ expect(instance_nested.to_bxml).to eq(expected_multiple)
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,16 @@
1
+ # Unit tests for Bandwidth::Bxml::Endpoint
2
+ describe 'Bandwidth::Bxml::Endpoint' do
3
+ let(:instance) { Bandwidth::Bxml::Endpoint.new('test_endpoint_id') }
4
+
5
+ describe 'test an instance of Endpoint' do
6
+ it 'validates instance of Endpoint' do
7
+ expect(instance).to be_instance_of(Bandwidth::Bxml::Endpoint)
8
+ expect(instance).to be_a(Bandwidth::Bxml::Verb)
9
+ end
10
+
11
+ it 'tests the to_bxml method of the Endpoint instance' do
12
+ expected = "\n<Endpoint>test_endpoint_id</Endpoint>\n"
13
+ expect(instance.to_bxml).to eq(expected)
14
+ end
15
+ end
16
+ end