bandwidth-sdk 18.1.4 → 18.2.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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +8 -8
  3. data/README.md +2 -0
  4. data/bandwidth.yml +63 -2
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +737 -135
  7. data/coverage/index.html +13402 -6908
  8. data/custom_templates/configuration.mustache +6 -2
  9. data/docs/AnswerCallback.md +1 -1
  10. data/docs/BridgeCompleteCallback.md +1 -1
  11. data/docs/BridgeTargetCompleteCallback.md +1 -1
  12. data/docs/ConferenceCompletedCallback.md +1 -1
  13. data/docs/ConferenceCreatedCallback.md +1 -1
  14. data/docs/ConferenceMemberExitCallback.md +1 -1
  15. data/docs/ConferenceMemberJoinCallback.md +1 -1
  16. data/docs/ConferenceRecordingAvailableCallback.md +1 -1
  17. data/docs/ConferenceRedirectCallback.md +1 -1
  18. data/docs/DisconnectCallback.md +1 -1
  19. data/docs/DtmfCallback.md +1 -1
  20. data/docs/GatherCallback.md +1 -1
  21. data/docs/InitiateCallback.md +1 -1
  22. data/docs/MachineDetectionCompleteCallback.md +1 -1
  23. data/docs/RbmActionBase.md +1 -1
  24. data/docs/RbmSuggestionResponse.md +1 -1
  25. data/docs/RecordingAvailableCallback.md +1 -1
  26. data/docs/RecordingCompleteCallback.md +1 -1
  27. data/docs/RedirectCallback.md +1 -1
  28. data/docs/ReferCallStatusEnum.md +15 -0
  29. data/docs/ReferCompleteCallback.md +46 -0
  30. data/docs/TranscriptionAvailableCallback.md +1 -1
  31. data/docs/TransferAnswerCallback.md +1 -1
  32. data/docs/TransferCompleteCallback.md +1 -1
  33. data/docs/TransferDisconnectCallback.md +1 -1
  34. data/lib/bandwidth-sdk/configuration.rb +6 -2
  35. data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
  36. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
  37. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
  38. data/lib/bandwidth-sdk/models/bxml/verbs/refer.rb +24 -0
  39. data/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +3 -1
  40. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +1 -1
  41. data/lib/bandwidth-sdk/models/conference_created_callback.rb +1 -1
  42. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
  43. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
  44. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +1 -1
  45. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +1 -1
  46. data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
  47. data/lib/bandwidth-sdk/models/dtmf_callback.rb +1 -1
  48. data/lib/bandwidth-sdk/models/gather_callback.rb +1 -1
  49. data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
  50. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
  51. data/lib/bandwidth-sdk/models/recording_available_callback.rb +1 -1
  52. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +1 -1
  53. data/lib/bandwidth-sdk/models/redirect_callback.rb +1 -1
  54. data/lib/bandwidth-sdk/models/refer_call_status_enum.rb +40 -0
  55. data/lib/bandwidth-sdk/models/refer_complete_callback.rb +309 -0
  56. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +1 -1
  57. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +1 -1
  58. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +1 -1
  59. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +1 -1
  60. data/lib/bandwidth-sdk/version.rb +1 -1
  61. data/lib/bandwidth-sdk.rb +3 -0
  62. data/spec/unit/api/calls_api_spec.rb +1 -2
  63. data/spec/unit/api/conferences_api_spec.rb +1 -2
  64. data/spec/unit/api/endpoints_api_spec.rb +1 -2
  65. data/spec/unit/api/media_api_spec.rb +1 -2
  66. data/spec/unit/api/messages_api_spec.rb +1 -2
  67. data/spec/unit/api/mfa_api_spec.rb +1 -2
  68. data/spec/unit/api/multi_channel_api_spec.rb +1 -2
  69. data/spec/unit/api/phone_number_lookup_api_spec.rb +1 -2
  70. data/spec/unit/api/recordings_api_spec.rb +1 -2
  71. data/spec/unit/api/statistics_api_spec.rb +1 -2
  72. data/spec/unit/api/toll_free_verification_api_spec.rb +1 -2
  73. data/spec/unit/api/transcriptions_api_spec.rb +1 -2
  74. data/spec/unit/models/bxml/verbs/refer_spec.rb +54 -0
  75. data/spec/unit/models/refer_call_status_enum_spec.rb +31 -0
  76. data/spec/unit/models/refer_complete_callback_spec.rb +123 -0
  77. metadata +12 -1
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Bandwidth
17
17
  # The Recording Available event is sent after a recording has been processed. It indicates that the recording is available for download.
