bandwidth-sdk 18.3.1 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +13 -13
  3. data/README.md +1 -10
  4. data/Rakefile +1 -1
  5. data/bandwidth.yml +285 -109
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +1400 -1051
  8. data/coverage/index.html +20186 -16225
  9. data/custom_templates/api_client.mustache +3 -1
  10. data/custom_templates/configuration.mustache +18 -12
  11. data/custom_templates/gem.mustache +2 -2
  12. data/docs/Callback.md +1 -0
  13. data/docs/CallsApi.md +5 -25
  14. data/docs/ConferencesApi.md +9 -45
  15. data/docs/DisconnectCallback.md +6 -2
  16. data/docs/EndpointsApi.md +5 -25
  17. data/docs/InboundCallback.md +1 -1
  18. data/docs/InboundCallbackMessage.md +2 -0
  19. data/docs/InitiateCallback.md +1 -1
  20. data/docs/LookupResult.md +2 -2
  21. data/docs/MFAApi.md +3 -15
  22. data/docs/MediaApi.md +4 -20
  23. data/docs/Message.md +1 -1
  24. data/docs/MessagesApi.md +2 -10
  25. data/docs/MultiChannelAction.md +3 -3
  26. data/docs/MultiChannelActionCalendarEvent.md +3 -3
  27. data/docs/MultiChannelApi.md +1 -5
  28. data/docs/PhoneNumberLookupApi.md +3 -15
  29. data/docs/RbmActionBase.md +3 -3
  30. data/docs/RbmActionDial.md +3 -3
  31. data/docs/RbmActionOpenUrl.md +3 -3
  32. data/docs/RbmActionViewLocation.md +3 -3
  33. data/docs/RbmSession.md +26 -0
  34. data/docs/RbmSuggestionResponse.md +4 -4
  35. data/docs/RecordingsApi.md +10 -50
  36. data/docs/StatisticsApi.md +1 -5
  37. data/docs/StatusCallback.md +2 -2
  38. data/docs/StatusCallbackMessage.md +3 -1
  39. data/docs/TollFreeVerificationApi.md +9 -45
  40. data/docs/TranscriptionsApi.md +3 -15
  41. data/docs/TransferDisconnectCallback.md +7 -1
  42. data/lib/bandwidth-sdk/api/calls_api.rb +5 -5
  43. data/lib/bandwidth-sdk/api/conferences_api.rb +9 -9
  44. data/lib/bandwidth-sdk/api/endpoints_api.rb +5 -5
  45. data/lib/bandwidth-sdk/api/media_api.rb +4 -4
  46. data/lib/bandwidth-sdk/api/messages_api.rb +2 -2
  47. data/lib/bandwidth-sdk/api/mfa_api.rb +3 -3
  48. data/lib/bandwidth-sdk/api/multi_channel_api.rb +1 -1
  49. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +3 -3
  50. data/lib/bandwidth-sdk/api/recordings_api.rb +10 -10
  51. data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
  52. data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +9 -9
  53. data/lib/bandwidth-sdk/api/transcriptions_api.rb +3 -3
  54. data/lib/bandwidth-sdk/api_client.rb +3 -1
  55. data/lib/bandwidth-sdk/configuration.rb +18 -19
  56. data/lib/bandwidth-sdk/models/callback.rb +1 -0
  57. data/lib/bandwidth-sdk/models/disconnect_callback.rb +27 -5
  58. data/lib/bandwidth-sdk/models/inbound_callback_message.rb +10 -1
  59. data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
  60. data/lib/bandwidth-sdk/models/list_message_item.rb +1 -0
  61. data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +1 -1
  62. data/lib/bandwidth-sdk/models/rbm_action_base.rb +1 -1
  63. data/lib/bandwidth-sdk/models/rbm_action_dial.rb +1 -1
  64. data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +1 -1
  65. data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +1 -1
  66. data/lib/bandwidth-sdk/models/rbm_session.rb +208 -0
  67. data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +2 -2
  68. data/lib/bandwidth-sdk/models/status_callback_message.rb +13 -4
  69. data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +2 -1
  70. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +37 -5
  71. data/lib/bandwidth-sdk/version.rb +1 -1
  72. data/lib/bandwidth-sdk.rb +3 -2
  73. data/spec/smoke/calls_api_spec.rb +46 -46
  74. data/spec/smoke/conferences_api_spec.rb +1 -1
  75. data/spec/smoke/endpoints_api_spec.rb +2 -31
  76. data/spec/smoke/media_api_spec.rb +2 -0
  77. data/spec/smoke/messages_api_spec.rb +2 -24
  78. data/spec/smoke/mfa_api_spec.rb +4 -27
  79. data/spec/smoke/multi_channel_api_spec.rb +4 -2
  80. data/spec/smoke/phone_number_lookup_api_spec.rb +2 -0
  81. data/spec/smoke/recordings_api_spec.rb +1 -1
  82. data/spec/smoke/smoke_helper.rb +41 -0
  83. data/spec/smoke/statistics_api_spec.rb +2 -37
  84. data/spec/smoke/toll_free_verification_api_spec.rb +2 -0
  85. data/spec/smoke/transcriptions_api_spec.rb +1 -1
  86. data/spec/spec_helper.rb +0 -48
  87. data/spec/unit/api/calls_api_spec.rb +3 -1
  88. data/spec/unit/api/conferences_api_spec.rb +2 -0
  89. data/spec/unit/api/endpoints_api_spec.rb +2 -0
  90. data/spec/unit/api/media_api_spec.rb +2 -0
  91. data/spec/unit/api/messages_api_spec.rb +2 -0
  92. data/spec/unit/api/mfa_api_spec.rb +2 -0
  93. data/spec/unit/api/multi_channel_api_spec.rb +2 -0
  94. data/spec/unit/api/phone_number_lookup_api_spec.rb +2 -0
  95. data/spec/unit/api/recordings_api_spec.rb +2 -0
  96. data/spec/unit/api/statistics_api_spec.rb +2 -0
  97. data/spec/unit/api/toll_free_verification_api_spec.rb +2 -0
  98. data/spec/unit/api/transcriptions_api_spec.rb +2 -0
  99. data/spec/unit/client/api_client_spec.rb +70 -206
  100. data/spec/unit/client/configuration_spec.rb +22 -17
  101. data/spec/unit/constants.rb +6 -0
  102. data/spec/unit/models/callback_spec.rb +1 -0
  103. data/spec/unit/models/disconnect_callback_spec.rb +10 -2
  104. data/spec/unit/models/inbound_callback_message_spec.rb +20 -5
  105. data/spec/unit/models/list_message_item_spec.rb +1 -0
  106. data/spec/unit/models/rbm_session_spec.rb +95 -0
  107. data/spec/unit/models/status_callback_message_spec.rb +20 -5
  108. data/spec/unit/models/status_callback_type_enum_spec.rb +7 -1
  109. data/spec/unit/models/transfer_disconnect_callback_spec.rb +16 -4
  110. metadata +9 -1
