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
@@ -23,7 +23,11 @@ describe Bandwidth::StatusCallbackMessage do
23
23
  tag: 'custom tag',
24
24
  media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'],
25
25
  priority: Bandwidth::PriorityEnum::DEFAULT,
26
- channel: Bandwidth::MultiChannelMessageChannelEnum::SMS
26
+ channel: Bandwidth::MultiChannelMessageChannelEnum::RBM,
27
+ session: Bandwidth::RbmSession.new({
28
+ can_initiate: false,
29
+ id: '0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d'
30
+ })
27
31
  }) }
28
32
 
29
33
  describe '#initialize' do
@@ -67,7 +71,11 @@ describe Bandwidth::StatusCallbackMessage do
67
71
  tag: 'custom tag',
68
72
  media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'],
69
73
  priority: Bandwidth::PriorityEnum::DEFAULT,
70
- channel: Bandwidth::MultiChannelMessageChannelEnum::SMS
74
+ channel: Bandwidth::MultiChannelMessageChannelEnum::RBM,
75
+ session: {
76
+ canInitiate: false,
77
+ id: '0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d'
78
+ }
71
79
  })
72
80
  expect(status_callback_message_from_hash).to be_instance_of(Bandwidth::StatusCallbackMessage)
73
81
  expect(status_callback_message_from_hash.id).to eq('1589228074636lm4k2je7j7jklbn2')
@@ -82,13 +90,16 @@ describe Bandwidth::StatusCallbackMessage do
82
90
  expect(status_callback_message_from_hash.tag).to eq('custom tag')
83
91
  expect(status_callback_message_from_hash.media).to eq(['https://dev.bandwidth.com/images/bandwidth-logo.png'])
84
92
  expect(status_callback_message_from_hash.priority).to eq(Bandwidth::PriorityEnum::DEFAULT)
85
- expect(status_callback_message_from_hash.channel).to eq(Bandwidth::MultiChannelMessageChannelEnum::SMS)
93
+ expect(status_callback_message_from_hash.channel).to eq(Bandwidth::MultiChannelMessageChannelEnum::RBM)
94
+ expect(status_callback_message_from_hash.session).to be_instance_of(Bandwidth::RbmSession)
95
+ expect(status_callback_message_from_hash.session.can_initiate).to be false
96
+ expect(status_callback_message_from_hash.session.id).to eq('0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d')
86
97
  end
87
98
  end
88
99
 
89
100
  describe '#to_s' do
90
101
  it 'returns a string representation of the object' do
91
- expect(status_callback_message_values.to_s).to eq({ :id => '1589228074636lm4k2je7j7jklbn2', :owner => '+19195554321', :applicationId => '93de2206-9669-4e07-948d-329f4b722ee2', :time => '2022-06-16T13:15:07.160Z', :segmentCount => 2, :direction => 'out', :to => ['+19195551234'], :from => '+19195554321', :text => 'Hello world', :tag => 'custom tag', :media => ['https://dev.bandwidth.com/images/bandwidth-logo.png'], :priority => 'default', :channel => 'SMS' }.to_s)
102
+ expect(status_callback_message_values.to_s).to eq({ :id => '1589228074636lm4k2je7j7jklbn2', :owner => '+19195554321', :applicationId => '93de2206-9669-4e07-948d-329f4b722ee2', :time => '2022-06-16T13:15:07.160Z', :segmentCount => 2, :direction => 'out', :to => ['+19195551234'], :from => '+19195554321', :text => 'Hello world', :tag => 'custom tag', :media => ['https://dev.bandwidth.com/images/bandwidth-logo.png'], :priority => 'default', :channel => 'RBM', :session => { :canInitiate => false, :id => '0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d' } }.to_s)
92
103
  end
93
104
  end
94
105
 
@@ -124,7 +135,11 @@ describe Bandwidth::StatusCallbackMessage do
124
135
  tag: 'custom tag',
125
136
  media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'],
126
137
  priority: Bandwidth::PriorityEnum::DEFAULT,
127
- channel: Bandwidth::MultiChannelMessageChannelEnum::SMS
138
+ channel: Bandwidth::MultiChannelMessageChannelEnum::RBM,
139
+ session: {
140
+ canInitiate: false,
141
+ id: '0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d'
142
+ }
128
143
  })
129
144
  end
130
145
  end
@@ -20,6 +20,10 @@ describe Bandwidth::StatusCallbackTypeEnum do
20
20
  it 'defines MESSAGE_READ' do
21
21
  expect(Bandwidth::StatusCallbackTypeEnum::MESSAGE_READ).to eq('message-read')
22
22
  end
23
+
24
+ it 'defines SESSION_STARTED' do
25
+ expect(Bandwidth::StatusCallbackTypeEnum::SESSION_STARTED).to eq('session-started')
26
+ end
23
27
  end
24
28
 
25
29
  describe '.all_vars' do
@@ -29,7 +33,8 @@ describe Bandwidth::StatusCallbackTypeEnum do
29
33
  'message-sent',
30
34
  'message-delivered',
