freeclimb 4.3.0 → 4.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +20 -4
  5. data/docs/DefaultApi.md +433 -0
  6. data/docs/IncomingNumberRequest.md +3 -1
  7. data/docs/SMSTenDLCBrand.md +78 -0
  8. data/docs/SMSTenDLCBrandsListResult.md +32 -0
  9. data/docs/SMSTenDLCBrandsListResultAllOf.md +18 -0
  10. data/docs/SMSTenDLCCampaign.md +78 -0
  11. data/docs/SMSTenDLCCampaignsListResult.md +32 -0
  12. data/docs/SMSTenDLCCampaignsListResultAllOf.md +18 -0
  13. data/docs/SMSTenDLCPartnerCampaign.md +74 -0
  14. data/docs/SMSTenDLCPartnerCampaignBrand.md +38 -0
  15. data/docs/SMSTenDLCPartnerCampaignsListResult.md +32 -0
  16. data/docs/SMSTenDLCPartnerCampaignsListResultAllOf.md +18 -0
  17. data/lib/freeclimb/api/default_api.rb +360 -0
  18. data/lib/freeclimb/models/incoming_number_request.rb +15 -4
  19. data/lib/freeclimb/models/sms_ten_dlc_brand.rb +960 -0
  20. data/lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb +306 -0
  21. data/lib/freeclimb/models/sms_ten_dlc_brands_list_result_all_of.rb +221 -0
  22. data/lib/freeclimb/models/sms_ten_dlc_campaign.rb +814 -0
  23. data/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb +306 -0
  24. data/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of.rb +221 -0
  25. data/lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb +807 -0
  26. data/lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb +445 -0
  27. data/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb +306 -0
  28. data/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of.rb +221 -0
  29. data/lib/freeclimb/version.rb +1 -1
  30. data/lib/freeclimb.rb +10 -0
  31. data/openapi.json +1277 -12
  32. data/spec/api/default_api_spec.rb +151 -1
  33. data/spec/models/account_request_spec.rb +143 -2
  34. data/spec/models/account_result_spec.rb +377 -13
  35. data/spec/models/account_status_spec.rb +39 -6
  36. data/spec/models/account_type_spec.rb +26 -4
  37. data/spec/models/add_to_conference_spec.rb +343 -10
  38. data/spec/models/answered_by_spec.rb +26 -4
  39. data/spec/models/application_list_spec.rb +293 -8
  40. data/spec/models/application_request_spec.rb +268 -7
  41. data/spec/models/application_result_spec.rb +418 -13
  42. data/spec/models/available_number_list_spec.rb +293 -8
  43. data/spec/models/available_number_spec.rb +263 -7
  44. data/spec/models/buy_incoming_number_request_spec.rb +168 -3
  45. data/spec/models/call_direction_spec.rb +39 -6
  46. data/spec/models/call_list_spec.rb +293 -8
  47. data/spec/models/call_result_spec.rb +603 -22
  48. data/spec/models/call_status_spec.rb +104 -16
  49. data/spec/models/capabilities_spec.rb +218 -5
  50. data/spec/models/conference_list_spec.rb +293 -8
  51. data/spec/models/conference_participant_list_spec.rb +293 -8
  52. data/spec/models/conference_participant_result_spec.rb +343 -10
  53. data/spec/models/conference_result_spec.rb +464 -16
  54. data/spec/models/conference_status_spec.rb +52 -8
  55. data/spec/models/create_conference_request_spec.rb +228 -6
  56. data/spec/models/create_conference_spec.rb +253 -7
  57. data/spec/models/enqueue_spec.rb +193 -4
  58. data/spec/models/filter_logs_request_spec.rb +118 -1
  59. data/spec/models/get_digits_spec.rb +318 -9
  60. data/spec/models/get_speech_reason_spec.rb +78 -12
  61. data/spec/models/get_speech_spec.rb +388 -14
  62. data/spec/models/grammar_file_built_in_spec.rb +195 -30
  63. data/spec/models/grammar_type_spec.rb +26 -4
  64. data/spec/models/hangup_spec.rb +118 -1
  65. data/spec/models/if_machine_spec.rb +26 -4
  66. data/spec/models/incoming_number_list_spec.rb +293 -8
  67. data/spec/models/incoming_number_request_spec.rb +173 -2
  68. data/spec/models/incoming_number_result_spec.rb +488 -16
  69. data/spec/models/language_spec.rb +338 -52
  70. data/spec/models/log_level_spec.rb +39 -6
  71. data/spec/models/log_list_spec.rb +293 -8
  72. data/spec/models/log_result_spec.rb +275 -8
  73. data/spec/models/machine_type_spec.rb +26 -4
  74. data/spec/models/make_call_request_spec.rb +343 -10
  75. data/spec/models/message_direction_spec.rb +26 -4
  76. data/spec/models/message_request_spec.rb +318 -9
  77. data/spec/models/message_result_spec.rb +431 -13
  78. data/spec/models/message_status_spec.rb +143 -22
  79. data/spec/models/messages_list_spec.rb +293 -8
  80. data/spec/models/mutable_resource_model_spec.rb +193 -4
  81. data/spec/models/out_dial_spec.rb +345 -11
  82. data/spec/models/pagination_model_spec.rb +268 -7
  83. data/spec/models/park_spec.rb +168 -3
  84. data/spec/models/pause_spec.rb +118 -1
  85. data/spec/models/percl_command_spec.rb +132 -3
  86. data/spec/models/percl_script_spec.rb +118 -1
  87. data/spec/models/play_beep_spec.rb +52 -8
  88. data/spec/models/play_early_media_spec.rb +118 -1
  89. data/spec/models/play_spec.rb +193 -4
  90. data/spec/models/queue_list_spec.rb +293 -8
  91. data/spec/models/queue_member_list_spec.rb +293 -8
  92. data/spec/models/queue_member_spec.rb +218 -5
  93. data/spec/models/queue_request_spec.rb +143 -2
  94. data/spec/models/queue_result_spec.rb +369 -11
  95. data/spec/models/queue_result_status_spec.rb +52 -8
  96. data/spec/models/record_utterance_spec.rb +268 -7
  97. data/spec/models/record_utterance_term_reason_spec.rb +52 -8
  98. data/spec/models/recording_list_spec.rb +293 -8
  99. data/spec/models/recording_result_spec.rb +318 -9
  100. data/spec/models/redirect_spec.rb +118 -1
  101. data/spec/models/reject_spec.rb +118 -1
  102. data/spec/models/remove_from_conference_spec.rb +118 -1
  103. data/spec/models/request_type_spec.rb +299 -46
  104. data/spec/models/say_spec.rb +218 -5
  105. data/spec/models/send_digits_spec.rb +168 -3
  106. data/spec/models/set_listen_spec.rb +143 -2
  107. data/spec/models/set_talk_spec.rb +143 -2
  108. data/spec/models/sms_spec.rb +193 -4
  109. data/spec/models/sms_ten_dlc_brand_spec.rb +1240 -0
  110. data/spec/models/sms_ten_dlc_brands_list_result_spec.rb +361 -0
  111. data/spec/models/sms_ten_dlc_campaign_spec.rb +1055 -0
  112. data/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb +361 -0
  113. data/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb +448 -0
  114. data/spec/models/sms_ten_dlc_partner_campaign_spec.rb +994 -0
  115. data/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb +361 -0
  116. data/spec/models/terminate_conference_spec.rb +118 -1
  117. data/spec/models/update_call_request_spec.rb +120 -2
  118. data/spec/models/update_call_request_status_spec.rb +26 -4
  119. data/spec/models/update_conference_participant_request_spec.rb +143 -2
  120. data/spec/models/update_conference_request_spec.rb +180 -5
  121. data/spec/models/update_conference_request_status_spec.rb +26 -4
  122. metadata +102 -68
