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,49 +27,334 @@ describe Freeclimb::LogList do
27
27
  end
28
28
  describe 'test attribute "total"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.total = 1
31
+ expect(instance.total).to eq(1)
31
32
  end
32
33
  end
33
34
 
34
35
  describe 'test attribute "start"' do
35
36
  it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ instance.start = 1
38
+ expect(instance.start).to eq(1)
37
39
  end
38
40
  end
39
41
 
40
42
  describe 'test attribute "_end"' do
41
43
  it 'should work' do
42
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ instance._end = 1
45
+ expect(instance._end).to eq(1)
43
46
  end
44
47
  end
45
48
 
46
49
  describe 'test attribute "page"' do
47
50
  it 'should work' do
48
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
+ instance.page = 1
52
+ expect(instance.page).to eq(1)
49
53
  end
50
54
  end
51
55
 
52
56
  describe 'test attribute "num_pages"' do
53
57
  it 'should work' do
54
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
58
+ instance.num_pages = 1
59
+ expect(instance.num_pages).to eq(1)
55
60
  end
56
61
  end
57
62
 
58
63
  describe 'test attribute "page_size"' do
59
64
  it 'should work' do
60
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
65
+ instance.page_size = 1
66
+ expect(instance.page_size).to eq(1)
61
67
  end
62
68
  end
63
69
 
64
70
  describe 'test attribute "next_page_uri"' do
65
71
  it 'should work' do
66
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
+ instance.next_page_uri = "TEST_STRING"
73
+ expect(instance.next_page_uri).to eq("TEST_STRING")
67
74
  end
68
75
  end
69
76
 
70
77
  describe 'test attribute "logs"' do
71
78
  it 'should work' do