31
35
  'message-failed',
32
- 'message-read'
36
+ 'message-read',
37
+ 'session-started'
33
38
  ])
34
39
  end
35
40
  end
@@ -41,6 +46,7 @@ describe Bandwidth::StatusCallbackTypeEnum do
41
46
  expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-delivered')).to eq('message-delivered')
42
47
  expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-failed')).to eq('message-failed')
43
48
  expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-read')).to eq('message-read')
49
+ expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('session-started')).to eq('session-started')
44
50
  end
45
51
 
46
52
  it 'raises an error for an invalid enum value' do
@@ -21,7 +21,10 @@ describe Bandwidth::TransferDisconnectCallback do
21
21
  transfer_to: '+19195551234',
22
22
  cause: 'hangup',
23
23
  error_message: 'call rejected',
24
- error_id: '4642074b-7b58-478b-96e4-3a60955c6765'
24
+ error_id: '4642074b-7b58-478b-96e4-3a60955c6765',
25
+ sip_response_code: 486,
26
+ sip_status_line: 'SIP/2.0 486 Busy Here',
27
+ sip_headers: { 'reason' => 'v=analytics1' }
25
28
  }) }
26
29
 
27
30
  describe '#initialize' do
@@ -78,7 +81,10 @@ describe Bandwidth::TransferDisconnectCallback do
78
81
  transferTo: '+19195551234',
79
82
  cause: 'hangup',
80
83
  errorMessage: 'call rejected',
81
- errorId: '4642074b-7b58-478b-96e4-3a60955c6765'
84
+ errorId: '4642074b-7b58-478b-96e4-3a60955c6765',
85
+ sipResponseCode: 486,
86
+ sipStatusLine: 'SIP/2.0 486 Busy Here',
87
+ sipHeaders: { 'reason' => 'v=analytics1' }
82
88
  })
83
89
  expect(transfer_disconnect_callback_from_hash).to be_instance_of(Bandwidth::TransferDisconnectCallback)
84
90
  expect(transfer_disconnect_callback_from_hash.event_type).to eq('transferDisconnect')
@@ -101,12 +107,15 @@ describe Bandwidth::TransferDisconnectCallback do
101
107
  expect(transfer_disconnect_callback_from_hash.cause).to eq('hangup')
102
108
  expect(transfer_disconnect_callback_from_hash.error_message).to eq('call rejected')
103
109
  expect(transfer_disconnect_callback_from_hash.error_id).to eq('4642074b-7b58-478b-96e4-3a60955c6765')
110
+ expect(transfer_disconnect_callback_from_hash.sip_response_code).to eq(486)
111
+ expect(transfer_disconnect_callback_from_hash.sip_status_line).to eq('SIP/2.0 486 Busy Here')
112
+ expect(transfer_disconnect_callback_from_hash.sip_headers).to eq({ 'reason' => 'v=analytics1' })
104
113
  end
105
114
  end
106
115
 
107
116
  describe '#to_s' do
108
117
  it 'returns a string representation of the object' do
109
- expect(transfer_disconnect_callback_values.to_s).to eq({ :eventType => 'transferDisconnect', :eventTime => '2022-06-16T13:15:07.160Z', :accountId => '9900000', :applicationId => '04e88489-df02-4e34-a0ee-27a91849555f', :from => '+19195554321', :to => '+19195551234', :direction => 'outbound', :callId => 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :callUrl => 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :parentCallId => 'c-95ac29a2-1331029c-2cb0-4a07-b215-b22865662d99', :enqueuedTime => '2022-06-16T13:15:07.160Z', :startTime => '2022-06-16T13:15:07.160Z', :answerTime => '2022-06-16T13:15:18.126Z', :endTime => '2022-06-16T13:16:18.126Z', :tag => 'custom tag', :transferCallerId => '+19195554321', :transferTo => '+19195551234', :cause => 'hangup', :errorMessage => 'call rejected', :errorId => '4642074b-7b58-478b-96e4-3a60955c6765' }.to_s)
118
+ expect(transfer_disconnect_callback_values.to_s).to eq({ :eventType => 'transferDisconnect', :eventTime => '2022-06-16T13:15:07.160Z', :accountId => '9900000', :applicationId => '04e88489-df02-4e34-a0ee-27a91849555f', :from => '+19195554321', :to => '+19195551234', :direction => 'outbound', :callId => 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :callUrl => 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :parentCallId => 'c-95ac29a2-1331029c-2cb0-4a07-b215-b22865662d99', :enqueuedTime => '2022-06-16T13:15:07.160Z', :startTime => '2022-06-16T13:15:07.160Z', :answerTime => '2022-06-16T13:15:18.126Z', :endTime => '2022-06-16T13:16:18.126Z', :tag => 'custom tag', :transferCallerId => '+19195554321', :transferTo => '+19195551234', :cause => 'hangup', :errorMessage => 'call rejected', :errorId => '4642074b-7b58-478b-96e4-3a60955c6765', :sipResponseCode => 486, :sipStatusLine => 'SIP/2.0 486 Busy Here', :sipHeaders => { 'reason' => 'v=analytics1' } }.to_s)
110
119
  end