@@ -27,31 +27,244 @@ describe Freeclimb::Say do
27
27
  end
28
28
  describe 'test attribute "text"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.text = "TEST_STRING"
31
+ expect(instance.text).to eq("TEST_STRING")
31
32
  end
32
33
  end
33
34
 
34
35
  describe 'test attribute "language"' do
35
36
  it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ instance.language = "TEST_STRING"
38
+ expect(instance.language).to eq("TEST_STRING")
37
39
  end
38
40
  end
39
41
 
40
42
  describe 'test attribute "loop"' do
41
43
  it 'should work' do
42
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ instance.loop = 1
45
+ expect(instance.loop).to eq(1)
43
46
  end
44
47
  end
45
48
 
46
49
  describe 'test attribute "conference_id"' do
47
50
  it 'should work' do
48
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
+ instance.conference_id = "TEST_STRING"
52
+ expect(instance.conference_id).to eq("TEST_STRING")
49
53
  end
50
54
  end
51
55
 
52
56
  describe 'test attribute "privacy_mode"' do
53
57
  it 'should work' do
54
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
58
+ instance.privacy_mode = false
59
+ expect(instance.privacy_mode).to eq(false)
60
+ end
61
+ end
62
+
63
+ describe 'test method "initialize"' do
64
+ it 'properly initializes with values' do
65
+ expect{instance = Freeclimb::Say.new(
66
+ text: "TS",
67
+ language: "TS",
68
+ loop: 1,
69
+ conference_id: "TS",
70
+ privacy_mode: true,
71
+ )}.not_to raise_error()
72
+ end
73
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::Say' do
74
+ expect{instance = Freeclimb::Say.new(
75
+ text: "TS",
76
+ language: "TS",
77
+ loop: 1,
78
+ conference_id: "TS",
79
+ privacy_mode: true,
80
+ invalid_attribute: true
81
+ )}.to raise_error(ArgumentError)
82
+ end
83
+ it 'fails to initialize with invalid attribute' do
84
+ expect{instance = Freeclimb::Say.new(
85
+ text: "TS",
86
+ language: "TS",
87
+ loop: 1,
88
+ conference_id: "TS",
89
+ privacy_mode: true,
90
+ invalid_attribute: true
91
+ )}.to raise_error(ArgumentError)
92
+ end
93
+ end
94
+
95
+ describe 'test method "valid"' do
96
+ it 'checks if properties are valid' do
97
+ instance = Freeclimb::Say.new(
98
+ text: "TS",
99
+ language: "TS",
100
+ loop: 1,
101
+ conference_id: "TS",
102
+ privacy_mode: true,
103
+ )
104
+ expect(instance.valid?).to eq(true)
105
+ end
106
+ end
107
+
108
+ describe 'test method "eql?"' do
109
+ it 'checks if objects are equal' do
110
+ obj = Object.new()
111
+ instance_1 = Freeclimb::Say.new(
112
+ text: "TS",
113
+ language: "TS",
114
+ loop: 1,
115
+ conference_id: "TS",
116
+ privacy_mode: true,
117
+ )
118
+ instance_2 = Freeclimb::Say.new(
119
+ text: "TS",
120
+ language: "TS",
121
+ loop: 1,
122
+ conference_id: "TS",
123
+ privacy_mode: true,
124
+ )
125
+ expect(instance_1.eql?(instance_2)).to eq(true)
126
+ end
127
+ it 'checks if objects are not equal' do
128
+ instance_1 = Freeclimb::Say.new(
129
+ text: "TS",
130
+ language: "TS",
131
+ loop: 1,
132
+ conference_id: "TS",
133
+ privacy_mode: true,
134
+ )
135
+ instance_2 = Freeclimb::Say.new(
136
+ text: "ST",
137
+ language: "ST",
138
+ loop: 0,
139
+ conference_id: "ST",
140
+ privacy_mode: false,
141
+ )
142
+ expect(instance_1.eql?(instance_2)).to eq(false)
143
+ end
144
+ end
145
+
146
+ describe 'test method "hash"' do
147
+ it 'calculates hash code' do
148
+ instance = Freeclimb::Say.new(
149
+ text: "TS",
150
+ language: "TS",
151
+ loop: 1,
152
+ conference_id: "TS",
153
+ privacy_mode: true,
154
+ )
155
+ expect(instance.hash).to be_a_kind_of(Integer)
156
+ end
157
+ end
158
+
159
+ describe 'test method "build_from_hash"' do
160
+ it 'builds equivalent model from hash code' do
161
+ instance_1 = Freeclimb::Say.new(
162
+ text: "TS",
163
+ language: "TS",
164
+ loop: 1,
165
+ conference_id: "TS",
166
+ privacy_mode: true,
167
+ )
168
+ instance_2 = Freeclimb::Say.new
169
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
170
+ end
171
+ end
172
+
173
+ describe 'test method "_deserialize"' do
174
+ instance = Freeclimb::Say.new(
175
+ text: "TS",
176
+ language: "TS",
177
+ loop: 1,
178
+ conference_id: "TS",
179
+ privacy_mode: true,
180
+ )
181
+ it 'deserializes the data of text' do
182
+ expect(instance._deserialize("String", instance.text)).to be_a_kind_of(String)
183
+ end
184
+ it 'deserializes the data of language' do
185
+ expect(instance._deserialize("String", instance.language)).to be_a_kind_of(String)
186
+ end
187
+ it 'deserializes the data of loop' do
188
+ expect(instance._deserialize("Integer", instance.loop)).to be_a_kind_of(Integer)
189
+ end
190
+ it 'deserializes the data of conference_id' do
191
+ expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String)
192
+ end
193
+ it 'deserializes the data of privacy_mode' do
194
+ expect(instance._deserialize("Boolean", instance.privacy_mode)).to be_a_kind_of(TrueClass)
195
+ end
196
+ end
197
+
198
+ describe 'test method "to_s"' do
199
+ it 'returns the string representation of the object' do
200
+ instance = Freeclimb::Say.new(
201
+ text: "TS",
202
+ language: "TS",
203
+ loop: 1,
204
+ conference_id: "TS",
205
+ privacy_mode: true,
206
+ )
207
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
208
+ end
209
+ end
210
+
211
+ describe 'test method "to_hash"' do
212
+ it 'returns the object in the form of hash' do
213
+ instance = Freeclimb::Say.new(
214
+ text: "TS",
215
+ language: "TS",
216
+ loop: 1,
217
+ conference_id: "TS",
218
+ privacy_mode: true,
219
+ )
220
+ expect(instance.to_hash).to be_a_kind_of(Hash)
221
+ end
222
+ it 'creates equal hash for two equal objects' do
223
+ obj = Object.new()
224
+ instance_1 = Freeclimb::Say.new(
225
+ text: "TS",
226
+ language: "TS",
227
+ loop: 1,
228
+ conference_id: "TS",
229
+ privacy_mode: true,
230
+ )
231
+ instance_2 = Freeclimb::Say.new(
232
+ text: "TS",
233
+ language: "TS",
234
+ loop: 1,
235
+ conference_id: "TS",
236
+ privacy_mode: true,
237
+ )
238
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
239
+ end
240
+ end
241
+
242
+ describe 'test method "_to_hash"' do
243
+ instance = Freeclimb::Say.new(
244
+ text: "TS",
245
+
246
+ language: "TS",
247
+
248
+ loop: 1,
249
+
250
+ conference_id: "TS",
251
+
252
+ privacy_mode: true,
253
+ )
254
+ it 'returns text in the form of hash' do
255
+ expect(instance._to_hash(instance.text)).to eq(instance.text)
256
+ end
257
+ it 'returns language in the form of hash' do
258
+ expect(instance._to_hash(instance.language)).to eq(instance.language)
259
+ end
260
+ it 'returns loop in the form of hash' do
261
+ expect(instance._to_hash(instance.loop)).to eq(instance.loop)
262
+ end
263
+ it 'returns conference_id in the form of hash' do
264
+ expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id)
265
+ end
266
+ it 'returns privacy_mode in the form of hash' do
267
+ expect(instance._to_hash(instance.privacy_mode)).to eq(instance.privacy_mode)
55
268
  end