72
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ instance.logs = ["ELEMENT_1", "ELEMENT_2"]
80
+ expect(instance.logs).to eq(["ELEMENT_1", "ELEMENT_2"])
81
+ end
82
+ end
83
+
84
+ describe 'test method "initialize"' do
85
+ it 'properly initializes with values' do
86
+ expect{instance = Freeclimb::LogList.new(
87
+ total: 1,
88
+ start: 1,
89
+ _end: 1,
90
+ page: 1,
91
+ num_pages: 1,
92
+ page_size: 1,
93
+ next_page_uri: "TS",
94
+ logs: Array.new(),
95
+ )}.not_to raise_error()
96
+ end
97
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::LogList' do
98
+ expect{instance = Freeclimb::LogList.new(
99
+ total: 1,
100
+ start: 1,
101
+ _end: 1,
102
+ page: 1,
103
+ num_pages: 1,
104
+ page_size: 1,
105
+ next_page_uri: "TS",
106
+ logs: Array.new(),
107
+ invalid_attribute: true
108
+ )}.to raise_error(ArgumentError)
109
+ end
110
+ it 'fails to initialize with invalid attribute' do
111
+ expect{instance = Freeclimb::LogList.new(
112
+ total: 1,
113
+ start: 1,
114
+ _end: 1,
115
+ page: 1,
116
+ num_pages: 1,
117
+ page_size: 1,
118
+ next_page_uri: "TS",
119
+ logs: Array.new(),
120
+ invalid_attribute: true
121
+ )}.to raise_error(ArgumentError)
122
+ end
123
+ end
124
+
125
+ describe 'test method "valid"' do
126
+ it 'checks if properties are valid' do
127
+ instance = Freeclimb::LogList.new(
128
+ total: 1,
129
+ start: 1,
130
+ _end: 1,
131
+ page: 1,
132
+ num_pages: 1,
133
+ page_size: 1,
134
+ next_page_uri: "TS",
135
+ logs: Array.new(),
136
+ )
137
+ expect(instance.valid?).to eq(true)
138
+ end
139
+ end
140
+
141
+ describe 'test method "eql?"' do
142
+ it 'checks if objects are equal' do
143
+ obj = Object.new()
144
+ instance_1 = Freeclimb::LogList.new(
145
+ total: 1,
146
+ start: 1,
147
+ _end: 1,
148
+ page: 1,
149
+ num_pages: 1,
150
+ page_size: 1,
151
+ next_page_uri: "TS",
152
+ logs: [],
153
+ )
154
+ instance_2 = Freeclimb::LogList.new(
155
+ total: 1,
156
+ start: 1,
157
+ _end: 1,
158
+ page: 1,
159
+ num_pages: 1,
160
+ page_size: 1,
161
+ next_page_uri: "TS",
162
+ logs: [],
163
+ )
164
+ expect(instance_1.eql?(instance_2)).to eq(true)
165
+ end
166
+ it 'checks if objects are not equal' do
167
+ instance_1 = Freeclimb::LogList.new(
168
+ total: 1,
169
+ start: 1,
170
+ _end: 1,
171
+ page: 1,
172
+ num_pages: 1,
173
+ page_size: 1,
174
+ next_page_uri: "TS",
175
+ logs: [],
176
+ )
177
+ instance_2 = Freeclimb::LogList.new(
178
+ total: 0,
179
+ start: 0,
180
+ _end: 0,
181
+ page: 0,
182
+ num_pages: 0,
183
+ page_size: 0,
184
+ next_page_uri: "ST",
185
+ logs: nil,
186
+ )
187
+ expect(instance_1.eql?(instance_2)).to eq(false)
188
+ end
189
+ end
190
+
191
+ describe 'test method "hash"' do
192
+ it 'calculates hash code' do
193
+ instance = Freeclimb::LogList.new(
194
+ total: 1,
195
+ start: 1,
196
+ _end: 1,
197
+ page: 1,
198
+ num_pages: 1,
199
+ page_size: 1,
200
+ next_page_uri: "TS",
201
+ logs: Array.new(),
202
+ )
203
+ expect(instance.hash).to be_a_kind_of(Integer)
204
+ end
205
+ end
206
+
207
+ describe 'test method "build_from_hash"' do
208
+ it 'builds equivalent model from hash code' do
209
+ instance_1 = Freeclimb::LogList.new(
210
+ total: 1,
211
+ start: 1,
212
+ _end: 1,
213
+ page: 1,
214
+ num_pages: 1,
215
+ page_size: 1,
216
+ next_page_uri: "TS",
217
+ logs: Array.new(),
218
+ )
219
+ instance_2 = Freeclimb::LogList.new
220
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
221
+ end
222
+ end
223
+
224
+ describe 'test method "_deserialize"' do
225
+ instance = Freeclimb::LogList.new(
226
+ total: 1,
227
+ start: 1,
228
+ _end: 1,
229
+ page: 1,
230
+ num_pages: 1,
231
+ page_size: 1,
232
+ next_page_uri: "TS",
233
+ logs: Array.new(),
234
+ )
235
+ it 'deserializes the data of total' do
236
+ expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer)
237
+ end
238
+ it 'deserializes the data of start' do
239
+ expect(instance._deserialize("Integer", instance.start)).to be_a_kind_of(Integer)
240
+ end
241
+ it 'deserializes the data of _end' do
242
+ expect(instance._deserialize("Integer", instance._end)).to be_a_kind_of(Integer)
243
+ end
244
+ it 'deserializes the data of page' do
245
+ expect(instance._deserialize("Integer", instance.page)).to be_a_kind_of(Integer)
246
+ end
247
+ it 'deserializes the data of num_pages' do
248
+ expect(instance._deserialize("Integer", instance.num_pages)).to be_a_kind_of(Integer)
249
+ end
250
+ it 'deserializes the data of page_size' do
251
+ expect(instance._deserialize("Integer", instance.page_size)).to be_a_kind_of(Integer)
252
+ end
253
+ it 'deserializes the data of next_page_uri' do
254
+ expect(instance._deserialize("String", instance.next_page_uri)).to be_a_kind_of(String)
255
+ end
256
+ it 'deserializes the data of logs' do
257
+ expect(instance._deserialize("Array<LogResult>", instance.logs)).to be_a_kind_of(Array)
258
+ end
259
+ end
260
+
261
+ describe 'test method "to_s"' do
262
+ it 'returns the string representation of the object' do
263
+ instance = Freeclimb::LogList.new(
264
+ total: 1,
265
+ start: 1,
266
+ _end: 1,
267
+ page: 1,
268
+ num_pages: 1,
269
+ page_size: 1,
270
+ next_page_uri: "TS",
271
+ logs: Array.new(),
272
+ )
273
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
274
+ end
275
+ end
276
+
277
+ describe 'test method "to_hash"' do
278
+ it 'returns the object in the form of hash' do
279
+ instance = Freeclimb::LogList.new(
280
+ total: 1,
281
+ start: 1,
282
+ _end: 1,
283
+ page: 1,
284
+ num_pages: 1,
285
+ page_size: 1,
286
+ next_page_uri: "TS",
287
+ logs: Array.new(),
288
+ )
289
+ expect(instance.to_hash).to be_a_kind_of(Hash)
290
+ end
291
+ it 'creates equal hash for two equal objects' do
292
+ obj = Object.new()
293
+ instance_1 = Freeclimb::LogList.new(
294
+ total: 1,
295
+ start: 1,
296
+ _end: 1,
297
+ page: 1,
298
+ num_pages: 1,
299
+ page_size: 1,
300
+ next_page_uri: "TS",
301
+ logs: Array.new(),
302
+ )
303
+ instance_2 = Freeclimb::LogList.new(
304
+ total: 1,
305
+ start: 1,
306
+ _end: 1,
307
+ page: 1,
308
+ num_pages: 1,
309
+ page_size: 1,
310
+ next_page_uri: "TS",
311
+ logs: Array.new(),
312
+ )
313
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
314
+ end
315
+ end
316
+
317
+ describe 'test method "_to_hash"' do
318
+ instance = Freeclimb::LogList.new(
319
+ total: 1,
320
+
321
+ start: 1,
322
+
323
+ _end: 1,
324
+
325
+ page: 1,
326
+
327
+ num_pages: 1,
328
+
329
+ page_size: 1,
330
+
331
+ next_page_uri: "TS",
332
+
333
+ logs: Array.new(),
334
+ )
335
+ it 'returns total in the form of hash' do
336
+ expect(instance._to_hash(instance.total)).to eq(instance.total)
337
+ end
338
+ it 'returns start in the form of hash' do
339
+ expect(instance._to_hash(instance.start)).to eq(instance.start)
340
+ end
341
+ it 'returns _end in the form of hash' do
342
+ expect(instance._to_hash(instance._end)).to eq(instance._end)
343
+ end
344
+ it 'returns page in the form of hash' do
345
+ expect(instance._to_hash(instance.page)).to eq(instance.page)
346
+ end
347
+ it 'returns num_pages in the form of hash' do
348
+ expect(instance._to_hash(instance.num_pages)).to eq(instance.num_pages)
349
+ end
350
+ it 'returns page_size in the form of hash' do
351
+ expect(instance._to_hash(instance.page_size)).to eq(instance.page_size)
352
+ end
353
+ it 'returns next_page_uri in the form of hash' do
354
+ expect(instance._to_hash(instance.next_page_uri)).to eq(instance.next_page_uri)
355
+ end
356
+ it 'returns logs in the form of hash' do
357
+ expect(instance._to_hash(instance.logs)).to eq(instance.logs)
73
358
  end
