bandwidth-sdk 15.1.0 → 16.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -11
- data/README.md +17 -10
- data/bandwidth.yml +523 -184
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +321 -366
- data/coverage/index.html +10047 -10501
- data/custom_templates/README.mustache +1 -1
- data/docs/BlockedWebhook.md +2 -2
- data/docs/Callback.md +84 -0
- data/docs/CreateMultiChannelMessageResponse.md +3 -3
- data/docs/ErrorObject.md +6 -4
- data/docs/ErrorSource.md +24 -0
- data/docs/FailureWebhook.md +2 -2
- data/docs/InboundCallback.md +28 -0
- data/docs/InboundCallbackMessage.md +48 -0
- data/docs/{MultiChannelStatusEnum.md → InboundCallbackTypeEnum.md} +2 -2
- data/docs/ListMessageItem.md +1 -1
- data/docs/Message.md +5 -5
- data/docs/MessageRequest.md +1 -1
- data/docs/MmsMessageContent.md +2 -2
- data/docs/MmsMessageContentFile.md +18 -0
- data/docs/MultiChannelActionCalendarEvent.md +2 -2
- data/docs/MultiChannelError.md +22 -0
- data/docs/MultiChannelMessageContent.md +20 -0
- data/docs/MultiChannelMessageResponseData.md +32 -0
- data/docs/MultiChannelMessageResponseDataChannelListInner.md +26 -0
- data/docs/RbmActionBase.md +2 -2
- data/docs/RbmActionDial.md +2 -2
- data/docs/RbmActionOpenUrl.md +2 -2
- data/docs/RbmActionViewLocation.md +2 -2
- data/docs/RbmLocationResponse.md +20 -0
- data/docs/RbmSuggestionResponse.md +20 -0
- data/docs/StatusCallback.md +32 -0
- data/docs/StatusCallbackMessage.md +42 -0
- data/docs/{CallbackTypeEnum.md → StatusCallbackTypeEnum.md} +2 -2
- data/docs/TfvStatus.md +2 -2
- data/docs/TfvSubmissionInfo.md +3 -3
- data/docs/TollFreeVerificationApi.md +72 -0
- data/docs/VerificationDenialWebhook.md +2 -2
- data/docs/VerificationRequest.md +3 -3
- data/docs/VerificationUpdateRequest.md +3 -3
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +82 -0
- data/lib/bandwidth-sdk/configuration.rb +6 -0
- data/lib/bandwidth-sdk/models/blocked_webhook.rb +2 -2
- data/lib/bandwidth-sdk/models/callback.rb +60 -0
- data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +1 -1
- data/lib/bandwidth-sdk/models/error_object.rb +45 -13
- data/lib/bandwidth-sdk/models/error_source.rb +244 -0
- data/lib/bandwidth-sdk/models/failure_webhook.rb +7 -7
- data/lib/bandwidth-sdk/models/{message_callback.rb → inbound_callback.rb} +9 -20
- data/lib/bandwidth-sdk/models/inbound_callback_message.rb +454 -0
- data/lib/bandwidth-sdk/models/{multi_channel_message_direction_enum.rb → inbound_callback_type_enum.rb} +7 -6
- data/lib/bandwidth-sdk/models/list_message_item.rb +1 -1
- data/lib/bandwidth-sdk/models/message.rb +3 -3
- data/lib/bandwidth-sdk/models/message_request.rb +1 -1
- data/lib/bandwidth-sdk/models/mms_message_content.rb +1 -2
- data/lib/bandwidth-sdk/models/{multi_channel_message_callback_data.rb → mms_message_content_file.rb} +37 -100
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +21 -21
- data/lib/bandwidth-sdk/models/multi_channel_error.rb +235 -0
- data/lib/bandwidth-sdk/models/{deferred_result.rb → multi_channel_message_content.rb} +17 -16
- data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +372 -0
- data/lib/bandwidth-sdk/models/{multi_channel_message_data.rb → multi_channel_message_response_data_channel_list_inner.rb} +62 -59
- data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -21
- data/lib/bandwidth-sdk/models/rbm_action_dial.rb +21 -21
- data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -21
- data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +21 -21
- data/lib/bandwidth-sdk/models/{tag.rb → rbm_location_response.rb} +18 -16
- data/lib/bandwidth-sdk/models/{multi_channel_callback_data.rb → rbm_suggestion_response.rb} +37 -67
- data/lib/bandwidth-sdk/models/status_callback.rb +338 -0
- data/lib/bandwidth-sdk/models/{message_callback_message.rb → status_callback_message.rb} +25 -17
- data/lib/bandwidth-sdk/models/{callback_type_enum.rb → status_callback_type_enum.rb} +5 -5
- data/lib/bandwidth-sdk/models/tfv_status.rb +2 -2
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +3 -3
- data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +2 -2
- data/lib/bandwidth-sdk/models/verification_request.rb +3 -3
- data/lib/bandwidth-sdk/models/verification_update_request.rb +3 -3
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +15 -9
- data/spec/smoke/multi_channel_api_spec.rb +18 -20
- data/spec/smoke/toll_free_verification_api_spec.rb +7 -0
- data/spec/unit/api/toll_free_verification_api_spec.rb +8 -0
- data/spec/unit/client/api_client_spec.rb +4 -4
- data/spec/unit/models/tfv_error_spec.rb +78 -0
- data/spec/unit/models/verify_code_response_spec.rb +70 -0
- metadata +112 -100
- data/docs/DeferredResult.md +0 -20
- data/docs/MessageCallback.md +0 -30
- data/docs/MessageCallbackMessage.md +0 -40
- data/docs/MultiChannelCallbackData.md +0 -26
- data/docs/MultiChannelMessageCallbackData.md +0 -32
- data/docs/MultiChannelMessageData.md +0 -34
- data/docs/MultiChannelMessageDirectionEnum.md +0 -15
- data/docs/Tag.md +0 -20
- data/lib/bandwidth-sdk/models/multi_channel_status_enum.rb +0 -42
- data/spec/unit/models/deferred_result_spec.rb +0 -74
- /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_asc.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_both.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_desc.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/application.css +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/application.js +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/border.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/controls.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/loading.gif +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/loading_background.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/favicon_green.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/favicon_red.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/favicon_yellow.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_222222_256x240.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_2e83ff_256x240.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_454545_256x240.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_888888_256x240.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_cd0a0a_256x240.png +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/loading.gif +0 -0
- /data/coverage/assets/{0.13.1 → 0.13.2}/magnify.png +0 -0
data/lib/bandwidth-sdk.rb
CHANGED
@@ -33,8 +33,8 @@ require 'bandwidth-sdk/models/call_transcription_detected_language_enum'
|
|
33
33
|
require 'bandwidth-sdk/models/call_transcription_metadata'
|
34
34
|
require 'bandwidth-sdk/models/call_transcription_response'
|
35
35
|
require 'bandwidth-sdk/models/call_transcription_track_enum'
|
36
|
+
require 'bandwidth-sdk/models/callback'
|
36
37
|
require 'bandwidth-sdk/models/callback_method_enum'
|
37
|
-
require 'bandwidth-sdk/models/callback_type_enum'
|
38
38
|
require 'bandwidth-sdk/models/card_width_enum'
|
39
39
|
require 'bandwidth-sdk/models/code_request'
|
40
40
|
require 'bandwidth-sdk/models/conference'
|
@@ -53,16 +53,19 @@ require 'bandwidth-sdk/models/create_call_response'
|
|
53
53
|
require 'bandwidth-sdk/models/create_lookup_response'
|
54
54
|
require 'bandwidth-sdk/models/create_message_request_error'
|
55
55
|
require 'bandwidth-sdk/models/create_multi_channel_message_response'
|
56
|
-
require 'bandwidth-sdk/models/deferred_result'
|
57
56
|
require 'bandwidth-sdk/models/disconnect_callback'
|
58
57
|
require 'bandwidth-sdk/models/diversion'
|
59
58
|
require 'bandwidth-sdk/models/dtmf_callback'
|
60
59
|
require 'bandwidth-sdk/models/error'
|
61
60
|
require 'bandwidth-sdk/models/error_object'
|
61
|
+
require 'bandwidth-sdk/models/error_source'
|
62
62
|
require 'bandwidth-sdk/models/failure_webhook'
|
63
63
|
require 'bandwidth-sdk/models/field_error'
|
64
64
|
require 'bandwidth-sdk/models/file_format_enum'
|
65
65
|
require 'bandwidth-sdk/models/gather_callback'
|
66
|
+
require 'bandwidth-sdk/models/inbound_callback'
|
67
|
+
require 'bandwidth-sdk/models/inbound_callback_message'
|
68
|
+
require 'bandwidth-sdk/models/inbound_callback_type_enum'
|
66
69
|
require 'bandwidth-sdk/models/initiate_callback'
|
67
70
|
require 'bandwidth-sdk/models/link'
|
68
71
|
require 'bandwidth-sdk/models/links_object'
|
@@ -78,8 +81,6 @@ require 'bandwidth-sdk/models/machine_detection_mode_enum'
|
|
78
81
|
require 'bandwidth-sdk/models/machine_detection_result'
|
79
82
|
require 'bandwidth-sdk/models/media'
|
80
83
|
require 'bandwidth-sdk/models/message'
|
81
|
-
require 'bandwidth-sdk/models/message_callback'
|
82
|
-
require 'bandwidth-sdk/models/message_callback_message'
|
83
84
|
require 'bandwidth-sdk/models/message_direction_enum'
|
84
85
|
require 'bandwidth-sdk/models/message_request'
|
85
86
|
require 'bandwidth-sdk/models/message_status_enum'
|
@@ -91,17 +92,17 @@ require 'bandwidth-sdk/models/mfa_forbidden_request_error'
|
|
91
92
|
require 'bandwidth-sdk/models/mfa_request_error'
|
92
93
|
require 'bandwidth-sdk/models/mfa_unauthorized_request_error'
|
93
94
|
require 'bandwidth-sdk/models/mms_message_content'
|
95
|
+
require 'bandwidth-sdk/models/mms_message_content_file'
|
94
96
|
require 'bandwidth-sdk/models/multi_channel_action'
|
95
97
|
require 'bandwidth-sdk/models/multi_channel_action_calendar_event'
|
96
|
-
require 'bandwidth-sdk/models/multi_channel_callback_data'
|
97
98
|
require 'bandwidth-sdk/models/multi_channel_channel_list_object'
|
98
99
|
require 'bandwidth-sdk/models/multi_channel_channel_list_object_content'
|
99
|
-
require 'bandwidth-sdk/models/
|
100
|
+
require 'bandwidth-sdk/models/multi_channel_error'
|
100
101
|
require 'bandwidth-sdk/models/multi_channel_message_channel_enum'
|
101
|
-
require 'bandwidth-sdk/models/
|
102
|
-
require 'bandwidth-sdk/models/multi_channel_message_direction_enum'
|
102
|
+
require 'bandwidth-sdk/models/multi_channel_message_content'
|
103
103
|
require 'bandwidth-sdk/models/multi_channel_message_request'
|
104
|
-
require 'bandwidth-sdk/models/
|
104
|
+
require 'bandwidth-sdk/models/multi_channel_message_response_data'
|
105
|
+
require 'bandwidth-sdk/models/multi_channel_message_response_data_channel_list_inner'
|
105
106
|
require 'bandwidth-sdk/models/opt_in_workflow'
|
106
107
|
require 'bandwidth-sdk/models/page_info'
|
107
108
|
require 'bandwidth-sdk/models/priority_enum'
|
@@ -112,6 +113,7 @@ require 'bandwidth-sdk/models/rbm_action_type_enum'
|
|
112
113
|
require 'bandwidth-sdk/models/rbm_action_view_location'
|
113
114
|
require 'bandwidth-sdk/models/rbm_card_content'
|
114
115
|
require 'bandwidth-sdk/models/rbm_card_content_media'
|
116
|
+
require 'bandwidth-sdk/models/rbm_location_response'
|
115
117
|
require 'bandwidth-sdk/models/rbm_media_height_enum'
|
116
118
|
require 'bandwidth-sdk/models/rbm_message_carousel_card'
|
117
119
|
require 'bandwidth-sdk/models/rbm_message_content_file'
|
@@ -119,6 +121,7 @@ require 'bandwidth-sdk/models/rbm_message_content_rich_card'
|
|
119
121
|
require 'bandwidth-sdk/models/rbm_message_content_text'
|
120
122
|
require 'bandwidth-sdk/models/rbm_message_media'
|
121
123
|
require 'bandwidth-sdk/models/rbm_standalone_card'
|
124
|
+
require 'bandwidth-sdk/models/rbm_suggestion_response'
|
122
125
|
require 'bandwidth-sdk/models/recording_available_callback'
|
123
126
|
require 'bandwidth-sdk/models/recording_complete_callback'
|
124
127
|
require 'bandwidth-sdk/models/recording_state_enum'
|
@@ -128,6 +131,9 @@ require 'bandwidth-sdk/models/redirect_callback'
|
|
128
131
|
require 'bandwidth-sdk/models/redirect_method_enum'
|
129
132
|
require 'bandwidth-sdk/models/sms_message_content'
|
130
133
|
require 'bandwidth-sdk/models/standalone_card_orientation_enum'
|
134
|
+
require 'bandwidth-sdk/models/status_callback'
|
135
|
+
require 'bandwidth-sdk/models/status_callback_message'
|
136
|
+
require 'bandwidth-sdk/models/status_callback_type_enum'
|
131
137
|
require 'bandwidth-sdk/models/stir_shaken'
|
132
138
|
require 'bandwidth-sdk/models/telephone_number'
|
133
139
|
require 'bandwidth-sdk/models/tfv_basic_authentication'
|
@@ -13,28 +13,26 @@ describe 'MultiChannelApi' do
|
|
13
13
|
# Create Multi-Channel Message
|
14
14
|
describe 'create_multi_channel_message' do
|
15
15
|
it 'creates a multi channel message' do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
)
|
16
|
+
message_body = Bandwidth::MultiChannelChannelListObject.new(
|
17
|
+
from: BW_NUMBER,
|
18
|
+
application_id: BW_MESSAGING_APPLICATION_ID,
|
19
|
+
channel: Bandwidth::MultiChannelMessageChannelEnum::RBM,
|
20
|
+
content: Bandwidth::RbmMessageContentText.new(
|
21
|
+
text: 'Hello, this is a test message.',
|
23
22
|
)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
data, status_code = @multi_channel_api_instance.create_multi_channel_message_with_http_info(BW_ACCOUNT_ID, multi_channel_message_request)
|
23
|
+
)
|
24
|
+
multi_channel_message_request = Bandwidth::MultiChannelMessageRequest.new(
|
25
|
+
to: USER_NUMBER,
|
26
|
+
channel_list: [message_body],
|
27
|
+
tag: 'tag',
|
28
|
+
priority: 'high',
|
29
|
+
expiration: @expiration_time,
|
30
|
+
)
|
33
31
|
|
34
|
-
|
35
|
-
expect(data).to be_instance_of(Bandwidth::CreateMultiChannelMessageResponse)
|
36
|
-
end
|
32
|
+
data, status_code = @multi_channel_api_instance.create_multi_channel_message_with_http_info(BW_ACCOUNT_ID, multi_channel_message_request)
|
37
33
|
|
38
|
-
|
34
|
+
expect(status_code).to eq(202)
|
35
|
+
expect(data).to be_instance_of(Bandwidth::CreateMultiChannelMessageResponse)
|
36
|
+
end if false # skip while still in beta
|
39
37
|
end
|
40
38
|
end
|
@@ -29,6 +29,13 @@ describe 'TollFreeVerificationApi' do
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
# Delete a Toll-Free Verification Submission
|
33
|
+
describe 'delete_verification_request' do
|
34
|
+
it 'deletes a toll free verification submission' do
|
35
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
32
39
|
# List Toll-Free Use Cases
|
33
40
|
describe 'list_toll_free_use_cases test' do
|
34
41
|
it 'lists toll free use cases' do
|
@@ -136,6 +136,14 @@ describe 'TollFreeVerificationApi' do
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
+
# Delete a Toll-Free Verification Submission
|
140
|
+
describe 'delete_verification_request' do
|
141
|
+
it 'deletes a toll free verification submission' do
|
142
|
+
_data, status_code = @tfv_api_instance.delete_verification_request_with_http_info(BW_ACCOUNT_ID, tf_phone_number)
|
143
|
+
expect(status_code).to eq(204)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
139
147
|
# List Toll-Free Use Cases
|
140
148
|
describe 'list_toll_free_use_cases test' do
|
141
149
|
it 'lists toll free use cases' do
|
@@ -268,7 +268,7 @@ describe Bandwidth::ApiClient do
|
|
268
268
|
expect(api_client_default.convert_to_type({ id: 1 }, 'Object')).to eq({ id: 1 })
|
269
269
|
expect(api_client_default.convert_to_type([[12, 34], [56]], 'Array<Array<Integer>>')).to eq([[12, 34], [56]])
|
270
270
|
expect(api_client_default.convert_to_type({ "id": 'test' }, 'Hash<String, String>')).to eq({ id: 'test' })
|
271
|
-
expect(api_client_default.convert_to_type({
|
271
|
+
expect(api_client_default.convert_to_type({ valid: true }, 'VerifyCodeResponse')).to be_instance_of(Bandwidth::VerifyCodeResponse)
|
272
272
|
end
|
273
273
|
end
|
274
274
|
|
@@ -353,10 +353,10 @@ describe Bandwidth::ApiClient do
|
|
353
353
|
end
|
354
354
|
|
355
355
|
it 'returns hash when object can be converted to hash' do
|
356
|
-
model = Bandwidth::
|
357
|
-
|
356
|
+
model = Bandwidth::VerifyCodeResponse.new({
|
357
|
+
valid: true
|
358
358
|
})
|
359
|
-
expected = {
|
359
|
+
expected = { valid: true }
|
360
360
|
expect(api_client_default.object_to_hash(model)).to eq(expected)
|
361
361
|
end
|
362
362
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# Unit tests for Bandwidth::TfvError
|
2
|
+
describe Bandwidth::TfvError do
|
3
|
+
let(:tfv_error_default) { Bandwidth::TfvError.new }
|
4
|
+
let(:tfv_error_values) { Bandwidth::TfvError.new({
|
5
|
+
type: 'type',
|
6
|
+
description: 'description',
|
7
|
+
errors: { key: 'value' }
|
8
|
+
}) }
|
9
|
+
|
10
|
+
describe '#initialize' do
|
11
|
+
it 'causes an ArgumentError by passing an Array to the initialize method' do
|
12
|
+
expect {
|
13
|
+
Bandwidth::TfvError.new([])
|
14
|
+
}.to raise_error(ArgumentError)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'causes an ArgumentError by passing an invalid attribute to the initialize method' do
|
18
|
+
expect {
|
19
|
+
Bandwidth::TfvError.new({ invalid: true })
|
20
|
+
}.to raise_error(ArgumentError)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#acceptable_attributes' do
|
25
|
+
it 'expects acceptable JSON attributes to be those in the attribute map' do
|
26
|
+
expect(Bandwidth::TfvError.acceptable_attributes).to eq(Bandwidth::TfvError.attribute_map.values)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'enum validation' do
|
31
|
+
it 'works' do
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '#build_from_hash' do
|
37
|
+
it 'validates instance of TfvError created by the build_from_hash method' do
|
38
|
+
tfv_error_from_hash = Bandwidth::TfvError.build_from_hash({
|
39
|
+
type: 'type',
|
40
|
+
description: 'description',
|
41
|
+
errors: { key: 'value' }
|
42
|
+
})
|
43
|
+
expect(tfv_error_from_hash).to be_instance_of(Bandwidth::TfvError)
|
44
|
+
expect(tfv_error_from_hash.type).to eq('type')
|
45
|
+
expect(tfv_error_from_hash.description).to eq('description')
|
46
|
+
expect(tfv_error_from_hash.errors).to eq({ key: 'value' })
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#hash' do
|
51
|
+
it 'returns a hash code according to attributes' do
|
52
|
+
expect(tfv_error_default.hash).to be_instance_of(Integer)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '#to_s' do
|
57
|
+
it 'returns a string representation of the object' do
|
58
|
+
expect(tfv_error_values.to_s).to eq('{:type=>"type", :description=>"description", :errors=>{:key=>"value"}}')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#eq? #==' do
|
63
|
+
it 'returns true/false when comparing objects' do
|
64
|
+
expect(tfv_error_default.eql?(Bandwidth::TfvError.new)).to be true
|
65
|
+
expect(tfv_error_default.eql?(tfv_error_values)).to be false
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
describe '#to_body #to_hash' do
|
70
|
+
it 'returns a hash representation of the object' do
|
71
|
+
expect(tfv_error_values.to_body).to eq({
|
72
|
+
type: 'type',
|
73
|
+
description: 'description',
|
74
|
+
errors: { key: 'value' }
|
75
|
+
})
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Unit tests for Bandwidth::VerifyCodeResponse
|
2
|
+
describe Bandwidth::VerifyCodeResponse do
|
3
|
+
let(:verify_code_response_default) { Bandwidth::VerifyCodeResponse.new }
|
4
|
+
let(:verify_code_response_values) { Bandwidth::VerifyCodeResponse.new({
|
5
|
+
valid: true
|
6
|
+
}) }
|
7
|
+
|
8
|
+
describe '#initialize' do
|
9
|
+
it 'causes an ArgumentError by passing an Array to the initialize method' do
|
10
|
+
expect {
|
11
|
+
Bandwidth::VerifyCodeResponse.new([])
|
12
|
+
}.to raise_error(ArgumentError)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'causes an ArgumentError by passing an invalid attribute to the initialize method' do
|
16
|
+
expect {
|
17
|
+
Bandwidth::VerifyCodeResponse.new({ invalid: true })
|
18
|
+
}.to raise_error(ArgumentError)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#acceptable_attributes' do
|
23
|
+
it 'expects acceptable JSON attributes to be those in the attribute map' do
|
24
|
+
expect(Bandwidth::VerifyCodeResponse.acceptable_attributes).to eq(Bandwidth::VerifyCodeResponse.attribute_map.values)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#openapi_nullable' do
|
29
|
+
it 'expects nullable attributes to be an empty set' do
|
30
|
+
expect(Bandwidth::VerifyCodeResponse.openapi_nullable).to eq(Set.new([]))
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#build_from_hash' do
|
35
|
+
it 'validates instance of VerifyCodeResponse created by the build_from_hash method' do
|
36
|
+
verify_code_response_from_hash = Bandwidth::VerifyCodeResponse.build_from_hash({
|
37
|
+
valid: true
|
38
|
+
})
|
39
|
+
expect(verify_code_response_from_hash).to be_instance_of(Bandwidth::VerifyCodeResponse)
|
40
|
+
expect(verify_code_response_from_hash.valid).to be true
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe '#hash' do
|
45
|
+
it 'returns a hash code according to attributes' do
|
46
|
+
expect(verify_code_response_default.hash).to be_instance_of(Integer)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#to_s' do
|
51
|
+
it 'returns a string representation of the object' do
|
52
|
+
expect(verify_code_response_values.to_s).to eq('{:valid=>true}')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '#eq? #==' do
|
57
|
+
it 'returns true/false when comparing objects' do
|
58
|
+
expect(verify_code_response_default.eql?(Bandwidth::VerifyCodeResponse.new)).to be true
|
59
|
+
expect(verify_code_response_default.eql?(verify_code_response_values)).to be false
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe '#to_body #to_hash' do
|
64
|
+
it 'returns a hash representation of the object' do
|
65
|
+
expect(verify_code_response_values.to_body).to eq({
|
66
|
+
valid: true
|
67
|
+
})
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|