56
269
  end
57
270
 
@@ -27,19 +27,184 @@ describe Freeclimb::SendDigits do
27
27
  end
28
28
  describe 'test attribute "digits"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.digits = "TEST_STRING"
31
+ expect(instance.digits).to eq("TEST_STRING")
31
32
  end
32
33
  end
33
34
 
34
35
  describe 'test attribute "pause_ms"' do
35
36
  it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ instance.pause_ms = 1
38
+ expect(instance.pause_ms).to eq(1)
37
39
  end
38
40
  end
39
41
 
40
42
  describe 'test attribute "privacy_mode"' do
41
43
  it 'should work' do
42
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ instance.privacy_mode = false
45
+ expect(instance.privacy_mode).to eq(false)
46
+ end
47
+ end
48
+
49
+ describe 'test method "initialize"' do
50
+ it 'properly initializes with values' do
51
+ expect{instance = Freeclimb::SendDigits.new(
52
+ digits: "TS",
53
+ pause_ms: 1,
54
+ privacy_mode: true,
55
+ )}.not_to raise_error()
56
+ end
57
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::SendDigits' do
58
+ expect{instance = Freeclimb::SendDigits.new(
59
+ digits: "TS",
60
+ pause_ms: 1,
61
+ privacy_mode: true,
62
+ invalid_attribute: true
63
+ )}.to raise_error(ArgumentError)
64
+ end
65
+ it 'fails to initialize with invalid attribute' do
66
+ expect{instance = Freeclimb::SendDigits.new(
67
+ digits: "TS",
68
+ pause_ms: 1,
69
+ privacy_mode: true,
70
+ invalid_attribute: true
71
+ )}.to raise_error(ArgumentError)
72
+ end
73
+ end
74
+
75
+ describe 'test method "valid"' do
76
+ it 'checks if properties are valid' do
77
+ instance = Freeclimb::SendDigits.new(
78
+ digits: "TS",
79
+ pause_ms: 1,
80
+ privacy_mode: true,
81
+ )
82
+ expect(instance.valid?).to eq(true)
83
+ end
84
+ end
85
+
86
+ describe 'test method "eql?"' do
87
+ it 'checks if objects are equal' do
88
+ obj = Object.new()
89
+ instance_1 = Freeclimb::SendDigits.new(
90
+ digits: "TS",
91
+ pause_ms: 1,
92
+ privacy_mode: true,
93
+ )
94
+ instance_2 = Freeclimb::SendDigits.new(
95
+ digits: "TS",
96
+ pause_ms: 1,
97
+ privacy_mode: true,
98
+ )
99
+ expect(instance_1.eql?(instance_2)).to eq(true)
100
+ end
101
+ it 'checks if objects are not equal' do
102
+ instance_1 = Freeclimb::SendDigits.new(
103
+ digits: "TS",
104
+ pause_ms: 1,
105
+ privacy_mode: true,
106
+ )
107
+ instance_2 = Freeclimb::SendDigits.new(
108
+ digits: "ST",
109
+ pause_ms: 0,
110
+ privacy_mode: false,
111
+ )
112
+ expect(instance_1.eql?(instance_2)).to eq(false)
113
+ end
114
+ end
115
+
116
+ describe 'test method "hash"' do
117
+ it 'calculates hash code' do
118
+ instance = Freeclimb::SendDigits.new(
119
+ digits: "TS",
120
+ pause_ms: 1,
121
+ privacy_mode: true,
122
+ )
123
+ expect(instance.hash).to be_a_kind_of(Integer)
124
+ end
125
+ end
126
+
127
+ describe 'test method "build_from_hash"' do
128
+ it 'builds equivalent model from hash code' do
129
+ instance_1 = Freeclimb::SendDigits.new(
130
+ digits: "TS",
131
+ pause_ms: 1,
132
+ privacy_mode: true,
133
+ )
134
+ instance_2 = Freeclimb::SendDigits.new
135
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
136
+ end
137
+ end
138
+
139
+ describe 'test method "_deserialize"' do
140
+ instance = Freeclimb::SendDigits.new(
141
+ digits: "TS",
142
+ pause_ms: 1,
143
+ privacy_mode: true,
144
+ )
145
+ it 'deserializes the data of digits' do
146
+ expect(instance._deserialize("String", instance.digits)).to be_a_kind_of(String)
147
+ end
148
+ it 'deserializes the data of pause_ms' do
149
+ expect(instance._deserialize("Integer", instance.pause_ms)).to be_a_kind_of(Integer)
150
+ end
151
+ it 'deserializes the data of privacy_mode' do
152
+ expect(instance._deserialize("Boolean", instance.privacy_mode)).to be_a_kind_of(TrueClass)
153
+ end
154
+ end
155
+
156
+ describe 'test method "to_s"' do
157
+ it 'returns the string representation of the object' do
158
+ instance = Freeclimb::SendDigits.new(
159
+ digits: "TS",
160
+ pause_ms: 1,
161
+ privacy_mode: true,
162
+ )
163
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
164
+ end
165
+ end
166
+
167
+ describe 'test method "to_hash"' do
168
+ it 'returns the object in the form of hash' do
169
+ instance = Freeclimb::SendDigits.new(
170
+ digits: "TS",
171
+ pause_ms: 1,
172
+ privacy_mode: true,
173
+ )
174
+ expect(instance.to_hash).to be_a_kind_of(Hash)
175
+ end
176
+ it 'creates equal hash for two equal objects' do
177
+ obj = Object.new()
178
+ instance_1 = Freeclimb::SendDigits.new(
179
+ digits: "TS",
180
+ pause_ms: 1,
181
+ privacy_mode: true,
182
+ )
183
+ instance_2 = Freeclimb::SendDigits.new(
184
+ digits: "TS",
185
+ pause_ms: 1,
186
+ privacy_mode: true,
187
+ )
188
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
189
+ end
190
+ end
191
+
192
+ describe 'test method "_to_hash"' do
193
+ instance = Freeclimb::SendDigits.new(
194
+ digits: "TS",
195
+
196
+ pause_ms: 1,
197
+
198
+ privacy_mode: true,
199
+ )
200
+ it 'returns digits in the form of hash' do
201
+ expect(instance._to_hash(instance.digits)).to eq(instance.digits)
202
+ end
203
+ it 'returns pause_ms in the form of hash' do
204
+ expect(instance._to_hash(instance.pause_ms)).to eq(instance.pause_ms)
205
+ end
206
+ it 'returns privacy_mode in the form of hash' do
207
+ expect(instance._to_hash(instance.privacy_mode)).to eq(instance.privacy_mode)
43
208
  end