111
120
  end
112
121
 
@@ -139,7 +148,10 @@ describe Bandwidth::TransferDisconnectCallback do
139
148
  transferTo: '+19195551234',
140
149
  cause: 'hangup',
141
150
  errorMessage: 'call rejected',
142
- errorId: '4642074b-7b58-478b-96e4-3a60955c6765'
151
+ errorId: '4642074b-7b58-478b-96e4-3a60955c6765',
152
+ sipResponseCode: 486,
153
+ sipStatusLine: 'SIP/2.0 486 Busy Here',
154
+ sipHeaders: { 'reason' => 'v=analytics1' }
143
155
  })
144
156
  end
145
157
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.3.1
4
+ version: 19.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bandwidth
@@ -307,6 +307,7 @@ files:
307
307
  - docs/RbmMessageContentText.md
308
308
  - docs/RbmMessageMedia.md
309
309
  - docs/RbmOpenUrlEnum.md
310
+ - docs/RbmSession.md
310
311
  - docs/RbmStandaloneCard.md
311
312
  - docs/RbmSuggestionResponse.md
312
313
  - docs/RbmWebViewEnum.md
@@ -569,6 +570,7 @@ files:
569
570
  - lib/bandwidth-sdk/models/rbm_message_content_text.rb
570
571
  - lib/bandwidth-sdk/models/rbm_message_media.rb
571
572
  - lib/bandwidth-sdk/models/rbm_open_url_enum.rb
573
+ - lib/bandwidth-sdk/models/rbm_session.rb
572
574
  - lib/bandwidth-sdk/models/rbm_standalone_card.rb
573
575
  - lib/bandwidth-sdk/models/rbm_suggestion_response.rb
574
576
  - lib/bandwidth-sdk/models/rbm_web_view_enum.rb
@@ -638,6 +640,7 @@ files:
638
640
  - spec/smoke/multi_channel_api_spec.rb
639
641
  - spec/smoke/phone_number_lookup_api_spec.rb
640
642
  - spec/smoke/recordings_api_spec.rb
643
+ - spec/smoke/smoke_helper.rb
641
644
  - spec/smoke/statistics_api_spec.rb
642
645
  - spec/smoke/toll_free_verification_api_spec.rb
643
646
  - spec/smoke/transcriptions_api_spec.rb
@@ -657,6 +660,7 @@ files:
657
660
  - spec/unit/client/api_client_spec.rb
658
661
  - spec/unit/client/api_error_spec.rb
659
662
  - spec/unit/client/configuration_spec.rb
663
+ - spec/unit/constants.rb
660
664
  - spec/unit/models/account_statistics_spec.rb
661
665
  - spec/unit/models/additional_denial_reason_spec.rb
662
666
  - spec/unit/models/address_spec.rb
@@ -838,6 +842,7 @@ files:
838
842
  - spec/unit/models/rbm_message_content_text_spec.rb
839
843
  - spec/unit/models/rbm_message_media_spec.rb
840
844
  - spec/unit/models/rbm_open_url_enum_spec.rb
845
+ - spec/unit/models/rbm_session_spec.rb
841
846
  - spec/unit/models/rbm_standalone_card_spec.rb
842
847
  - spec/unit/models/rbm_suggestion_response_spec.rb
843
848
  - spec/unit/models/rbm_web_view_enum_spec.rb
@@ -926,6 +931,7 @@ test_files:
926
931
  - spec/smoke/multi_channel_api_spec.rb
927
932
  - spec/smoke/phone_number_lookup_api_spec.rb
928
933
  - spec/smoke/recordings_api_spec.rb
934
+ - spec/smoke/smoke_helper.rb
929
935
  - spec/smoke/statistics_api_spec.rb
930
936
  - spec/smoke/toll_free_verification_api_spec.rb
931
937
  - spec/smoke/transcriptions_api_spec.rb
@@ -945,6 +951,7 @@ test_files:
945
951
  - spec/unit/client/api_client_spec.rb
946
952
  - spec/unit/client/api_error_spec.rb
947
953
  - spec/unit/client/configuration_spec.rb
954
+ - spec/unit/constants.rb
948
955
  - spec/unit/models/account_statistics_spec.rb
949
956
  - spec/unit/models/additional_denial_reason_spec.rb
950
957
  - spec/unit/models/address_spec.rb
@@ -1126,6 +1133,7 @@ test_files:
1126
1133
  - spec/unit/models/rbm_message_content_text_spec.rb
1127
1134
  - spec/unit/models/rbm_message_media_spec.rb
1128
1135
  - spec/unit/models/rbm_open_url_enum_spec.rb
1136
+ - spec/unit/models/rbm_session_spec.rb
1129
1137
  - spec/unit/models/rbm_standalone_card_spec.rb
1130
1138
  - spec/unit/models/rbm_suggestion_response_spec.rb
1131
1139
  - spec/unit/models/rbm_web_view_enum_spec.rb