74
359
  end
75
360
 
@@ -27,43 +27,310 @@ describe Freeclimb::LogResult do
27
27
  end
28
28
  describe 'test attribute "timestamp"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.timestamp = 1
31
+ expect(instance.timestamp).to eq(1)
31
32
  end
32
33
  end
33
34
 
34
35
  describe 'test attribute "level"' do
35
- it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
36
+ it 'assigns value INFO' do
37
+ instance.level = Freeclimb::LogLevel::INFO
38
+ expect(instance.level).to eq(Freeclimb::LogLevel::INFO)
39
+ end
40
+ it 'assigns value WARNING' do
41
+ instance.level = Freeclimb::LogLevel::WARNING
42
+ expect(instance.level).to eq(Freeclimb::LogLevel::WARNING)
43
+ end
44
+ it 'assigns value ERROR' do
45
+ instance.level = Freeclimb::LogLevel::ERROR
46
+ expect(instance.level).to eq(Freeclimb::LogLevel::ERROR)
37
47
  end
38
48
  end
39
49
 
40
50
  describe 'test attribute "request_id"' do
41
51
  it 'should work' do
42
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
52
+ instance.request_id = "TEST_STRING"
53
+ expect(instance.request_id).to eq("TEST_STRING")
43
54
  end
44
55
  end