44
209
  end
45
210
 
@@ -27,13 +27,154 @@ describe Freeclimb::SetListen do
27
27
  end
28
28
  describe 'test attribute "call_id"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.call_id = "TEST_STRING"
31
+ expect(instance.call_id).to eq("TEST_STRING")
31
32
  end
32
33
  end
33
34
 
34
35
  describe 'test attribute "listen"' do
35
36
  it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ instance.listen = false
38
+ expect(instance.listen).to eq(false)
39
+ end
40
+ end
41
+
42
+ describe 'test method "initialize"' do
43
+ it 'properly initializes with values' do
44
+ expect{instance = Freeclimb::SetListen.new(
45
+ call_id: "TS",
46
+ listen: true,
47
+ )}.not_to raise_error()
48
+ end
49
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::SetListen' do
50
+ expect{instance = Freeclimb::SetListen.new(
51
+ call_id: "TS",
52
+ listen: true,
53
+ invalid_attribute: true
54
+ )}.to raise_error(ArgumentError)
55
+ end
56
+ it 'fails to initialize with invalid attribute' do
57
+ expect{instance = Freeclimb::SetListen.new(
58
+ call_id: "TS",
59
+ listen: true,
60
+ invalid_attribute: true
61
+ )}.to raise_error(ArgumentError)
62
+ end
63
+ end
64
+
65
+ describe 'test method "valid"' do
66
+ it 'checks if properties are valid' do
67
+ instance = Freeclimb::SetListen.new(
68
+ call_id: "TS",
69
+ listen: true,
70
+ )
71
+ expect(instance.valid?).to eq(true)
72
+ end
73
+ end
74
+
75
+ describe 'test method "eql?"' do
76
+ it 'checks if objects are equal' do
77
+ obj = Object.new()
78
+ instance_1 = Freeclimb::SetListen.new(
79
+ call_id: "TS",
80
+ listen: true,
81
+ )
82
+ instance_2 = Freeclimb::SetListen.new(
83
+ call_id: "TS",
84
+ listen: true,
85
+ )
86
+ expect(instance_1.eql?(instance_2)).to eq(true)
87
+ end
88
+ it 'checks if objects are not equal' do
89
+ instance_1 = Freeclimb::SetListen.new(
90
+ call_id: "TS",
91
+ listen: true,
92
+ )
93
+ instance_2 = Freeclimb::SetListen.new(
94
+ call_id: "ST",
95
+ listen: false,
96
+ )
97
+ expect(instance_1.eql?(instance_2)).to eq(false)
98
+ end
99
+ end
100
+
101
+ describe 'test method "hash"' do
102
+ it 'calculates hash code' do
103
+ instance = Freeclimb::SetListen.new(
104
+ call_id: "TS",
105
+ listen: true,
106
+ )
107
+ expect(instance.hash).to be_a_kind_of(Integer)
108
+ end
109
+ end
110
+
111
+ describe 'test method "build_from_hash"' do
112
+ it 'builds equivalent model from hash code' do
113
+ instance_1 = Freeclimb::SetListen.new(
114
+ call_id: "TS",
115
+ listen: true,
116
+ )
117
+ instance_2 = Freeclimb::SetListen.new
118
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
119
+ end
120
+ end
121
+
122
+ describe 'test method "_deserialize"' do
123
+ instance = Freeclimb::SetListen.new(
124
+ call_id: "TS",
125
+ listen: true,
126
+ )
127
+ it 'deserializes the data of call_id' do
128
+ expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String)
129
+ end
130
+ it 'deserializes the data of listen' do
131
+ expect(instance._deserialize("Boolean", instance.listen)).to be_a_kind_of(TrueClass)
132
+ end
133
+ end
134
+
135
+ describe 'test method "to_s"' do
136
+ it 'returns the string representation of the object' do
137
+ instance = Freeclimb::SetListen.new(
138
+ call_id: "TS",
139
+ listen: true,
140
+ )
141
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
142
+ end
143
+ end
144
+
145
+ describe 'test method "to_hash"' do
146
+ it 'returns the object in the form of hash' do
147
+ instance = Freeclimb::SetListen.new(
148
+ call_id: "TS",
149
+ listen: true,
150
+ )
151
+ expect(instance.to_hash).to be_a_kind_of(Hash)
152
+ end
153
+ it 'creates equal hash for two equal objects' do
154
+ obj = Object.new()
155
+ instance_1 = Freeclimb::SetListen.new(
156
+ call_id: "TS",
157
+ listen: true,
158
+ )
159
+ instance_2 = Freeclimb::SetListen.new(
160
+ call_id: "TS",
161
+ listen: true,
162
+ )
163
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
164
+ end
165
+ end
166
+
167
+ describe 'test method "_to_hash"' do
168
+ instance = Freeclimb::SetListen.new(
169
+ call_id: "TS",
170
+
171
+ listen: true,
172
+ )
173
+ it 'returns call_id in the form of hash' do
174
+ expect(instance._to_hash(instance.call_id)).to eq(instance.call_id)
175
+ end
176
+ it 'returns listen in the form of hash' do
177
+ expect(instance._to_hash(instance.listen)).to eq(instance.listen)
37
178
  end
38
179
  end
39
180