freeclimb 4.5.2 → 4.6.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/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -6
- data/docs/AddToConference.md +0 -2
- data/docs/AddToConferenceAllOf.md +0 -2
- data/docs/CreateWebRTCToken.md +22 -0
- data/docs/DefaultApi.md +302 -7
- data/docs/GetDigits.md +1 -1
- data/docs/GetDigitsAllOf.md +1 -1
- data/docs/IncomingNumberResult.md +3 -1
- data/docs/IncomingNumberResultAllOf.md +3 -1
- data/docs/MessageRequest.md +2 -2
- data/docs/MessageRequestAllOf.md +2 -2
- data/docs/MessageResult.md +3 -1
- data/docs/MessageResultAllOf.md +3 -1
- data/docs/Play.md +0 -2
- data/docs/PlayAllOf.md +0 -2
- data/docs/RemoveFromConference.md +1 -4
- data/docs/SMSTenDLCCampaign.md +10 -0
- data/docs/SMSTollFreeCampaign.md +30 -0
- data/docs/SMSTollFreeCampaignsListResult.md +32 -0
- data/docs/SMSTollFreeCampaignsListResultAllOf.md +18 -0
- data/docs/Say.md +0 -2
- data/docs/SayAllOf.md +0 -2
- data/docs/SetListen.md +0 -2
- data/docs/SetListenAllOf.md +0 -2
- data/docs/SetTalk.md +0 -2
- data/docs/SetTalkAllOf.md +0 -2
- data/docs/TFN.md +18 -0
- data/docs/TerminateConference.md +1 -4
- data/lib/freeclimb/api/default_api.rb +258 -7
- data/lib/freeclimb/models/add_to_conference.rb +1 -13
- data/lib/freeclimb/models/add_to_conference_all_of.rb +1 -13
- data/lib/freeclimb/models/create_web_rtc_token.rb +278 -0
- data/lib/freeclimb/models/get_digits.rb +1 -1
- data/lib/freeclimb/models/get_digits_all_of.rb +1 -1
- data/lib/freeclimb/models/incoming_number_result.rb +16 -5
- data/lib/freeclimb/models/incoming_number_result_all_of.rb +16 -5
- data/lib/freeclimb/models/message_request.rb +11 -9
- data/lib/freeclimb/models/message_request_all_of.rb +11 -9
- data/lib/freeclimb/models/message_result.rb +19 -5
- data/lib/freeclimb/models/message_result_all_of.rb +19 -5
- data/lib/freeclimb/models/play.rb +1 -13
- data/lib/freeclimb/models/play_all_of.rb +1 -13
- data/lib/freeclimb/models/remove_from_conference.rb +3 -23
- data/lib/freeclimb/models/say.rb +1 -13
- data/lib/freeclimb/models/say_all_of.rb +1 -13
- data/lib/freeclimb/models/set_listen.rb +2 -18
- data/lib/freeclimb/models/set_listen_all_of.rb +2 -18
- data/lib/freeclimb/models/set_talk.rb +2 -18
- data/lib/freeclimb/models/set_talk_all_of.rb +2 -18
- data/lib/freeclimb/models/sms_ten_dlc_campaign.rb +131 -1
- data/lib/freeclimb/models/sms_toll_free_campaign.rb +349 -0
- data/lib/freeclimb/models/sms_toll_free_campaigns_list_result.rb +311 -0
- data/lib/freeclimb/models/sms_toll_free_campaigns_list_result_all_of.rb +226 -0
- data/lib/freeclimb/models/terminate_conference.rb +3 -23
- data/lib/freeclimb/models/tfn.rb +229 -0
- data/lib/freeclimb/version.rb +1 -1
- data/lib/freeclimb.rb +5 -2
- data/openapi.json +605 -110
- data/package.json +8 -0
- data/spec/api/default_api_spec.rb +104 -3
- data/spec/models/add_to_conference_spec.rb +0 -30
- data/spec/models/create_web_rtc_token_spec.rb +225 -0
- data/spec/models/get_digits_spec.rb +19 -19
- data/spec/models/incoming_number_result_spec.rb +25 -0
- data/spec/models/message_request_spec.rb +23 -23
- data/spec/models/message_result_spec.rb +30 -0
- data/spec/models/play_spec.rb +0 -30
- data/spec/models/remove_from_conference_spec.rb +1 -67
- data/spec/models/say_spec.rb +0 -30
- data/spec/models/set_listen_spec.rb +0 -31
- data/spec/models/set_talk_spec.rb +0 -31
- data/spec/models/sms_ten_dlc_campaign_spec.rb +165 -0
- data/spec/models/sms_toll_free_campaign_spec.rb +368 -0
- data/spec/models/sms_toll_free_campaigns_list_result_spec.rb +371 -0
- data/spec/models/terminate_conference_spec.rb +1 -67
- data/spec/models/tfn_spec.rb +162 -0
- data/yarn.lock +1292 -0
- metadata +103 -83
data/package.json
ADDED
@@ -245,6 +245,10 @@ describe 'DefaultApi' do
|
|
245
245
|
@account_request_update_an_account_test_value = Freeclimb::AccountRequest.new
|
246
246
|
|
247
247
|
@incoming_number_request_update_an_incoming_number_test_value = Freeclimb::IncomingNumberRequest.new
|
248
|
+
|
249
|
+
@campaign_id_get_toll_free_sms_campaign_test_value = 'CX56XX4'
|
250
|
+
|
251
|
+
@create_web_rtc_token_make_a_webrtc_jwt_test_value=Freeclimb::CreateWebRTCToken.new({to: 'to_example', from: 'from_example', uses: 2})
|
248
252
|
end
|
249
253
|
|
250
254
|
after do
|
@@ -904,6 +908,50 @@ describe 'DefaultApi' do
|
|
904
908
|
end
|
905
909
|
end
|
906
910
|
|
911
|
+
# unit tests for get_toll_free_sms_campaign
|
912
|
+
# Get a TollFree SMS Campaign
|
913
|
+
# @param campaign_id String that uniquely identifies this TollFree Campaign resource.
|
914
|
+
# @param [Hash] opts the optional parameters
|
915
|
+
# @return [SMSTollFreeCampaign]
|
916
|
+
describe 'get_toll_free_sms_campaign test' do
|
917
|
+
it 'should work' do
|
918
|
+
|
919
|
+
campaign_id = @campaign_id_get_toll_free_sms_campaign_test_value
|
920
|
+
|
921
|
+
result = @api_instance.get_toll_free_sms_campaign(
|
922
|
+
campaign_id,
|
923
|
+
{
|
924
|
+
|
925
|
+
}
|
926
|
+
)
|
927
|
+
|
928
|
+
expect(result).to be_a Freeclimb::SMSTollFreeCampaign
|
929
|
+
|
930
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
931
|
+
end
|
932
|
+
end
|
933
|
+
|
934
|
+
# unit tests for get_toll_free_sms_campaigns
|
935
|
+
# Get list of TollFree Campaigns
|
936
|
+
# @param [Hash] opts the optional parameters
|
937
|
+
# @return [SMSTollFreeCampaignsListResult]
|
938
|
+
describe 'get_toll_free_sms_campaigns test' do
|
939
|
+
it 'should work' do
|
940
|
+
|
941
|
+
|
942
|
+
result = @api_instance.get_toll_free_sms_campaigns(
|
943
|
+
|
944
|
+
{
|
945
|
+
|
946
|
+
}
|
947
|
+
)
|
948
|
+
|
949
|
+
expect(result).to be_a Freeclimb::SMSTollFreeCampaignsListResult
|
950
|
+
|
951
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
952
|
+
end
|
953
|
+
end
|
954
|
+
|
907
955
|
# unit tests for list_active_queues
|
908
956
|
# List Active Queues
|
909
957
|
# @param [Hash] opts the optional parameters
|
@@ -1097,6 +1145,33 @@ describe 'DefaultApi' do
|
|
1097
1145
|
end
|
1098
1146
|
end
|
1099
1147
|
|
1148
|
+
# unit tests for list_conference_recordings
|
1149
|
+
# List Conference Recordings
|
1150
|
+
# @param [Hash] opts the optional parameters
|
1151
|
+
# @option opts [String] :call_id Show only Recordings made during the Call with this ID.
|
1152
|
+
# @option opts [String] :conference_id Show only Recordings made during the conference with this ID.
|
1153
|
+
# @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*.
|
1154
|
+
# @return [RecordingList]
|
1155
|
+
describe 'list_conference_recordings test' do
|
1156
|
+
it 'should work' do
|
1157
|
+
|
1158
|
+
call_id = @call_id_list_conference_recordings_test_value
|
1159
|
+
conference_id = @conference_id_list_conference_recordings_test_value
|
1160
|
+
date_created = @date_created_list_conference_recordings_test_value
|
1161
|
+
|
1162
|
+
result = @api_instance.list_conference_recordings(
|
1163
|
+
|
1164
|
+
{
|
1165
|
+
:call_id => call_id,:conference_id => conference_id,:date_created => date_created,
|
1166
|
+
}
|
1167
|
+
)
|
1168
|
+
|
1169
|
+
expect(result).to be_a Freeclimb::RecordingList
|
1170
|
+
|
1171
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
1172
|
+
end
|
1173
|
+
end
|
1174
|
+
|
1100
1175
|
# unit tests for list_conferences
|
1101
1176
|
# List Conferences
|
1102
1177
|
# @param [Hash] opts the optional parameters
|
@@ -1143,6 +1218,7 @@ describe 'DefaultApi' do
|
|
1143
1218
|
# @option opts [Boolean] :capabilities_toll_free
|
1144
1219
|
# @option opts [Boolean] :capabilities_ten_dlc
|
1145
1220
|
# @option opts [Boolean] :capabilities_short_code
|
1221
|
+
# @option opts [String] :tfn_campaign_id Only show incoming phone number resources that have been assigned to the provided TFNCampaign ID.
|
1146
1222
|
# @option opts [Boolean] :offnet Indication of whether the phone number was registered as an offnet number. This field will be rendered only for requests to the IncomingPhone number resource.
|
1147
1223
|
# @return [IncomingNumberList]
|
1148
1224
|
describe 'list_incoming_numbers test' do
|
@@ -1162,12 +1238,13 @@ describe 'DefaultApi' do
|
|
1162
1238
|
capabilities_toll_free = @capabilities_toll_free_list_incoming_numbers_test_value
|
1163
1239
|
capabilities_ten_dlc = @capabilities_ten_dlc_list_incoming_numbers_test_value
|
1164
1240
|
capabilities_short_code = @capabilities_short_code_list_incoming_numbers_test_value
|
1241
|
+
tfn_campaign_id = @tfn_campaign_id_list_incoming_numbers_test_value
|
1165
1242
|
offnet = @offnet_list_incoming_numbers_test_value
|
1166
1243
|
|
1167
1244
|
result = @api_instance.list_incoming_numbers(
|
1168
1245
|
|
1169
1246
|
{
|
1170
|
-
:phone_number => phone_number,:_alias => _alias,:region => region,:country => country,:application_id => application_id,:has_application => has_application,:voice_enabled => voice_enabled,:sms_enabled => sms_enabled,:has_campaign => has_campaign,:capabilities_voice => capabilities_voice,:capabilities_sms => capabilities_sms,:capabilities_toll_free => capabilities_toll_free,:capabilities_ten_dlc => capabilities_ten_dlc,:capabilities_short_code => capabilities_short_code,:offnet => offnet,
|
1247
|
+
:phone_number => phone_number,:_alias => _alias,:region => region,:country => country,:application_id => application_id,:has_application => has_application,:voice_enabled => voice_enabled,:sms_enabled => sms_enabled,:has_campaign => has_campaign,:capabilities_voice => capabilities_voice,:capabilities_sms => capabilities_sms,:capabilities_toll_free => capabilities_toll_free,:capabilities_ten_dlc => capabilities_ten_dlc,:capabilities_short_code => capabilities_short_code,:tfn_campaign_id => tfn_campaign_id,:offnet => offnet,
|
1171
1248
|
}
|
1172
1249
|
)
|
1173
1250
|
|
@@ -1314,6 +1391,30 @@ describe 'DefaultApi' do
|
|
1314
1391
|
end
|
1315
1392
|
end
|
1316
1393
|
|
1394
|
+
# unit tests for make_a_webrtc_jwt
|
1395
|
+
# Make a JWT for WebRTC calling
|
1396
|
+
# Make a JWT for WebRTC calling
|
1397
|
+
# @param create_web_rtc_token Information needed to craft a JWT compatible with the platforms WebRTC APIs
|
1398
|
+
# @param [Hash] opts the optional parameters
|
1399
|
+
# @return [String]
|
1400
|
+
describe 'make_a_webrtc_jwt test' do
|
1401
|
+
it 'should work' do
|
1402
|
+
|
1403
|
+
create_web_rtc_token = @create_web_rtc_token_make_a_webrtc_jwt_test_value
|
1404
|
+
|
1405
|
+
result = @api_instance.make_a_webrtc_jwt(
|
1406
|
+
create_web_rtc_token,
|
1407
|
+
{
|
1408
|
+
|
1409
|
+
}
|
1410
|
+
)
|
1411
|
+
|
1412
|
+
expect(result).to be_a String
|
1413
|
+
|
1414
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
1415
|
+
end
|
1416
|
+
end
|
1417
|
+
|
1317
1418
|
# unit tests for remove_a_participant
|
1318
1419
|
# Remove a Participant
|
1319
1420
|
# @param conference_id ID of the conference this participant is in.
|
@@ -1390,7 +1491,7 @@ describe 'DefaultApi' do
|
|
1390
1491
|
# @param conference_id String that uniquely identifies this conference resource.
|
1391
1492
|
# @param [Hash] opts the optional parameters
|
1392
1493
|
# @option opts [UpdateConferenceRequest] :update_conference_request Conference Details to update
|
1393
|
-
# @return [
|
1494
|
+
# @return [nil]
|
1394
1495
|
describe 'update_a_conference test' do
|
1395
1496
|
it 'should work' do
|
1396
1497
|
|
@@ -1404,8 +1505,8 @@ describe 'DefaultApi' do
|
|
1404
1505
|
}
|
1405
1506
|
)
|
1406
1507
|
|
1407
|
-
expect(result).to be_a Freeclimb::ConferenceResult
|
1408
1508
|
|
1509
|
+
expect(result).to be_nil
|
1409
1510
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
1410
1511
|
end
|
1411
1512
|
end
|
@@ -54,13 +54,6 @@ describe Freeclimb::AddToConference do
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
describe 'test attribute "call_id"' do
|
58
|
-
it 'should work' do
|
59
|
-
instance.call_id = "TEST_STRING"
|
60
|
-
expect(instance.call_id).to eq("TEST_STRING")
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
57
|
describe 'test attribute "leave_conference_url"' do
|
65
58
|
it 'should work' do
|
66
59
|
instance.leave_conference_url = "TEST_STRING"
|
@@ -103,7 +96,6 @@ describe Freeclimb::AddToConference do
|
|
103
96
|
call_control_sequence: "TS",
|
104
97
|
call_control_url: "TS",
|
105
98
|
conference_id: "TS",
|
106
|
-
call_id: "TS",
|
107
99
|
leave_conference_url: "TS",
|
108
100
|
listen: true,
|
109
101
|
notification_url: "TS",
|
@@ -117,7 +109,6 @@ describe Freeclimb::AddToConference do
|
|
117
109
|
call_control_sequence: "TS",
|
118
110
|
call_control_url: "TS",
|
119
111
|
conference_id: "TS",
|
120
|
-
call_id: "TS",
|
121
112
|
leave_conference_url: "TS",
|
122
113
|
listen: true,
|
123
114
|
notification_url: "TS",
|
@@ -132,7 +123,6 @@ describe Freeclimb::AddToConference do
|
|
132
123
|
call_control_sequence: "TS",
|
133
124
|
call_control_url: "TS",
|
134
125
|
conference_id: "TS",
|
135
|
-
call_id: "TS",
|
136
126
|
leave_conference_url: "TS",
|
137
127
|
listen: true,
|
138
128
|
notification_url: "TS",
|
@@ -150,7 +140,6 @@ describe Freeclimb::AddToConference do
|
|
150
140
|
call_control_sequence: "TS",
|
151
141
|
call_control_url: "TS",
|
152
142
|
conference_id: "TS",
|
153
|
-
call_id: "TS",
|
154
143
|
leave_conference_url: "TS",
|
155
144
|
listen: true,
|
156
145
|
notification_url: "TS",
|
@@ -179,7 +168,6 @@ describe Freeclimb::AddToConference do
|
|
179
168
|
call_control_sequence: "TS",
|
180
169
|
call_control_url: "TS",
|
181
170
|
conference_id: "TS",
|
182
|
-
call_id: "TS",
|
183
171
|
leave_conference_url: "TS",
|
184
172
|
listen: true,
|
185
173
|
notification_url: "TS",
|
@@ -191,7 +179,6 @@ describe Freeclimb::AddToConference do
|
|
191
179
|
call_control_sequence: "TS",
|
192
180
|
call_control_url: "TS",
|
193
181
|
conference_id: "TS",
|
194
|
-
call_id: "TS",
|
195
182
|
leave_conference_url: "TS",
|
196
183
|
listen: true,
|
197
184
|
notification_url: "TS",
|
@@ -206,7 +193,6 @@ describe Freeclimb::AddToConference do
|
|
206
193
|
call_control_sequence: "TS",
|
207
194
|
call_control_url: "TS",
|
208
195
|
conference_id: "TS",
|
209
|
-
call_id: "TS",
|
210
196
|
leave_conference_url: "TS",
|
211
197
|
listen: true,
|
212
198
|
notification_url: "TS",
|
@@ -218,7 +204,6 @@ describe Freeclimb::AddToConference do
|
|
218
204
|
call_control_sequence: "ST",
|
219
205
|
call_control_url: "ST",
|
220
206
|
conference_id: "ST",
|
221
|
-
call_id: "ST",
|
222
207
|
leave_conference_url: "ST",
|
223
208
|
listen: false,
|
224
209
|
notification_url: "ST",
|
@@ -236,7 +221,6 @@ describe Freeclimb::AddToConference do
|
|
236
221
|
call_control_sequence: "TS",
|
237
222
|
call_control_url: "TS",
|
238
223
|
conference_id: "TS",
|
239
|
-
call_id: "TS",
|
240
224
|
leave_conference_url: "TS",
|
241
225
|
listen: true,
|
242
226
|
notification_url: "TS",
|
@@ -254,7 +238,6 @@ describe Freeclimb::AddToConference do
|
|
254
238
|
call_control_sequence: "TS",
|
255
239
|
call_control_url: "TS",
|
256
240
|
conference_id: "TS",
|
257
|
-
call_id: "TS",
|
258
241
|
leave_conference_url: "TS",
|
259
242
|
listen: true,
|
260
243
|
notification_url: "TS",
|
@@ -272,7 +255,6 @@ describe Freeclimb::AddToConference do
|
|
272
255
|
call_control_sequence: "TS",
|
273
256
|
call_control_url: "TS",
|
274
257
|
conference_id: "TS",
|
275
|
-
call_id: "TS",
|
276
258
|
leave_conference_url: "TS",
|
277
259
|
listen: true,
|
278
260
|
notification_url: "TS",
|
@@ -291,9 +273,6 @@ describe Freeclimb::AddToConference do
|
|
291
273
|
it 'deserializes the data of conference_id' do
|
292
274
|
expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String)
|
293
275
|
end
|
294
|
-
it 'deserializes the data of call_id' do
|
295
|
-
expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String)
|
296
|
-
end
|
297
276
|
it 'deserializes the data of leave_conference_url' do
|
298
277
|
expect(instance._deserialize("String", instance.leave_conference_url)).to be_a_kind_of(String)
|
299
278
|
end
|
@@ -318,7 +297,6 @@ describe Freeclimb::AddToConference do
|
|
318
297
|
call_control_sequence: "TS",
|
319
298
|
call_control_url: "TS",
|
320
299
|
conference_id: "TS",
|
321
|
-
call_id: "TS",
|
322
300
|
leave_conference_url: "TS",
|
323
301
|
listen: true,
|
324
302
|
notification_url: "TS",
|
@@ -336,7 +314,6 @@ describe Freeclimb::AddToConference do
|
|
336
314
|
call_control_sequence: "TS",
|
337
315
|
call_control_url: "TS",
|
338
316
|
conference_id: "TS",
|
339
|
-
call_id: "TS",
|
340
317
|
leave_conference_url: "TS",
|
341
318
|
listen: true,
|
342
319
|
notification_url: "TS",
|
@@ -352,7 +329,6 @@ describe Freeclimb::AddToConference do
|
|
352
329
|
call_control_sequence: "TS",
|
353
330
|
call_control_url: "TS",
|
354
331
|
conference_id: "TS",
|
355
|
-
call_id: "TS",
|
356
332
|
leave_conference_url: "TS",
|
357
333
|
listen: true,
|
358
334
|
notification_url: "TS",
|
@@ -364,7 +340,6 @@ describe Freeclimb::AddToConference do
|
|
364
340
|
call_control_sequence: "TS",
|
365
341
|
call_control_url: "TS",
|
366
342
|
conference_id: "TS",
|
367
|
-
call_id: "TS",
|
368
343
|
leave_conference_url: "TS",
|
369
344
|
listen: true,
|
370
345
|
notification_url: "TS",
|
@@ -385,8 +360,6 @@ describe Freeclimb::AddToConference do
|
|
385
360
|
|
386
361
|
conference_id: "TS",
|
387
362
|
|
388
|
-
call_id: "TS",
|
389
|
-
|
390
363
|
leave_conference_url: "TS",
|
391
364
|
|
392
365
|
listen: true,
|
@@ -409,9 +382,6 @@ describe Freeclimb::AddToConference do
|
|
409
382
|
it 'returns conference_id in the form of hash' do
|
410
383
|
expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id)
|
411
384
|
end
|
412
|
-
it 'returns call_id in the form of hash' do
|
413
|
-
expect(instance._to_hash(instance.call_id)).to eq(instance.call_id)
|
414
|
-
end
|
415
385
|
it 'returns leave_conference_url in the form of hash' do
|
416
386
|
expect(instance._to_hash(instance.leave_conference_url)).to eq(instance.leave_conference_url)
|
417
387
|
end
|
@@ -0,0 +1,225 @@
|
|
1
|
+
=begin
|
2
|
+
#FreeClimb API
|
3
|
+
|
4
|
+
#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: support@freeclimb.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for Freeclimb::CreateWebRTCToken
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe Freeclimb::CreateWebRTCToken do
|
21
|
+
let(:instance) { Freeclimb::CreateWebRTCToken.new }
|
22
|
+
|
23
|
+
describe 'test an instance of CreateWebRTCToken' do
|
24
|
+
it 'should create an instance of CreateWebRTCToken' do
|
25
|
+
expect(instance).to be_instance_of(Freeclimb::CreateWebRTCToken)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test attribute "to"' do
|
30
|
+
it 'should work' do
|
31
|
+
instance.to = "TEST_STRING"
|
32
|
+
expect(instance.to).to eq("TEST_STRING")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'test attribute "from"' do
|
37
|
+
it 'should work' do
|
38
|
+
instance.from = "TEST_STRING"
|
39
|
+
expect(instance.from).to eq("TEST_STRING")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'test attribute "uses"' do
|
44
|
+
it 'should work' do
|
45
|
+
instance.uses = 1
|
46
|
+
expect(instance.uses).to eq(1)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'test method "initialize"' do
|
51
|
+
it 'properly initializes with values' do
|
52
|
+
expect{instance = Freeclimb::CreateWebRTCToken.new(
|
53
|
+
to: "TS",
|
54
|
+
from: "TS",
|
55
|
+
uses: 1,
|
56
|
+
)}.not_to raise_error()
|
57
|
+
end
|
58
|
+
it 'fails to initialize with input argument that is not a hash in Freeclimb::CreateWebRTCToken' do
|
59
|
+
expect{instance = Freeclimb::CreateWebRTCToken.new(
|
60
|
+
to: "TS",
|
61
|
+
from: "TS",
|
62
|
+
uses: 1,
|
63
|
+
invalid_attribute: true
|
64
|
+
)}.to raise_error(ArgumentError)
|
65
|
+
end
|
66
|
+
it 'fails to initialize with invalid attribute' do
|
67
|
+
expect{instance = Freeclimb::CreateWebRTCToken.new(
|
68
|
+
to: "TS",
|
69
|
+
from: "TS",
|
70
|
+
uses: 1,
|
71
|
+
invalid_attribute: true
|
72
|
+
)}.to raise_error(ArgumentError)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe 'test method "valid"' do
|
77
|
+
it 'checks if properties are valid' do
|
78
|
+
instance = Freeclimb::CreateWebRTCToken.new(
|
79
|
+
to: "TS",
|
80
|
+
from: "TS",
|
81
|
+
uses: 1,
|
82
|
+
)
|
83
|
+
expect(instance.valid?).to eq(true)
|
84
|
+
end
|
85
|
+
it 'checks if properties are invalid' do
|
86
|
+
instance = Freeclimb::CreateWebRTCToken.new(
|
87
|
+
to: nil,
|
88
|
+
from: nil,
|
89
|
+
uses: nil,
|
90
|
+
uses: 2,
|
91
|
+
)
|
92
|
+
expect(instance.valid?).to eq(false)
|
93
|
+
end
|
94
|
+
it 'checks if model is empty' do
|
95
|
+
instance = Freeclimb::CreateWebRTCToken.new()
|
96
|
+
expect(instance.valid?).to eq(false)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe 'test method "eql?"' do
|
101
|
+
it 'checks if objects are equal' do
|
102
|
+
obj = Object.new()
|
103
|
+
instance_1 = Freeclimb::CreateWebRTCToken.new(
|
104
|
+
to: "TS",
|
105
|
+
from: "TS",
|
106
|
+
uses: 1,
|
107
|
+
)
|
108
|
+
instance_2 = Freeclimb::CreateWebRTCToken.new(
|
109
|
+
to: "TS",
|
110
|
+
from: "TS",
|
111
|
+
uses: 1,
|
112
|
+
)
|
113
|
+
expect(instance_1.eql?(instance_2)).to eq(true)
|
114
|
+
end
|
115
|
+
it 'checks if objects are not equal' do
|
116
|
+
instance_1 = Freeclimb::CreateWebRTCToken.new(
|
117
|
+
to: "TS",
|
118
|
+
from: "TS",
|
119
|
+
uses: 1,
|
120
|
+
)
|
121
|
+
instance_2 = Freeclimb::CreateWebRTCToken.new(
|
122
|
+
to: "ST",
|
123
|
+
from: "ST",
|
124
|
+
uses: 2,
|
125
|
+
)
|
126
|
+
expect(instance_1.eql?(instance_2)).to eq(false)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe 'test method "hash"' do
|
131
|
+
it 'calculates hash code' do
|
132
|
+
instance = Freeclimb::CreateWebRTCToken.new(
|
133
|
+
to: "TS",
|
134
|
+
from: "TS",
|
135
|
+
uses: 1,
|
136
|
+
)
|
137
|
+
expect(instance.hash).to be_a_kind_of(Integer)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe 'test method "build_from_hash"' do
|
142
|
+
it 'builds equivalent model from hash code' do
|
143
|
+
instance_1 = Freeclimb::CreateWebRTCToken.new(
|
144
|
+
to: "TS",
|
145
|
+
from: "TS",
|
146
|
+
uses: 1,
|
147
|
+
)
|
148
|
+
instance_2 = Freeclimb::CreateWebRTCToken.new
|
149
|
+
expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
describe 'test method "_deserialize"' do
|
154
|
+
instance = Freeclimb::CreateWebRTCToken.new(
|
155
|
+
to: "TS",
|
156
|
+
from: "TS",
|
157
|
+
uses: 1,
|
158
|
+
)
|
159
|
+
it 'deserializes the data of to' do
|
160
|
+
expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String)
|
161
|
+
end
|
162
|
+
it 'deserializes the data of from' do
|
163
|
+
expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String)
|
164
|
+
end
|
165
|
+
it 'deserializes the data of uses' do
|
166
|
+
expect(instance._deserialize("Integer", instance.uses)).to be_a_kind_of(Integer)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
describe 'test method "to_s"' do
|
171
|
+
it 'returns the string representation of the object' do
|
172
|
+
instance = Freeclimb::CreateWebRTCToken.new(
|
173
|
+
to: "TS",
|
174
|
+
from: "TS",
|
175
|
+
uses: 1,
|
176
|
+
)
|
177
|
+
expect(instance.to_s).to eq(instance.to_hash.to_s)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
describe 'test method "to_hash"' do
|
182
|
+
it 'returns the object in the form of hash' do
|
183
|
+
instance = Freeclimb::CreateWebRTCToken.new(
|
184
|
+
to: "TS",
|
185
|
+
from: "TS",
|
186
|
+
uses: 1,
|
187
|
+
)
|
188
|
+
expect(instance.to_hash).to be_a_kind_of(Hash)
|
189
|
+
end
|
190
|
+
it 'creates equal hash for two equal objects' do
|
191
|
+
obj = Object.new()
|
192
|
+
instance_1 = Freeclimb::CreateWebRTCToken.new(
|
193
|
+
to: "TS",
|
194
|
+
from: "TS",
|
195
|
+
uses: 1,
|
196
|
+
)
|
197
|
+
instance_2 = Freeclimb::CreateWebRTCToken.new(
|
198
|
+
to: "TS",
|
199
|
+
from: "TS",
|
200
|
+
uses: 1,
|
201
|
+
)
|
202
|
+
expect(instance_1.to_hash).to eq(instance_2.to_hash)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
describe 'test method "_to_hash"' do
|
207
|
+
instance = Freeclimb::CreateWebRTCToken.new(
|
208
|
+
to: "TS",
|
209
|
+
|
210
|
+
from: "TS",
|
211
|
+
|
212
|
+
uses: 1,
|
213
|
+
)
|
214
|
+
it 'returns to in the form of hash' do
|
215
|
+
expect(instance._to_hash(instance.to)).to eq(instance.to)
|
216
|
+
end
|
217
|
+
it 'returns from in the form of hash' do
|
218
|
+
expect(instance._to_hash(instance.from)).to eq(instance.from)
|
219
|
+
end
|
220
|
+
it 'returns uses in the form of hash' do
|
221
|
+
expect(instance._to_hash(instance.uses)).to eq(instance.uses)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|