45
56
 
46
57
  describe 'test attribute "account_id"' do
47
58
  it 'should work' do
48
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ instance.account_id = "TEST_STRING"
60
+ expect(instance.account_id).to eq("TEST_STRING")
49
61
  end
50
62
  end
51
63
 
52
64
  describe 'test attribute "call_id"' do
53
65
  it 'should work' do
54
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
66
+ instance.call_id = "TEST_STRING"
67
+ expect(instance.call_id).to eq("TEST_STRING")
55
68
  end
56
69
  end
57
70
 
58
71
  describe 'test attribute "message"' do
59
72
  it 'should work' do
60
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
73
+ instance.message = "TEST_STRING"
74
+ expect(instance.message).to eq("TEST_STRING")
61
75
  end
62
76
  end
63
77
 
64
78
  describe 'test attribute "metadata"' do
65
79
  it 'should work' do
66
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ testObject = Object.new()
81
+ instance.metadata = testObject
82
+ expect(instance.metadata).to eq(testObject)
83
+ end
84
+ end
85
+
86
+ describe 'test method "initialize"' do
87
+ it 'properly initializes with values' do
88
+ expect{instance = Freeclimb::LogResult.new(
89
+ timestamp: 1,
90
+ level: "INFO",
91
+ request_id: "TS",
92
+ account_id: "TS",
93
+ call_id: "TS",
94
+ message: "TS",
95
+ metadata: Object.new(),
96
+ )}.not_to raise_error()
97
+ end
98
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::LogResult' do
99
+ expect{instance = Freeclimb::LogResult.new(
100
+ timestamp: 1,
101
+ level: "INFO",
102
+ request_id: "TS",
103
+ account_id: "TS",
104
+ call_id: "TS",
105
+ message: "TS",
106
+ metadata: Object.new(),
107
+ invalid_attribute: true
108
+ )}.to raise_error(ArgumentError)
109
+ end
110
+ it 'fails to initialize with invalid attribute' do
111
+ expect{instance = Freeclimb::LogResult.new(
112
+ timestamp: 1,
113
+ level: "INFO",
114
+ request_id: "TS",
115
+ account_id: "TS",
116
+ call_id: "TS",
117
+ message: "TS",
118
+ metadata: Object.new(),
119
+ invalid_attribute: true
120
+ )}.to raise_error(ArgumentError)
121
+ end
122
+ end
123
+
124
+ describe 'test method "valid"' do
125
+ it 'checks if properties are valid' do
126
+ instance = Freeclimb::LogResult.new(
127
+ timestamp: 1,
128
+ level: "INFO",
129
+ request_id: "TS",
130
+ account_id: "TS",
131
+ call_id: "TS",
132
+ message: "TS",
133
+ metadata: Object.new(),
134
+ )
135
+ expect(instance.valid?).to eq(true)
136
+ end
137
+ end
138
+
139
+ describe 'test method "eql?"' do
140
+ it 'checks if objects are equal' do
141
+ obj = Object.new()
142
+ instance_1 = Freeclimb::LogResult.new(
143
+ timestamp: 1,
144
+ level: "INFO",
145
+ request_id: "TS",
146
+ account_id: "TS",
147
+ call_id: "TS",
148
+ message: "TS",
149
+ metadata: obj,
150
+ )
151
+ instance_2 = Freeclimb::LogResult.new(
152
+ timestamp: 1,
153
+ level: "INFO",
154
+ request_id: "TS",
155
+ account_id: "TS",
156
+ call_id: "TS",
157
+ message: "TS",
158
+ metadata: obj,
159
+ )
160
+ expect(instance_1.eql?(instance_2)).to eq(true)
161
+ end
162
+ it 'checks if objects are not equal' do
163
+ instance_1 = Freeclimb::LogResult.new(
164
+ timestamp: 1,
165
+ level: "INFO",
166
+ request_id: "TS",
167
+ account_id: "TS",
168
+ call_id: "TS",
169
+ message: "TS",
170
+ metadata: Object.new(),
171
+ )
172
+ instance_2 = Freeclimb::LogResult.new(
173
+ timestamp: 0,
174
+ level: "WARNING",
175
+ request_id: "ST",
176
+ account_id: "ST",
177
+ call_id: "ST",
178
+ message: "ST",
179
+ metadata: nil,
180
+ )
181
+ expect(instance_1.eql?(instance_2)).to eq(false)
182
+ end
183
+ end
184
+
185
+ describe 'test method "hash"' do
186
+ it 'calculates hash code' do
187
+ instance = Freeclimb::LogResult.new(
188
+ timestamp: 1,
189
+ level: "INFO",
190
+ request_id: "TS",
191
+ account_id: "TS",
192
+ call_id: "TS",
193
+ message: "TS",
194
+ metadata: Object.new(),
195
+ )
196
+ expect(instance.hash).to be_a_kind_of(Integer)
197
+ end
198
+ end
199
+
200
+ describe 'test method "build_from_hash"' do
201
+ it 'builds equivalent model from hash code' do
202
+ instance_1 = Freeclimb::LogResult.new(
203
+ timestamp: 1,
204
+ level: "INFO",
205
+ request_id: "TS",
206
+ account_id: "TS",
207
+ call_id: "TS",
208
+ message: "TS",
209
+ metadata: Object.new(),
210
+ )
211
+ instance_2 = Freeclimb::LogResult.new
212
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
213
+ end
214
+ end
215
+
216
+ describe 'test method "_deserialize"' do
217
+ instance = Freeclimb::LogResult.new(
218
+ timestamp: 1,
219
+ level: "INFO",
220
+ request_id: "TS",
221
+ account_id: "TS",
222
+ call_id: "TS",
223
+ message: "TS",
224
+ metadata: Object.new(),
225
+ )
226
+ it 'deserializes the data of timestamp' do
227
+ expect(instance._deserialize("Integer", instance.timestamp)).to be_a_kind_of(Integer)
228
+ end
229
+ it 'deserializes the data of request_id' do
230
+ expect(instance._deserialize("String", instance.request_id)).to be_a_kind_of(String)
231
+ end
232
+ it 'deserializes the data of account_id' do
233
+ expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String)
234
+ end
235
+ it 'deserializes the data of call_id' do
236
+ expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String)
237
+ end
238
+ it 'deserializes the data of message' do
239
+ expect(instance._deserialize("String", instance.message)).to be_a_kind_of(String)
240
+ end
241
+ it 'deserializes the data of metadata' do
242
+ expect(instance._deserialize("Object", instance.metadata)).to be_a_kind_of(Object)
243
+ end
244
+ end
245
+
246
+ describe 'test method "to_s"' do
247
+ it 'returns the string representation of the object' do
248
+ instance = Freeclimb::LogResult.new(
249
+ timestamp: 1,
250
+ level: "INFO",
251
+ request_id: "TS",
252
+ account_id: "TS",
253
+ call_id: "TS",
254
+ message: "TS",
255
+ metadata: Object.new(),
256
+ )
257
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
258
+ end
259
+ end
260
+
261
+ describe 'test method "to_hash"' do
262
+ it 'returns the object in the form of hash' do
263
+ instance = Freeclimb::LogResult.new(
264
+ timestamp: 1,
265
+ level: "INFO",
266
+ request_id: "TS",
267
+ account_id: "TS",
268
+ call_id: "TS",
269
+ message: "TS",
270
+ metadata: Object.new(),
271
+ )
272
+ expect(instance.to_hash).to be_a_kind_of(Hash)
273
+ end
274
+ it 'creates equal hash for two equal objects' do
275
+ obj = Object.new()
276
+ instance_1 = Freeclimb::LogResult.new(
277
+ timestamp: 1,
278
+ level: "INFO",
279
+ request_id: "TS",
280
+ account_id: "TS",
281
+ call_id: "TS",
282
+ message: "TS",
283
+ metadata: obj,
284
+ )
285
+ instance_2 = Freeclimb::LogResult.new(
286
+ timestamp: 1,
287
+ level: "INFO",
288
+ request_id: "TS",
289
+ account_id: "TS",
290
+ call_id: "TS",
291
+ message: "TS",
292
+ metadata: obj,
293
+ )
294
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
295
+ end
296
+ end
297
+
298
+ describe 'test method "_to_hash"' do
299
+ instance = Freeclimb::LogResult.new(
300
+ timestamp: 1,
301
+
302
+ level: "INFO",
303
+
304
+ request_id: "TS",
305
+
306
+ account_id: "TS",
307
+
308
+ call_id: "TS",
309
+
310
+ message: "TS",
311
+
312
+ metadata: Object.new(),
313
+ )
314
+ it 'returns timestamp in the form of hash' do
315
+ expect(instance._to_hash(instance.timestamp)).to eq(instance.timestamp)
316
+ end
317
+ it 'returns level in the form of hash' do
318
+ expect(instance._to_hash(instance.level)).to eq(instance.level)
319
+ end
320
+ it 'returns request_id in the form of hash' do
321
+ expect(instance._to_hash(instance.request_id)).to eq(instance.request_id)
322
+ end
323
+ it 'returns account_id in the form of hash' do
324
+ expect(instance._to_hash(instance.account_id)).to eq(instance.account_id)
325
+ end
326
+ it 'returns call_id in the form of hash' do
327
+ expect(instance._to_hash(instance.call_id)).to eq(instance.call_id)
328
+ end
329
+ it 'returns message in the form of hash' do
330
+ expect(instance._to_hash(instance.message)).to eq(instance.message)
331
+ end
332
+ it 'returns metadata in the form of hash' do
333
+ expect(instance._to_hash(instance.metadata)).to eq(instance.metadata)
67
334
  end