@@ -74,7 +74,7 @@ module Bandwidth
74
74
  return_type = opts[:debug_return_type] || 'WebhookSubscription'
75
75
 
76
76
  # auth_names
77
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
77
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
78
78
 
79
79
  new_options = opts.merge(
80
80
  :operation => :"TollFreeVerificationApi.create_webhook_subscription",
@@ -156,7 +156,7 @@ module Bandwidth
156
156
  return_type = opts[:debug_return_type]
157
157
 
158
158
  # auth_names
159
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
159
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
160
160
 
161
161
  new_options = opts.merge(
162
162
  :operation => :"TollFreeVerificationApi.delete_verification_request",
@@ -225,7 +225,7 @@ module Bandwidth
225
225
  return_type = opts[:debug_return_type]
226
226
 
227
227
  # auth_names
228
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
228
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
229
229
 
230
230
  new_options = opts.merge(
231
231
  :operation => :"TollFreeVerificationApi.delete_webhook_subscription",
@@ -307,7 +307,7 @@ module Bandwidth
307
307
  return_type = opts[:debug_return_type] || 'TfvStatus'
308
308
 
309
309
  # auth_names
310
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
310
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
311
311
 
312
312
  new_options = opts.merge(
313
313
  :operation => :"TollFreeVerificationApi.get_toll_free_verification_status",
@@ -364,7 +364,7 @@ module Bandwidth
364
364
  return_type = opts[:debug_return_type] || 'Array<String>'
365
365
 
366
366
  # auth_names
367
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
367
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
368
368
 
369
369
  new_options = opts.merge(
370
370
  :operation => :"TollFreeVerificationApi.list_toll_free_use_cases",
@@ -427,7 +427,7 @@ module Bandwidth
427
427
  return_type = opts[:debug_return_type] || 'WebhookSubscriptionsListBody'
428
428
 
429
429
  # auth_names
430
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
430
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
431
431
 
432
432
  new_options = opts.merge(
433
433
  :operation => :"TollFreeVerificationApi.list_webhook_subscriptions",
@@ -501,7 +501,7 @@ module Bandwidth
501
501
  return_type = opts[:debug_return_type]
502
502
 
503
503
  # auth_names
504
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
504
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
505
505
 
506
506
  new_options = opts.merge(
507
507
  :operation => :"TollFreeVerificationApi.request_toll_free_verification",
@@ -594,7 +594,7 @@ module Bandwidth
594
594
  return_type = opts[:debug_return_type]
595
595
 
596
596
  # auth_names
597
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
597
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
598
598
 
599
599
  new_options = opts.merge(
600
600
  :operation => :"TollFreeVerificationApi.update_toll_free_verification_request",
@@ -674,7 +674,7 @@ module Bandwidth
674
674
  return_type = opts[:debug_return_type] || 'WebhookSubscription'
675
675
 
676
676
  # auth_names
677
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
677
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
678
678
 
679
679
  new_options = opts.merge(
680
680
  :operation => :"TollFreeVerificationApi.update_webhook_subscription",
@@ -75,7 +75,7 @@ module Bandwidth
75
75
  return_type = opts[:debug_return_type]
76
76
 
77
77
  # auth_names
78
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
78
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
79
79
 
80
80
  new_options = opts.merge(
81
81
  :operation => :"TranscriptionsApi.delete_real_time_transcription",
@@ -150,7 +150,7 @@ module Bandwidth
150
150
  return_type = opts[:debug_return_type] || 'CallTranscriptionResponse'
151
151
 
152
152
  # auth_names
153
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
153
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
154
154
 
155
155
  new_options = opts.merge(
156
156
  :operation => :"TranscriptionsApi.get_real_time_transcription",
@@ -219,7 +219,7 @@ module Bandwidth
219
219
  return_type = opts[:debug_return_type] || 'Array<CallTranscriptionMetadata>'
220
220
 
221
221
  # auth_names
222
- auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2']
222
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
223
223
 
224
224
  new_options = opts.merge(
225
225
  :operation => :"TranscriptionsApi.list_real_time_transcriptions",
@@ -353,8 +353,10 @@ module Bandwidth
353
353
  # @param [Hash] query_params Query parameters
354
354
  # @param [String] auth_names Authentication scheme name
355
355
  def update_params_for_auth!(header_params, query_params, auth_names)
356
+ auth_settings = nil
356
357
  Array(auth_names).each do |auth_name|
357
- auth_setting = @config.auth_settings[auth_name]
358
+ auth_settings ||= @config.auth_settings
359
+ auth_setting = auth_settings[auth_name]
358
360
  next unless auth_setting
359
361
  case auth_setting[:in]
360
362
  when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] unless auth_setting[:value].nil?
@@ -49,15 +49,25 @@ module Bandwidth
49
49
  # config.api_key_prefix['api_key'] = 'Token'
50
50
  attr_accessor :api_key_prefix
51
51
 
52
- # Defines the username used with HTTP basic authentication.
52
+ # HTTP basic authentication is no longer supported. Always nil.
53
53
  #
54
- # @return [String]
55
- attr_accessor :username
54
+ # @return [nil]
55
+ attr_reader :username
56
56
 
57
- # Defines the password used with HTTP basic authentication.
57
+ # HTTP basic authentication is no longer supported. Always nil.
58
58
  #
59
- # @return [String]
60
- attr_accessor :password
59
+ # @return [nil]
60
+ attr_reader :password
61
+
62
+ # @raise [ArgumentError] HTTP basic authentication is no longer supported
63
+ def username=(_username)
64
+ raise ArgumentError, 'HTTP basic authentication is no longer supported. Use client_id and client_secret instead.'
65
+ end
66
+
67
+ # @raise [ArgumentError] HTTP basic authentication is no longer supported
68
+ def password=(_password)
69
+ raise ArgumentError, 'HTTP basic authentication is no longer supported. Use client_id and client_secret instead.'
70
+ end
61
71
 
62
72
  # Defines the client ID used with OAuth2.
63
73
  #
@@ -281,27 +291,16 @@ module Bandwidth
281
291
  access_token_getter.call
282
292
  end
283
293
 
284
- # Gets Basic Auth token string
285
- def basic_auth_token
286
- 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
287
- end
288
-
289
294
  # Gets Bearer auth token string
290
295
  def oauth_bearer_token
291
- "Bearer #{access_token_with_refresh}" unless access_token_with_refresh.nil?
296
+ token = access_token_with_refresh
297
+ "Bearer #{token}" unless token.nil?
292
298
  end
293
299
 
294
300
 
295
301
  # Returns Auth Settings hash for api client.
296
302
  def auth_settings
297
303
  {
298
- 'Basic' =>
299
- {
300
- type: 'basic',
301
- in: 'header',
302
- key: 'Authorization',
303
- value: basic_auth_token
304
- },
305
304
  'OAuth2' =>
306
305
  {
307
306
  type: 'oauth2',
@@ -40,6 +40,7 @@ module Bandwidth
40
40
  :'message-sending' => :'StatusCallback',
41
41
  :'message-sent' => :'StatusCallback',
42
42
  :'requested-location-response' => :'InboundCallback',
43
+ :'session-started' => :'StatusCallback',
43
44
  :'suggestion-response' => :'InboundCallback'
44
45
  }
45
46
  end
@@ -69,9 +69,15 @@ module Bandwidth
69
69
  # (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists.
70
70
  attr_accessor :sip_call_id
71
71
 
72
- # (optional) The SIP status code returned by Bandwidth's SBC when it rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline). Present only when an outbound call was rejected by the SBC.
72
+ # (optional) The SIP status code of the final response that rejected an outbound call's (or transferred leg's) INVITE (e.g. 486 for busy, 603 for decline). Present only when the call was rejected with a SIP response.
73
73
  attr_accessor :sip_response_code
74
74
 
75
+ # (optional) The full SIP status line, exactly as received, of the final response that rejected an outbound call's INVITE. The reason phrase can help distinguish outcomes that share a status code, such as `603 Network Blocked` and `603 Decline`. Present only when an outbound call was rejected with a SIP response.
76
+ attr_accessor :sip_status_line
77
+
78
+ # (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` call-analytics block information from a terminating carrier). If the response carries more than one `Reason` header, all values are returned in the order received, separated by `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth's usual camelCase JSON convention, since these are passthrough values from the caller's SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`.
79
+ attr_accessor :sip_headers
80
+
75
81
  class EnumAttributeValidator
76
82
  attr_reader :datatype
77
83
  attr_reader :allowable_values
@@ -115,7 +121,9 @@ module Bandwidth
115
121
  :'error_id' => :'errorId',
116
122
  :'tag' => :'tag',
117
123
  :'sip_call_id' => :'sipCallId',
118
- :'sip_response_code' => :'sipResponseCode'
124
+ :'sip_response_code' => :'sipResponseCode',
125
+ :'sip_status_line' => :'sipStatusLine',
126
+ :'sip_headers' => :'sipHeaders'
119
127
  }
120
128
  end
121
129
 
@@ -150,7 +158,9 @@ module Bandwidth
150
158
  :'error_id' => :'String',
151
159
  :'tag' => :'String',
152
160
  :'sip_call_id' => :'String',
153
- :'sip_response_code' => :'Integer'
161
+ :'sip_response_code' => :'Integer',
162
+ :'sip_status_line' => :'String',
163
+ :'sip_headers' => :'Hash<String, String>'
154
164
  }
155
165
  end
156
166
 
@@ -256,6 +266,16 @@ module Bandwidth
256
266
  if attributes.key?(:'sip_response_code')
257
267
  self.sip_response_code = attributes[:'sip_response_code']
258
268
  end
269
+
270
+ if attributes.key?(:'sip_status_line')
271
+ self.sip_status_line = attributes[:'sip_status_line']
272
+ end
273
+
274
+ if attributes.key?(:'sip_headers')
275
+ if (value = attributes[:'sip_headers']).is_a?(Hash)
276
+ self.sip_headers = value
277
+ end
278
+ end
259
279
  end
260
280
 
261
281
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -296,7 +316,9 @@ module Bandwidth
296
316
  error_id == o.error_id &&
297
317
  tag == o.tag &&
298
318
  sip_call_id == o.sip_call_id &&
299
- sip_response_code == o.sip_response_code
319
+ sip_response_code == o.sip_response_code &&
320
+ sip_status_line == o.sip_status_line &&
321
+ sip_headers == o.sip_headers
300
322
  end
301
323
 
302
324
  # @see the `==` method
@@ -308,7 +330,7 @@ module Bandwidth
308
330
  # Calculates hash code according to all attributes.
309
331
  # @return [Integer] Hash code
310
332
  def hash
311
- [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, tag, sip_call_id, sip_response_code].hash
333
+ [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, tag, sip_call_id, sip_response_code, sip_status_line, sip_headers].hash
312
334
  end
313
335
 
314
336
  # Builds the object from hash
@@ -49,6 +49,8 @@ module Bandwidth
49
49
 
50
50
  attr_accessor :channel
51
51
 
52
+ attr_accessor :session
53
+
52
54
  attr_accessor :content
53
55
 
54
56
  attr_accessor :suggestion_response
@@ -93,6 +95,7 @@ module Bandwidth
93
95
  :'media' => :'media',
94
96
  :'priority' => :'priority',
95
97
  :'channel' => :'channel',
98
+ :'session' => :'session',
96
99
  :'content' => :'content',
97
100
  :'suggestion_response' => :'suggestionResponse',
98
101
  :'location_response' => :'locationResponse'
@@ -125,6 +128,7 @@ module Bandwidth
125
128
  :'media' => :'Array<String>',
126
129
  :'priority' => :'PriorityEnum',
127
130
  :'channel' => :'MultiChannelMessageChannelEnum',
131
+ :'session' => :'RbmSession',
128
132
  :'content' => :'MultiChannelMessageContent',
129
133
  :'suggestion_response' => :'RbmSuggestionResponse',
130
134
  :'location_response' => :'RbmLocationResponse'
@@ -232,6 +236,10 @@ module Bandwidth
232
236
  self.channel = attributes[:'channel']
233
237
  end
234
238
 
239
+ if attributes.key?(:'session')
240
+ self.session = attributes[:'session']
241
+ end
242
+
235
243
  if attributes.key?(:'content')
236
244
  self.content = attributes[:'content']
237
245
  end
@@ -398,6 +406,7 @@ module Bandwidth
398
406
  media == o.media &&
399
407
  priority == o.priority &&
400
408
  channel == o.channel &&
409
+ session == o.session &&
401
410
  content == o.content &&
402
411
  suggestion_response == o.suggestion_response &&
403
412
  location_response == o.location_response
@@ -412,7 +421,7 @@ module Bandwidth
412
421
  # Calculates hash code according to all attributes.
413
422
  # @return [Integer] Hash code
414
423
  def hash
415
- [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel, content, suggestion_response, location_response].hash
424
+ [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel, session, content, suggestion_response, location_response].hash
416
425
  end
417
426
 
418
427
  # Builds the object from hash
@@ -55,7 +55,7 @@ module Bandwidth
55
55
  # (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists.
56
56
  attr_accessor :sip_call_id
57
57
 
58
- # (optional) Map of customer-supplied X-* headers from the original INVITE. Keys are lowercase (SIP headers are case-insensitive). Present only for inbound SIP URI calls with custom headers. Note - keys preserve the original SIP header name in lowercase rather than Bandwidth's usual camelCase JSON convention, since these are passthrough values from the caller's SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept.
58
+ # (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` call-analytics block information from a terminating carrier). If the response carries more than one `Reason` header, all values are returned in the order received, separated by `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth's usual camelCase JSON convention, since these are passthrough values from the caller's SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`.
59
59
  attr_accessor :sip_headers
60
60
 
61
61
  class EnumAttributeValidator
@@ -176,6 +176,7 @@ module Bandwidth
176
176
  Set.new([
177
177
  :'carrier_name',
178
178
  :'message_size',
179
+ :'message_length',
179
180
  :'attachment_count',
180
181
  :'recipient_count',
181
182
  :'campaign_class',
@@ -20,7 +20,7 @@ module Bandwidth
20
20
  # Displayed text for user to click
21
21
  attr_accessor :text
22
22
 
23
- # Base64 payload the customer receives when the reply is clicked.
23
+ # Payload the customer receives when the reply is clicked.
24
24
  attr_accessor :postback_data
25
25
 
26
26
  # The title of the event.
@@ -20,7 +20,7 @@ module Bandwidth
20
20
  # Displayed text for user to click
21
21
  attr_accessor :text
22
22
 
23
- # Base64 payload the customer receives when the reply is clicked.
23
+ # Payload the customer receives when the reply is clicked.
24
24
  attr_accessor :postback_data
25
25
 
26
26
  class EnumAttributeValidator
@@ -20,7 +20,7 @@ module Bandwidth
20
20
  # Displayed text for user to click
21
21
  attr_accessor :text
22
22
 
23
- # Base64 payload the customer receives when the reply is clicked.
23
+ # Payload the customer receives when the reply is clicked.
24
24
  attr_accessor :postback_data
25
25
 
26
26
  # The phone number to dial. Must be E164 format.
@@ -20,7 +20,7 @@ module Bandwidth
20
20
  # Displayed text for user to click
21
21
  attr_accessor :text
22
22
 
23
- # Base64 payload the customer receives when the reply is clicked.
23
+ # Payload the customer receives when the reply is clicked.
24
24
  attr_accessor :postback_data
25
25
 
26
26
  # The URL to open in browser. Must use http:// or https:// scheme.
@@ -20,7 +20,7 @@ module Bandwidth
20
20
  # Displayed text for user to click
21
21
  attr_accessor :text
22
22
 
23
- # Base64 payload the customer receives when the reply is clicked.
23
+ # Payload the customer receives when the reply is clicked.
24
24
  attr_accessor :postback_data
25
25
 
26
26
  # The latitude of the location. Must be in range [-90.000000, 90.000000].
@@ -0,0 +1,208 @@
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
+ # RCS interactive session information for the message. An interactive session is a 24-hour window covering all Rich and Rich Media messages exchanged between an RCS agent and a specific end user mobile number. It is triggered when at least 4 messages are exchanged within 24 hours, at least 2 of them mobile-originated and at least 1 mobile-terminated. Only present on `message-delivered`, `message-received` and `session-started` callbacks for RBM messages of US agents with the Conversational billing category. Omitted for all other messages.
18
+ class RbmSession < ApiModelBase
19
+ # Whether the message can start an interactive session. `false` if the message is already part of an active session, or if the agent is not eligible for interactive session billing.
20
+ attr_accessor :can_initiate
21
+
22
+ # The unique identifier of the interactive session the message is part of. This is not a message ID. Omitted if the message is not part of a session.
23
+ attr_accessor :id
24
+
25
+ # The type of the interactive session. Only present on `session-started` callbacks.
26
+ attr_accessor :type
27
+
28
+ # The time the 24-hour session window opened. Only present on `session-started` callbacks.
29
+ attr_accessor :start_time
30
+
31
+ # The time the 24-hour session window closes. Only present on `session-started` callbacks.
32
+ attr_accessor :end_time
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'can_initiate' => :'canInitiate',
38
+ :'id' => :'id',
39
+ :'type' => :'type',
40
+ :'start_time' => :'startTime',
41
+ :'end_time' => :'endTime'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'can_initiate' => :'Boolean',
59
+ :'id' => :'String',
60
+ :'type' => :'String',
61
+ :'start_time' => :'Time',
62
+ :'end_time' => :'Time'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ :'id',
70
+ :'type',
71
+ :'start_time',
72
+ :'end_time'
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RbmSession` initialize method'
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'can_initiate')
93
+ self.can_initiate = attributes[:'can_initiate']
94
+ else
95
+ self.can_initiate = nil
96
+ end
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ end
101
+
102
+ if attributes.key?(:'type')
103
+ self.type = attributes[:'type']
104
+ end
105
+
106
+ if attributes.key?(:'start_time')
107
+ self.start_time = attributes[:'start_time']
108
+ end
109
+
110
+ if attributes.key?(:'end_time')
111
+ self.end_time = attributes[:'end_time']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @can_initiate.nil?
121
+ invalid_properties.push('invalid value for "can_initiate", can_initiate cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @can_initiate.nil?
132
+ true
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] can_initiate Value to be assigned
137
+ def can_initiate=(can_initiate)
138
+ if can_initiate.nil?
139
+ fail ArgumentError, 'can_initiate cannot be nil'
140
+ end
141
+
142
+ @can_initiate = can_initiate
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ can_initiate == o.can_initiate &&
151
+ id == o.id &&
152
+ type == o.type &&
153
+ start_time == o.start_time &&
154
+ end_time == o.end_time
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [can_initiate, id, type, start_time, end_time].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ transformed_hash = {}
176
+ openapi_types.each_pair do |key, type|
177
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[attribute_map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
+ end
185
+ elsif !attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
+ end
188
+ end
189
+ new(transformed_hash)
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+ end
208
+ end
@@ -15,10 +15,10 @@ require 'time'
15
15
 
16
16
  module Bandwidth
17
17
  class RbmSuggestionResponse < ApiModelBase
18
- # The text associated with the suggestion response.
18
+ # The text of the suggestion the user tapped.
19
19
  attr_accessor :text
20
20
 
21
- # Base64 payload the customer receives when the reply is clicked.
21
+ # Payload the customer receives when the reply is clicked.
22
22
  attr_accessor :postback_data
23
23
 
24
24
  # Corresponding parent message ID (MT).
@@ -50,6 +50,8 @@ module Bandwidth
50
50
 
51
51
  attr_accessor :channel
52
52
 
53
+ attr_accessor :session
54
+
53
55
  class EnumAttributeValidator
54
56
  attr_reader :datatype
55
57
  attr_reader :allowable_values
@@ -87,7 +89,8 @@ module Bandwidth
87
89
  :'tag' => :'tag',
88
90
  :'media' => :'media',
89
91
  :'priority' => :'priority',
90
- :'channel' => :'channel'
92
+ :'channel' => :'channel',
93
+ :'session' => :'session'
91
94
  }
92
95
  end
93
96
 
@@ -116,7 +119,8 @@ module Bandwidth
116
119
  :'tag' => :'String',
117
120
  :'media' => :'Array<String>',
118
121
  :'priority' => :'PriorityEnum',
119
- :'channel' => :'MultiChannelMessageChannelEnum'
122
+ :'channel' => :'MultiChannelMessageChannelEnum',
123
+ :'session' => :'RbmSession'
120
124
  }
121
125
  end
122
126
 
@@ -213,6 +217,10 @@ module Bandwidth
213
217
  if attributes.key?(:'channel')
214
218
  self.channel = attributes[:'channel']
215
219
  end
220
+
221
+ if attributes.key?(:'session')
222
+ self.session = attributes[:'session']
223
+ end
216
224
  end
217
225
 
218
226
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -367,7 +375,8 @@ module Bandwidth
367
375
  tag == o.tag &&
368
376
  media == o.media &&
369
377
  priority == o.priority &&
370
- channel == o.channel
378
+ channel == o.channel &&
379
+ session == o.session
371
380
  end
372
381
 
373
382
  # @see the `==` method
@@ -379,7 +388,7 @@ module Bandwidth
379
388
  # Calculates hash code according to all attributes.
380
389
  # @return [Integer] Hash code
381
390
  def hash
382
- [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel].hash
391
+ [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel, session].hash
383
392
  end
384
393
 
385
394
  # Builds the object from hash