18
18
  class RecordingAvailableCallback < 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
  # The Record Complete event is sent after a <Record> verb has executed if the call is still active. The BXML returned by this callback is executed next. When the recording is available for download, a Recording Available event will be sent.
18
18
  class RecordingCompleteCallback < 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
  # The Redirect event is fired when a <Redirect> verb is executed. Its purpose is to get the next set of verbs from the calling application.
18
18
  class RedirectCallback < 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.
@@ -0,0 +1,40 @@
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
+ class ReferCallStatusEnum
18
+ SUCCESS = 'success'.freeze
19
+ FAILURE = 'failure'.freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [SUCCESS, FAILURE].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if ReferCallStatusEnum.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #ReferCallStatusEnum"
38
+ end
39
+ end
40
+ end
@@ -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.2.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'
@@ -236,6 +238,7 @@ require 'bandwidth-sdk/models/bxml/verbs/phone_number'
236
238
  require 'bandwidth-sdk/models/bxml/verbs/play_audio'
237
239
  require 'bandwidth-sdk/models/bxml/verbs/record'
238
240
  require 'bandwidth-sdk/models/bxml/verbs/redirect'
241
+ require 'bandwidth-sdk/models/bxml/verbs/refer'
239
242
  require 'bandwidth-sdk/models/bxml/verbs/resume_recording'
240
243
  require 'bandwidth-sdk/models/bxml/verbs/ring'
241
244
  require 'bandwidth-sdk/models/bxml/verbs/send_dtmf'
@@ -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,54 @@
1
+ # Unit tests for Bandwidth::Bxml::Refer
2
+ describe 'Bandwidth::Bxml::Refer' do
3
+ let(:initial_attributes) {
4
+ {
5
+ refer_complete_url: 'https://initial.com',
6
+ refer_complete_method: 'POST',
7
+ tag: 'initial_tag'
8
+ }
9
+ }
10
+
11
+ let(:new_attributes) {
12
+ {
13
+ refer_complete_url: 'https://new.com',
14
+ refer_complete_method: 'GET',
15
+ tag: 'new_tag'
16
+ }
17
+ }
18
+
19
+ let(:sip_uri) { Bandwidth::Bxml::SipUri.new('sip:alice@atlanta.example.com') }
20
+
21
+ let(:instance) { Bandwidth::Bxml::Refer.new([], initial_attributes) }
22
+ let(:instance_nested) { Bandwidth::Bxml::Refer.new(sip_uri, initial_attributes) }
23
+
24
+ describe 'test an instance of Refer' do
25
+ it 'validates instance of Refer' do
26
+ expect(instance).to be_instance_of(Bandwidth::Bxml::Refer)
27
+ expect(instance).to be_a(Bandwidth::Bxml::Verb)
28
+ end
29
+
30
+ it 'tests the set_attributes method of the Refer instance' do
31
+ instance.set_attributes(new_attributes)
32
+ expected = "\n<Refer referCompleteUrl=\"https://new.com\" referCompleteMethod=\"GET\" tag=\"new_tag\"/>\n"
33
+ expect(instance.to_bxml).to eq(expected)
34
+ end
35
+
36
+ it 'tests the set_sip_uri method of the Refer instance' do
37
+ instance.set_sip_uri(sip_uri)
38
+ expected = "\n<Refer referCompleteUrl=\"https://initial.com\" referCompleteMethod=\"POST\" tag=\"initial_tag\">\n <SipUri>sip:alice@atlanta.example.com</SipUri>\n</Refer>\n"
39
+ expect(instance.to_bxml).to eq(expected)
40
+ end
41
+ end
42
+
43
+ describe 'test an instance of Refer with a nested SipUri' do
44
+ it 'validates instance of Refer' do
45
+ expect(instance_nested).to be_instance_of(Bandwidth::Bxml::Refer)
46
+ expect(instance_nested).to be_a(Bandwidth::Bxml::Verb)
47
+ end
48
+
49
+ it 'tests the to_bxml method of the nested Refer instance' do
50
+ expected = "\n<Refer referCompleteUrl=\"https://initial.com\" referCompleteMethod=\"POST\" tag=\"initial_tag\">\n <SipUri>sip:alice@atlanta.example.com</SipUri>\n</Refer>\n"
51
+ expect(instance_nested.to_bxml).to eq(expected)
52
+ end
53
+ end
54
+ end