68
335
  end
69
336
 
@@ -27,12 +27,34 @@ describe Freeclimb::MachineType do
27
27
  end
28
28
  describe 'test attribute "ANSWERING_MACHINE"' do
29
29
  it 'should work' do
30
- expect { Freeclimb::MachineType::ANSWERING_MACHINE = "answeringMachine" }.not_to raise_error
31
- end
30
+ expect { Freeclimb::MachineType::ANSWERING_MACHINE = "answeringMachine" }.not_to raise_error
32
31
  end
32
+ it 'should serialize to enum' do
33
+ expectedValue = Freeclimb::MachineType::ANSWERING_MACHINE
34
+ calculatedValue = Freeclimb::MachineType::build_from_hash("answeringMachine")
35
+ expect(expectedValue).to eq(calculatedValue)
36
+ end
37
+ it 'should deserialize to string' do
38
+ expectedValue = "answeringMachine"
39
+ calculatedValue = Freeclimb::MachineType::ANSWERING_MACHINE
40
+ expect(expectedValue).to eq(calculatedValue)
41
+ end
42
+ end
43
+
33
44
  describe 'test attribute "FAX_MACHINE"' do
34
45
  it 'should work' do
35
- expect { Freeclimb::MachineType::FAX_MACHINE = "faxMachine" }.not_to raise_error
36
- end
46
+ expect { Freeclimb::MachineType::FAX_MACHINE = "faxMachine" }.not_to raise_error
37
47
  end
48
+ it 'should serialize to enum' do
49
+ expectedValue = Freeclimb::MachineType::FAX_MACHINE
50
+ calculatedValue = Freeclimb::MachineType::build_from_hash("faxMachine")
51
+ expect(expectedValue).to eq(calculatedValue)
52
+ end
53
+ it 'should deserialize to string' do
54
+ expectedValue = "faxMachine"
55
+ calculatedValue = Freeclimb::MachineType::FAX_MACHINE
56
+ expect(expectedValue).to eq(calculatedValue)
57
+ end
58
+ end
59
+
38
60
  end