freeclimb 4.9.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile.lock +34 -18
  4. data/README.md +43 -51
  5. data/docs/AddToConferenceNotificationWebhook.md +42 -0
  6. data/docs/AddToQueueNotificationWebhook.md +34 -0
  7. data/docs/BargeInReason.md +18 -0
  8. data/docs/CallControlWebhook.md +26 -0
  9. data/docs/CallEndedReason.md +38 -0
  10. data/docs/CallStatusWebhook.md +36 -0
  11. data/docs/CompletionResult.md +1 -1
  12. data/docs/CompletionResultStatus.md +17 -0
  13. data/docs/ConferenceRecordingStatusWebhook.md +42 -0
  14. data/docs/ConferenceResult.md +1 -1
  15. data/docs/ConferenceStatusWebhook.md +42 -0
  16. data/docs/CreateConference.md +1 -1
  17. data/docs/CreateConferenceRequest.md +1 -1
  18. data/docs/CreateConferenceWebhook.md +42 -0
  19. data/docs/DequeueWebhook.md +38 -0
  20. data/docs/GetDigitsReason.md +19 -0
  21. data/docs/GetDigitsWebhook.md +40 -0
  22. data/docs/GetSpeechWebhook.md +50 -0
  23. data/docs/InboundCallWebhook.md +36 -0
  24. data/docs/LeaveConferenceWebhook.md +34 -0
  25. data/docs/MachineDetectedWebhook.md +38 -0
  26. data/docs/MachineType.md +2 -2
  27. data/docs/MessageDeliveryWebhook.md +36 -0
  28. data/docs/MessageStatusWebhook.md +38 -0
  29. data/docs/OutDialApiConnectWebhook.md +36 -0
  30. data/docs/OutDialConnectWebhook.md +36 -0
  31. data/docs/OutDialStartWebhook.md +38 -0
  32. data/docs/QueueWaitWebhook.md +40 -0
  33. data/docs/RecordWebhook.md +50 -0
  34. data/docs/RedirectWebhook.md +36 -0
  35. data/docs/RemoveFromQueueNotificationWebhook.md +38 -0
  36. data/docs/SMSTenDLCBrand.md +6 -6
  37. data/docs/SMSTenDLCBrandAltBusinessIdType.md +19 -0
  38. data/docs/SMSTenDLCBrandEntityType.md +20 -0
  39. data/docs/SMSTenDLCBrandIdentityStatus.md +19 -0
  40. data/docs/SMSTenDLCBrandRelationship.md +20 -0
  41. data/docs/SMSTenDLCBrandStockExchange.md +42 -0
  42. data/docs/SMSTenDLCCampaign.md +1 -1
  43. data/docs/SMSTenDLCCampaignStatus.md +17 -0
  44. data/docs/SMSTenDLCPartnerCampaign.md +1 -1
  45. data/docs/SMSTenDLCPartnerCampaignStatus.md +17 -0
  46. data/docs/SMSTollFreeCampaign.md +1 -1
  47. data/docs/SMSTollFreeCampaignRegistrationStatus.md +20 -0
  48. data/docs/TranscribeReason.md +20 -0
  49. data/docs/TranscribeTermReason.md +17 -0
  50. data/docs/TranscribeUtterance.md +2 -2
  51. data/docs/TranscribeWebhook.md +62 -0
  52. data/docs/UpdateConferenceRequest.md +1 -1
  53. data/docs/Webhook.md +18 -0
  54. data/freeclimb.gemspec +1 -1
  55. data/lib/freeclimb/api/default_api.rb +18 -18
  56. data/lib/freeclimb/api_client.rb +1 -1
  57. data/lib/freeclimb/api_error.rb +1 -1
  58. data/lib/freeclimb/configuration.rb +1 -2
  59. data/lib/freeclimb/models/account_request.rb +1 -3
  60. data/lib/freeclimb/models/account_result.rb +23 -4
  61. data/lib/freeclimb/models/account_status.rb +1 -1
  62. data/lib/freeclimb/models/account_type.rb +1 -1
  63. data/lib/freeclimb/models/add_to_conference.rb +1 -4
  64. data/lib/freeclimb/models/add_to_conference_notification_webhook.rb +384 -0
  65. data/lib/freeclimb/models/{conference_participant_result_all_of.rb → add_to_queue_notification_webhook.rb} +112 -59
  66. data/lib/freeclimb/models/answered_by.rb +1 -1
  67. data/lib/freeclimb/models/application_list.rb +1 -4
  68. data/lib/freeclimb/models/application_request.rb +1 -3
  69. data/lib/freeclimb/models/application_result.rb +1 -4
  70. data/lib/freeclimb/models/available_number.rb +1 -3
  71. data/lib/freeclimb/models/available_number_list.rb +1 -4
  72. data/lib/freeclimb/models/barge_in_reason.rb +38 -0
  73. data/lib/freeclimb/models/buy_incoming_number_request.rb +1 -3
  74. data/lib/freeclimb/models/{recording_result_all_of.rb → call_control_webhook.rb} +57 -45
  75. data/lib/freeclimb/models/call_direction.rb +1 -1
  76. data/lib/freeclimb/models/call_ended_reason.rb +58 -0
  77. data/lib/freeclimb/models/call_list.rb +1 -4
  78. data/lib/freeclimb/models/call_result.rb +23 -4
  79. data/lib/freeclimb/models/call_status.rb +1 -1
  80. data/lib/freeclimb/models/call_status_webhook.rb +354 -0
  81. data/lib/freeclimb/models/capabilities.rb +1 -3
  82. data/lib/freeclimb/models/completion_request.rb +1 -3
  83. data/lib/freeclimb/models/completion_result.rb +2 -15
  84. data/lib/freeclimb/models/completion_result_status.rb +37 -0
  85. data/lib/freeclimb/models/conference_list.rb +1 -4
  86. data/lib/freeclimb/models/conference_participant_list.rb +1 -4
  87. data/lib/freeclimb/models/conference_participant_result.rb +1 -4
  88. data/lib/freeclimb/models/conference_recording_status_webhook.rb +384 -0
  89. data/lib/freeclimb/models/conference_result.rb +23 -6
  90. data/lib/freeclimb/models/conference_status.rb +1 -1
  91. data/lib/freeclimb/models/conference_status_webhook.rb +387 -0
  92. data/lib/freeclimb/models/create_conference.rb +23 -6
  93. data/lib/freeclimb/models/create_conference_request.rb +23 -5
  94. data/lib/freeclimb/models/create_conference_webhook.rb +387 -0
  95. data/lib/freeclimb/models/create_web_rtc_token.rb +1 -3
  96. data/lib/freeclimb/models/dequeue.rb +1 -3
  97. data/lib/freeclimb/models/dequeue_webhook.rb +365 -0
  98. data/lib/freeclimb/models/enqueue.rb +1 -4
  99. data/lib/freeclimb/models/filter_logs_request.rb +1 -3
  100. data/lib/freeclimb/models/get_digits.rb +1 -4
  101. data/lib/freeclimb/models/get_digits_reason.rb +39 -0
  102. data/lib/freeclimb/models/get_digits_webhook.rb +373 -0
  103. data/lib/freeclimb/models/get_speech.rb +23 -4
  104. data/lib/freeclimb/models/get_speech_reason.rb +1 -1
  105. data/lib/freeclimb/models/get_speech_webhook.rb +423 -0
  106. data/lib/freeclimb/models/grammar_file_built_in.rb +1 -1
  107. data/lib/freeclimb/models/grammar_type.rb +1 -1
  108. data/lib/freeclimb/models/hangup.rb +1 -4
  109. data/lib/freeclimb/models/if_machine.rb +1 -1
  110. data/lib/freeclimb/models/inbound_call_webhook.rb +355 -0
  111. data/lib/freeclimb/models/incoming_number_list.rb +1 -4
  112. data/lib/freeclimb/models/incoming_number_request.rb +1 -3
  113. data/lib/freeclimb/models/incoming_number_result.rb +1 -4
  114. data/lib/freeclimb/models/language.rb +1 -1
  115. data/lib/freeclimb/models/{conference_result_all_of.rb → leave_conference_webhook.rb} +110 -89
  116. data/lib/freeclimb/models/log_level.rb +1 -1
  117. data/lib/freeclimb/models/log_list.rb +1 -4
  118. data/lib/freeclimb/models/log_result.rb +23 -3
  119. data/lib/freeclimb/models/{call_result_all_of.rb → machine_detected_webhook.rb} +96 -119
  120. data/lib/freeclimb/models/machine_type.rb +3 -3
  121. data/lib/freeclimb/models/make_call_request.rb +1 -3
  122. data/lib/freeclimb/models/{message_result_all_of.rb → message_delivery_webhook.rb} +71 -87
  123. data/lib/freeclimb/models/message_direction.rb +1 -1
  124. data/lib/freeclimb/models/message_request.rb +1 -4
  125. data/lib/freeclimb/models/message_result.rb +23 -4
  126. data/lib/freeclimb/models/message_status.rb +1 -1
  127. data/lib/freeclimb/models/{incoming_number_result_all_of.rb → message_status_webhook.rb} +117 -107
  128. data/lib/freeclimb/models/messages_list.rb +1 -4
  129. data/lib/freeclimb/models/mutable_resource_model.rb +1 -3
  130. data/lib/freeclimb/models/out_dial.rb +23 -4
  131. data/lib/freeclimb/models/out_dial_api_connect_webhook.rb +355 -0
  132. data/lib/freeclimb/models/out_dial_connect_webhook.rb +355 -0
  133. data/lib/freeclimb/models/out_dial_start_webhook.rb +366 -0
  134. data/lib/freeclimb/models/pagination_model.rb +1 -3
  135. data/lib/freeclimb/models/park.rb +1 -4
  136. data/lib/freeclimb/models/pause.rb +1 -4
  137. data/lib/freeclimb/models/percl_command.rb +3 -5
  138. data/lib/freeclimb/models/percl_script.rb +2 -4
  139. data/lib/freeclimb/models/play.rb +2 -5
  140. data/lib/freeclimb/models/play_beep.rb +1 -1
  141. data/lib/freeclimb/models/play_early_media.rb +2 -5
  142. data/lib/freeclimb/models/queue_list.rb +2 -5
  143. data/lib/freeclimb/models/queue_member.rb +1 -3
  144. data/lib/freeclimb/models/queue_member_list.rb +2 -5
  145. data/lib/freeclimb/models/queue_request.rb +1 -3
  146. data/lib/freeclimb/models/queue_result.rb +2 -5
  147. data/lib/freeclimb/models/queue_result_status.rb +1 -1
  148. data/lib/freeclimb/models/queue_wait_webhook.rb +375 -0
  149. data/lib/freeclimb/models/record_utterance.rb +2 -5
  150. data/lib/freeclimb/models/record_utterance_term_reason.rb +1 -1
  151. data/lib/freeclimb/models/record_webhook.rb +424 -0
  152. data/lib/freeclimb/models/recording_list.rb +2 -5
  153. data/lib/freeclimb/models/recording_result.rb +2 -5
  154. data/lib/freeclimb/models/redirect.rb +2 -5
  155. data/lib/freeclimb/models/redirect_webhook.rb +355 -0
  156. data/lib/freeclimb/models/reject.rb +2 -5
  157. data/lib/freeclimb/models/remove_from_conference.rb +1 -3
  158. data/lib/freeclimb/models/remove_from_queue_notification_webhook.rb +364 -0
  159. data/lib/freeclimb/models/request_type.rb +1 -1
  160. data/lib/freeclimb/models/say.rb +2 -5
  161. data/lib/freeclimb/models/send_digits.rb +2 -5
  162. data/lib/freeclimb/models/set_dtmf_pass_through.rb +2 -5
  163. data/lib/freeclimb/models/set_listen.rb +2 -5
  164. data/lib/freeclimb/models/set_talk.rb +2 -5
  165. data/lib/freeclimb/models/sms.rb +2 -5
  166. data/lib/freeclimb/models/sms_ten_dlc_brand.rb +6 -67
  167. data/lib/freeclimb/models/sms_ten_dlc_brand_alt_business_id_type.rb +39 -0
  168. data/lib/freeclimb/models/sms_ten_dlc_brand_entity_type.rb +40 -0
  169. data/lib/freeclimb/models/sms_ten_dlc_brand_identity_status.rb +39 -0
  170. data/lib/freeclimb/models/sms_ten_dlc_brand_relationship.rb +40 -0
  171. data/lib/freeclimb/models/sms_ten_dlc_brand_stock_exchange.rb +62 -0
  172. data/lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb +2 -5
  173. data/lib/freeclimb/models/sms_ten_dlc_campaign.rb +2 -15
  174. data/lib/freeclimb/models/sms_ten_dlc_campaign_status.rb +37 -0
  175. data/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb +2 -5
  176. data/lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb +2 -15
  177. data/lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb +1 -3
  178. data/lib/freeclimb/models/sms_ten_dlc_partner_campaign_status.rb +37 -0
  179. data/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb +2 -5
  180. data/lib/freeclimb/models/sms_toll_free_campaign.rb +2 -15
  181. data/lib/freeclimb/models/sms_toll_free_campaign_registration_status.rb +40 -0
  182. data/lib/freeclimb/models/sms_toll_free_campaigns_list_result.rb +2 -5
  183. data/lib/freeclimb/models/start_record_call.rb +1 -3
  184. data/lib/freeclimb/models/terminate_conference.rb +1 -3
  185. data/lib/freeclimb/models/tfn.rb +1 -3
  186. data/lib/freeclimb/models/transcribe_reason.rb +40 -0
  187. data/lib/freeclimb/models/transcribe_term_reason.rb +37 -0
  188. data/lib/freeclimb/models/transcribe_utterance.rb +4 -7
  189. data/lib/freeclimb/models/{transcribe_utterance_all_of_record.rb → transcribe_utterance_record.rb} +8 -10
  190. data/lib/freeclimb/models/transcribe_webhook.rb +481 -0
  191. data/lib/freeclimb/models/unpark.rb +1 -3
  192. data/lib/freeclimb/models/update_call_request.rb +23 -3
  193. data/lib/freeclimb/models/update_call_request_status.rb +1 -1
  194. data/lib/freeclimb/models/update_conference_participant_request.rb +1 -3
  195. data/lib/freeclimb/models/update_conference_request.rb +23 -5
  196. data/lib/freeclimb/models/update_conference_request_status.rb +1 -1
  197. data/lib/freeclimb/models/{call_list_all_of.rb → webhook.rb} +18 -17
  198. data/lib/freeclimb/utils/request_verifier.rb +51 -51
  199. data/lib/freeclimb/utils/signature_information.rb +34 -34
  200. data/lib/freeclimb/version.rb +2 -2
  201. data/lib/freeclimb.rb +41 -49
  202. data/openapi.json +1734 -681
  203. data/package.json +3 -1
  204. data/spec/api/default_api_spec.rb +61 -35
  205. data/spec/factories.rb +78 -78
  206. data/spec/models/account_request_spec.rb +55 -17
  207. data/spec/models/account_result_spec.rb +304 -80
  208. data/spec/models/account_status_spec.rb +1 -1
  209. data/spec/models/account_type_spec.rb +1 -1
  210. data/spec/models/add_to_conference_notification_webhook_spec.rb +866 -0
  211. data/spec/models/add_to_conference_spec.rb +251 -38
  212. data/spec/models/add_to_queue_notification_webhook_spec.rb +643 -0
  213. data/spec/models/answered_by_spec.rb +1 -1
  214. data/spec/models/application_list_spec.rb +181 -39
  215. data/spec/models/application_request_spec.rb +160 -32
  216. data/spec/models/application_result_spec.rb +286 -50
  217. data/spec/models/available_number_list_spec.rb +181 -39
  218. data/spec/models/available_number_spec.rb +160 -32
  219. data/spec/models/barge_in_reason_spec.rb +77 -0
  220. data/spec/models/buy_incoming_number_request_spec.rb +76 -20
  221. data/spec/models/call_control_webhook_spec.rb +385 -0
  222. data/spec/models/call_direction_spec.rb +1 -1
  223. data/spec/models/call_ended_reason_spec.rb +397 -0
  224. data/spec/models/call_list_spec.rb +181 -39
  225. data/spec/models/call_result_spec.rb +551 -122
  226. data/spec/models/call_status_spec.rb +1 -1
  227. data/spec/models/call_status_webhook_spec.rb +793 -0
  228. data/spec/models/capabilities_spec.rb +118 -26
  229. data/spec/models/completion_request_spec.rb +35 -15
  230. data/spec/models/completion_result_spec.rb +91 -45
  231. data/spec/models/completion_result_status_spec.rb +61 -0
  232. data/spec/models/conference_list_spec.rb +181 -39
  233. data/spec/models/conference_participant_list_spec.rb +181 -39
  234. data/spec/models/conference_participant_result_spec.rb +272 -41
  235. data/spec/models/conference_recording_status_webhook_spec.rb +866 -0
  236. data/spec/models/conference_result_spec.rb +367 -89
  237. data/spec/models/conference_status_spec.rb +1 -1
  238. data/spec/models/conference_status_webhook_spec.rb +866 -0
  239. data/spec/models/create_conference_request_spec.rb +148 -44
  240. data/spec/models/create_conference_spec.rb +169 -47
  241. data/spec/models/create_conference_webhook_spec.rb +866 -0
  242. data/spec/models/create_web_rtc_token_spec.rb +76 -20
  243. data/spec/models/dequeue_spec.rb +1 -1
  244. data/spec/models/dequeue_webhook_spec.rb +743 -0
  245. data/spec/models/enqueue_spec.rb +97 -23
  246. data/spec/models/filter_logs_request_spec.rb +34 -14
  247. data/spec/models/get_digits_reason_spec.rb +93 -0
  248. data/spec/models/get_digits_spec.rb +202 -42
  249. data/spec/models/get_digits_webhook_spec.rb +815 -0
  250. data/spec/models/get_speech_reason_spec.rb +1 -1
  251. data/spec/models/get_speech_spec.rb +308 -66
  252. data/spec/models/get_speech_webhook_spec.rb +1072 -0
  253. data/spec/models/grammar_file_built_in_spec.rb +1 -1
  254. data/spec/models/grammar_type_spec.rb +1 -1
  255. data/spec/models/hangup_spec.rb +34 -14
  256. data/spec/models/if_machine_spec.rb +1 -1
  257. data/spec/models/inbound_call_webhook_spec.rb +692 -0
  258. data/spec/models/incoming_number_list_spec.rb +181 -39
  259. data/spec/models/incoming_number_request_spec.rb +76 -20
  260. data/spec/models/incoming_number_result_spec.rb +370 -62
  261. data/spec/models/language_spec.rb +1 -1
  262. data/spec/models/leave_conference_webhook_spec.rb +643 -0
  263. data/spec/models/log_level_spec.rb +1 -1
  264. data/spec/models/log_list_spec.rb +181 -39
  265. data/spec/models/log_result_spec.rb +190 -50
  266. data/spec/models/machine_detected_webhook_spec.rb +758 -0
  267. data/spec/models/machine_type_spec.rb +10 -10
  268. data/spec/models/make_call_request_spec.rb +223 -41
  269. data/spec/models/message_delivery_webhook_spec.rb +630 -0
  270. data/spec/models/message_direction_spec.rb +1 -1
  271. data/spec/models/message_request_spec.rb +202 -38
  272. data/spec/models/message_result_spec.rb +375 -74
  273. data/spec/models/message_status_spec.rb +1 -1
  274. data/spec/models/message_status_webhook_spec.rb +732 -0
  275. data/spec/models/messages_list_spec.rb +181 -39
  276. data/spec/models/mutable_resource_model_spec.rb +97 -23
  277. data/spec/models/out_dial_api_connect_webhook_spec.rb +692 -0
  278. data/spec/models/out_dial_connect_webhook_spec.rb +692 -0
  279. data/spec/models/out_dial_spec.rb +253 -59
  280. data/spec/models/out_dial_start_webhook_spec.rb +741 -0
  281. data/spec/models/pagination_model_spec.rb +160 -32
  282. data/spec/models/park_spec.rb +76 -20
  283. data/spec/models/pause_spec.rb +34 -14
  284. data/spec/models/percl_command_spec.rb +34 -14
  285. data/spec/models/percl_script_spec.rb +34 -18
  286. data/spec/models/play_beep_spec.rb +1 -1
  287. data/spec/models/play_early_media_spec.rb +34 -14
  288. data/spec/models/play_spec.rb +76 -20
  289. data/spec/models/queue_list_spec.rb +181 -39
  290. data/spec/models/queue_member_list_spec.rb +181 -39
  291. data/spec/models/queue_member_spec.rb +118 -26
  292. data/spec/models/queue_request_spec.rb +55 -17
  293. data/spec/models/queue_result_spec.rb +244 -44
  294. data/spec/models/queue_result_status_spec.rb +1 -1
  295. data/spec/models/queue_wait_webhook_spec.rb +794 -0
  296. data/spec/models/record_utterance_spec.rb +160 -32
  297. data/spec/models/record_utterance_term_reason_spec.rb +1 -1
  298. data/spec/models/record_webhook_spec.rb +1062 -0
  299. data/spec/models/recording_list_spec.rb +181 -39
  300. data/spec/models/recording_result_spec.rb +202 -38
  301. data/spec/models/redirect_spec.rb +34 -14
  302. data/spec/models/redirect_webhook_spec.rb +692 -0
  303. data/spec/models/reject_spec.rb +34 -14
  304. data/spec/models/remove_from_conference_spec.rb +1 -1
  305. data/spec/models/remove_from_queue_notification_webhook_spec.rb +768 -0
  306. data/spec/models/request_type_spec.rb +1 -1
  307. data/spec/models/say_spec.rb +97 -23
  308. data/spec/models/send_digits_spec.rb +76 -20
  309. data/spec/models/set_dtmf_pass_through_spec.rb +34 -14
  310. data/spec/models/set_listen_spec.rb +34 -14
  311. data/spec/models/set_talk_spec.rb +34 -14
  312. data/spec/models/sms_spec.rb +97 -23
  313. data/spec/models/sms_ten_dlc_brand_alt_business_id_type_spec.rb +93 -0
  314. data/spec/models/sms_ten_dlc_brand_entity_type_spec.rb +109 -0
  315. data/spec/models/sms_ten_dlc_brand_identity_status_spec.rb +93 -0
  316. data/spec/models/sms_ten_dlc_brand_relationship_spec.rb +109 -0
  317. data/spec/models/sms_ten_dlc_brand_spec.rb +933 -378
  318. data/spec/models/sms_ten_dlc_brand_stock_exchange_spec.rb +461 -0
  319. data/spec/models/sms_ten_dlc_brands_list_result_spec.rb +181 -39
  320. data/spec/models/sms_ten_dlc_campaign_spec.rb +820 -164
  321. data/spec/models/sms_ten_dlc_campaign_status_spec.rb +61 -0
  322. data/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb +181 -39
  323. data/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb +251 -51
  324. data/spec/models/sms_ten_dlc_partner_campaign_spec.rb +713 -183
  325. data/spec/models/sms_ten_dlc_partner_campaign_status_spec.rb +61 -0
  326. data/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb +181 -39
  327. data/spec/models/sms_toll_free_campaign_registration_status_spec.rb +109 -0
  328. data/spec/models/sms_toll_free_campaign_spec.rb +200 -69
  329. data/spec/models/sms_toll_free_campaigns_list_result_spec.rb +181 -39
  330. data/spec/models/start_record_call_spec.rb +1 -1
  331. data/spec/models/terminate_conference_spec.rb +1 -1
  332. data/spec/models/tfn_spec.rb +34 -14
  333. data/spec/models/transcribe_reason_spec.rb +109 -0
  334. data/spec/models/transcribe_term_reason_spec.rb +61 -0
  335. data/spec/models/{transcribe_utterance_all_of_record_spec.rb → transcribe_utterance_record_spec.rb} +99 -43
  336. data/spec/models/transcribe_utterance_spec.rb +155 -45
  337. data/spec/models/transcribe_webhook_spec.rb +1373 -0
  338. data/spec/models/unpark_spec.rb +1 -1
  339. data/spec/models/update_call_request_spec.rb +64 -32
  340. data/spec/models/update_call_request_status_spec.rb +1 -1
  341. data/spec/models/update_conference_participant_request_spec.rb +104 -17
  342. data/spec/models/update_conference_request_spec.rb +136 -56
  343. data/spec/models/update_conference_request_status_spec.rb +1 -1
  344. data/spec/models/webhook_spec.rb +176 -0
  345. data/spec/quickstart_spec.rb +7 -7
  346. data/spec/spec_helper.rb +1 -1
  347. data/spec/utils/request_verifier_spec.rb +123 -123
  348. data/spec/utils/signature_information_spec.rb +36 -36
  349. data/yarn.lock +91 -91
  350. metadata +157 -100
  351. data/docs/AccountResultAllOf.md +0 -30
  352. data/docs/AddToConferenceAllOf.md +0 -36
  353. data/docs/ApplicationListAllOf.md +0 -18
  354. data/docs/ApplicationResultAllOf.md +0 -34
  355. data/docs/AvailableNumberListAllOf.md +0 -18
  356. data/docs/CallListAllOf.md +0 -18
  357. data/docs/CallResultAllOf.md +0 -48
  358. data/docs/ConferenceListAllOf.md +0 -18
  359. data/docs/ConferenceParticipantListAllOf.md +0 -18
  360. data/docs/ConferenceParticipantResultAllOf.md +0 -30
  361. data/docs/ConferenceResultAllOf.md +0 -36
  362. data/docs/CreateConferenceAllOf.md +0 -28
  363. data/docs/EnqueueAllOf.md +0 -24
  364. data/docs/GetDigitsAllOf.md +0 -34
  365. data/docs/GetSpeechAllOf.md +0 -42
  366. data/docs/HangupAllOf.md +0 -18
  367. data/docs/IncomingNumberListAllOf.md +0 -18
  368. data/docs/IncomingNumberResultAllOf.md +0 -42
  369. data/docs/LogListAllOf.md +0 -18
  370. data/docs/MessageRequestAllOf.md +0 -26
  371. data/docs/MessageResultAllOf.md +0 -40
  372. data/docs/MessagesListAllOf.md +0 -18
  373. data/docs/OutDialAllOf.md +0 -36
  374. data/docs/ParkAllOf.md +0 -22
  375. data/docs/PauseAllOf.md +0 -18
  376. data/docs/PlayAllOf.md +0 -22
  377. data/docs/PlayEarlyMediaAllOf.md +0 -18
  378. data/docs/QueueListAllOf.md +0 -18
  379. data/docs/QueueMemberListAllOf.md +0 -18
  380. data/docs/QueueResultAllOf.md +0 -30
  381. data/docs/RecordUtteranceAllOf.md +0 -30
  382. data/docs/RecordingListAllOf.md +0 -18
  383. data/docs/RecordingResultAllOf.md +0 -26
  384. data/docs/RedirectAllOf.md +0 -18
  385. data/docs/RejectAllOf.md +0 -18
  386. data/docs/RemoveFromConferenceAllOf.md +0 -18
  387. data/docs/SMSTenDLCBrandsListResultAllOf.md +0 -18
  388. data/docs/SMSTenDLCCampaignsListResultAllOf.md +0 -18
  389. data/docs/SMSTenDLCPartnerCampaignsListResultAllOf.md +0 -18
  390. data/docs/SMSTollFreeCampaignsListResultAllOf.md +0 -18
  391. data/docs/SayAllOf.md +0 -24
  392. data/docs/SendDigitsAllOf.md +0 -22
  393. data/docs/SetDTMFPassThroughAllOf.md +0 -18
  394. data/docs/SetListenAllOf.md +0 -18
  395. data/docs/SetTalkAllOf.md +0 -18
  396. data/docs/SmsAllOf.md +0 -24
  397. data/docs/TerminateConferenceAllOf.md +0 -18
  398. data/docs/TranscribeUtteranceAllOf.md +0 -28
  399. data/docs/TranscribeUtteranceAllOfRecord.md +0 -22
  400. data/lib/freeclimb/models/account_result_all_of.rb +0 -289
  401. data/lib/freeclimb/models/add_to_conference_all_of.rb +0 -318
  402. data/lib/freeclimb/models/application_list_all_of.rb +0 -226
  403. data/lib/freeclimb/models/application_result_all_of.rb +0 -313
  404. data/lib/freeclimb/models/available_number_list_all_of.rb +0 -226
  405. data/lib/freeclimb/models/conference_list_all_of.rb +0 -226
  406. data/lib/freeclimb/models/conference_participant_list_all_of.rb +0 -226
  407. data/lib/freeclimb/models/create_conference_all_of.rb +0 -280
  408. data/lib/freeclimb/models/enqueue_all_of.rb +0 -266
  409. data/lib/freeclimb/models/get_digits_all_of.rb +0 -310
  410. data/lib/freeclimb/models/get_speech_all_of.rb +0 -354
  411. data/lib/freeclimb/models/hangup_all_of.rb +0 -224
  412. data/lib/freeclimb/models/incoming_number_list_all_of.rb +0 -226
  413. data/lib/freeclimb/models/log_list_all_of.rb +0 -226
  414. data/lib/freeclimb/models/message_request_all_of.rb +0 -279
  415. data/lib/freeclimb/models/messages_list_all_of.rb +0 -227
  416. data/lib/freeclimb/models/out_dial_all_of.rb +0 -329
  417. data/lib/freeclimb/models/park_all_of.rb +0 -252
  418. data/lib/freeclimb/models/pause_all_of.rb +0 -228
  419. data/lib/freeclimb/models/play_all_of.rb +0 -248
  420. data/lib/freeclimb/models/play_early_media_all_of.rb +0 -228
  421. data/lib/freeclimb/models/queue_list_all_of.rb +0 -226
  422. data/lib/freeclimb/models/queue_member_list_all_of.rb +0 -226
  423. data/lib/freeclimb/models/queue_result_all_of.rb +0 -291
  424. data/lib/freeclimb/models/record_utterance_all_of.rb +0 -288
  425. data/lib/freeclimb/models/recording_list_all_of.rb +0 -226
  426. data/lib/freeclimb/models/redirect_all_of.rb +0 -228
  427. data/lib/freeclimb/models/reject_all_of.rb +0 -224
  428. data/lib/freeclimb/models/say_all_of.rb +0 -260
  429. data/lib/freeclimb/models/send_digits_all_of.rb +0 -248
  430. data/lib/freeclimb/models/set_dtmf_pass_through_all_of.rb +0 -224
  431. data/lib/freeclimb/models/set_listen_all_of.rb +0 -224
  432. data/lib/freeclimb/models/set_talk_all_of.rb +0 -224
  433. data/lib/freeclimb/models/sms_all_of.rb +0 -266
  434. data/lib/freeclimb/models/sms_ten_dlc_brands_list_result_all_of.rb +0 -226
  435. data/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of.rb +0 -226
  436. data/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of.rb +0 -226
  437. data/lib/freeclimb/models/sms_toll_free_campaigns_list_result_all_of.rb +0 -226
  438. data/lib/freeclimb/models/transcribe_utterance_all_of.rb +0 -281
@@ -0,0 +1,355 @@
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: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ # An outbound call initiated by the REST API has connected and the callConnectUrl specified in the API request is being invoked. A PerCL response is expected if the call was successfully connected (with status of inProgress).
18
+ class OutDialApiConnectWebhook < Webhook
19
+ def self.deserialize(payload)
20
+ return nil if payload.nil? || payload.empty?
21
+ data = JSON.parse("[#{payload}]")[0]
22
+ inverted_attributes = self.attribute_map.invert
23
+ hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h
24
+ OutDialApiConnectWebhook.new(hash)
25
+ end
26
+ # Context or reason why this request is being made. Will be outDialApiConnect - An outbound call spawned by the REST API has connected and the callConnectUrl specified in the API request is being invoked.
27
+ attr_accessor :request_type
28
+
29
+ # Account ID associated with your account.
30
+ attr_accessor :account_id
31
+
32
+ # Unique identifier for this Call, generated by FreeClimb
33
+ attr_accessor :call_id
34
+
35
+ # Phone number of the party that initiated the Call (in E.164 format).
36
+ attr_accessor :from
37
+
38
+ # Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format).
39
+ attr_accessor :to
40
+
41
+ attr_accessor :call_status
42
+
43
+ attr_accessor :direction
44
+
45
+ # This is only populated if request pertains to a conference. Otherwise, it is set to null.
46
+ attr_accessor :conference_id
47
+
48
+ # This is only populated if the request pertains to a queue. Otherwise, it is set to null.
49
+ attr_accessor :queue_id
50
+
51
+ # ID of the Call that created this leg (child call).
52
+ attr_accessor :parent_call_id
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'request_type' => :'requestType',
80
+ :'account_id' => :'accountId',
81
+ :'call_id' => :'callId',
82
+ :'from' => :'from',
83
+ :'to' => :'to',
84
+ :'call_status' => :'callStatus',
85
+ :'direction' => :'direction',
86
+ :'conference_id' => :'conferenceId',
87
+ :'queue_id' => :'queueId',
88
+ :'parent_call_id' => :'parentCallId'
89
+ }
90
+ end
91
+
92
+ # Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
93
+ def self.acceptable_attributes
94
+ attribute_map.values.concat(superclass.acceptable_attributes)
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.openapi_types
99
+ {
100
+ :'request_type' => :'String',
101
+ :'account_id' => :'String',
102
+ :'call_id' => :'String',
103
+ :'from' => :'String',
104
+ :'to' => :'String',
105
+ :'call_status' => :'CallStatus',
106
+ :'direction' => :'CallDirection',
107
+ :'conference_id' => :'String',
108
+ :'queue_id' => :'String',
109
+ :'parent_call_id' => :'String'
110
+ }
111
+ end
112
+
113
+ # List of attributes with nullable: true
114
+ def self.openapi_nullable
115
+ Set.new([
116
+ :'call_status',
117
+ :'direction',
118
+ :'conference_id',
119
+ :'queue_id',
120
+ ])
121
+ end
122
+
123
+ # List of class defined in allOf (OpenAPI v3)
124
+ def self.openapi_all_of
125
+ [
126
+ :'Webhook'
127
+ ]
128
+ end
129
+
130
+ # Initializes the object
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ def initialize(attributes = {})
133
+ if (!attributes.is_a?(Hash))
134
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialApiConnectWebhook` initialize method"
135
+ end
136
+
137
+ # check to see if the attribute exists and convert string to symbol for hash key
138
+ attributes = attributes.each_with_object({}) { |(k, v), h|
139
+ if (!self.class.attribute_map.key?(k.to_sym))
140
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialApiConnectWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
141
+ end
142
+ h[k.to_sym] = v
143
+ }
144
+
145
+ # call parent's initialize
146
+ super(attributes)
147
+
148
+ if attributes.key?(:'request_type')
149
+ self.request_type = attributes[:'request_type']
150
+ end
151
+
152
+ if attributes.key?(:'account_id')
153
+ self.account_id = attributes[:'account_id']
154
+ end
155
+
156
+ if attributes.key?(:'call_id')
157
+ self.call_id = attributes[:'call_id']
158
+ end
159
+
160
+ if attributes.key?(:'from')
161
+ self.from = attributes[:'from']
162
+ end
163
+
164
+ if attributes.key?(:'to')
165
+ self.to = attributes[:'to']
166
+ end
167
+
168
+ if attributes.key?(:'call_status')
169
+ self.call_status = attributes[:'call_status']
170
+ end
171
+
172
+ if attributes.key?(:'direction')
173
+ self.direction = attributes[:'direction']
174
+ end
175
+
176
+ if attributes.key?(:'conference_id')
177
+ self.conference_id = attributes[:'conference_id']
178
+ end
179
+
180
+ if attributes.key?(:'queue_id')
181
+ self.queue_id = attributes[:'queue_id']
182
+ end
183
+
184
+ if attributes.key?(:'parent_call_id')
185
+ self.parent_call_id = attributes[:'parent_call_id']
186
+ end
187
+ end
188
+
189
+ # Show invalid properties with the reasons. Usually used together with valid?
190
+ # @return Array for valid properties with the reasons
191
+ def list_invalid_properties
192
+ invalid_properties = super
193
+ invalid_properties
194
+ end
195
+
196
+ # Check to see if the all the properties in the model are valid
197
+ # @return true if the model is valid
198
+ def valid?
199
+
200
+ if @request_type.nil?
201
+ false
202
+ else
203
+ list_invalid_properties.length() == 0
204
+ end
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(o)
210
+ return true if self.equal?(o)
211
+ self.class == o.class &&
212
+ request_type == o.request_type &&
213
+ account_id == o.account_id &&
214
+ call_id == o.call_id &&
215
+ from == o.from &&
216
+ to == o.to &&
217
+ call_status == o.call_status &&
218
+ direction == o.direction &&
219
+ conference_id == o.conference_id &&
220
+ queue_id == o.queue_id &&
221
+ parent_call_id == o.parent_call_id && super(o)
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] Object to be compared
226
+ def eql?(o)
227
+ self == o
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Integer] Hash code
232
+ def hash
233
+ [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, parent_call_id].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def self.build_from_hash(attributes)
240
+ new.build_from_hash(attributes)
241
+ end
242
+
243
+ # Builds the object from hash
244
+ # @param [Hash] attributes Model attributes in the form of hash
245
+ # @return [Object] Returns the model itself
246
+ def build_from_hash(attributes)
247
+ return nil unless attributes.is_a?(Hash)
248
+ super(attributes)
249
+ self.class.openapi_types.each_pair do |key, type|
250
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
251
+ self.send("#{key}=", nil)
252
+ elsif type =~ /\AArray<(.*)>/i
253
+ # check to ensure the input is an array given that the attribute
254
+ # is documented as an array but the input is not
255
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
256
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
257
+ end
258
+ elsif !attributes[self.class.attribute_map[key]].nil?
259
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
260
+ end
261
+ end
262
+
263
+ self
264
+ end
265
+
266
+ # Deserializes the data based on type
267
+ # @param string type Data type
268
+ # @param string value Value to be deserialized
269
+ # @return [Object] Deserialized data
270
+ def _deserialize(type, value)
271
+ case type.to_sym
272
+ when :Time
273
+ Time.parse(value)
274
+ when :Date
275
+ Date.parse(value)
276
+ when :String
277
+ value.to_s
278
+ when :Integer
279
+ value.to_i
280
+ when :Float
281
+ value.to_f
282
+ when :Boolean
283
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
284
+ true
285
+ else
286
+ false
287
+ end
288
+ when :Object
289
+ # generic object (usually a Hash), return directly
290
+ value
291
+ when /\AArray<(?<inner_type>.+)>\z/
292
+ inner_type = Regexp.last_match[:inner_type]
293
+ value.map { |v| _deserialize(inner_type, v) }
294
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
295
+ k_type = Regexp.last_match[:k_type]
296
+ v_type = Regexp.last_match[:v_type]
297
+ {}.tap do |hash|
298
+ value.each do |k, v|
299
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
300
+ end
301
+ end
302
+ else # model
303
+ # models (e.g. Pet) or oneOf
304
+ klass = Freeclimb.const_get(type)
305
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
306
+ end
307
+ end
308
+
309
+ # Returns the string representation of the object
310
+ # @return [String] String presentation of the object
311
+ def to_s
312
+ to_hash.to_s
313
+ end
314
+
315
+ # to_body is an alias to to_hash (backward compatibility)
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_body
318
+ to_hash
319
+ end
320
+
321
+ # Returns the object in the form of hash
322
+ # @return [Hash] Returns the object in the form of hash
323
+ def to_hash
324
+ hash = super
325
+ self.class.attribute_map.each_pair do |attr, param|
326
+ value = self.send(attr)
327
+ if value.nil?
328
+ is_nullable = self.class.openapi_nullable.include?(attr)
329
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
330
+ end
331
+
332
+ hash[param] = _to_hash(value)
333
+ end
334
+ hash
335
+ end
336
+
337
+ # Outputs non-array value in the form of hash
338
+ # For object, use to_hash. Otherwise, just return the value
339
+ # @param [Object] value Any valid value
340
+ # @return [Hash] Returns the value in the form of hash
341
+ def _to_hash(value)
342
+ if value.is_a?(Array)
343
+ value.compact.map { |v| _to_hash(v) }
344
+ elsif value.is_a?(Hash)
345
+ {}.tap do |hash|
346
+ value.each { |k, v| hash[k] = _to_hash(v) }
347
+ end
348
+ elsif value.respond_to? :to_hash
349
+ value.to_hash
350
+ else
351
+ value
352
+ end
353
+ end
354
+ end
355
+ end
@@ -0,0 +1,355 @@
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: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ # A Call generated by OutDial has connected and the callConnectUrl is being invoked. This request is made in the context of the Call leg that was generated using OutDial and not the parent (the OutDialStart webhook is invoked on the parent call to continue that call context). A PerCL response is expected if the call was successfully connected (as indicated by status of inProgress) and begins the execution context for this (child) call.
18
+ class OutDialConnectWebhook < Webhook
19
+ def self.deserialize(payload)
20
+ return nil if payload.nil? || payload.empty?
21
+ data = JSON.parse("[#{payload}]")[0]
22
+ inverted_attributes = self.attribute_map.invert
23
+ hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h
24
+ OutDialConnectWebhook.new(hash)
25
+ end
26
+ # Context or reason why this request is being made. Will be outDialConnect - A Call generated by OutDial has connected and the callConnectUrl is being invoked.
27
+ attr_accessor :request_type
28
+
29
+ # Account ID associated with your account.
30
+ attr_accessor :account_id
31
+
32
+ # Unique identifier for this Call, generated by FreeClimb
33
+ attr_accessor :call_id
34
+
35
+ # Phone number of the party that initiated the Call (in E.164 format).
36
+ attr_accessor :from
37
+
38
+ # Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format).
39
+ attr_accessor :to
40
+
41
+ attr_accessor :call_status
42
+
43
+ attr_accessor :direction
44
+
45
+ # This is only populated if request pertains to a conference. Otherwise, it is set to null.
46
+ attr_accessor :conference_id
47
+
48
+ # This is only populated if the request pertains to a queue. Otherwise, it is set to null.
49
+ attr_accessor :queue_id
50
+
51
+ # ID of the Call that created this leg (child call).
52
+ attr_accessor :parent_call_id
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'request_type' => :'requestType',
80
+ :'account_id' => :'accountId',
81
+ :'call_id' => :'callId',
82
+ :'from' => :'from',
83
+ :'to' => :'to',
84
+ :'call_status' => :'callStatus',
85
+ :'direction' => :'direction',
86
+ :'conference_id' => :'conferenceId',
87
+ :'queue_id' => :'queueId',
88
+ :'parent_call_id' => :'parentCallId'
89
+ }
90
+ end
91
+
92
+ # Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
93
+ def self.acceptable_attributes
94
+ attribute_map.values.concat(superclass.acceptable_attributes)
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.openapi_types
99
+ {
100
+ :'request_type' => :'String',
101
+ :'account_id' => :'String',
102
+ :'call_id' => :'String',
103
+ :'from' => :'String',
104
+ :'to' => :'String',
105
+ :'call_status' => :'CallStatus',
106
+ :'direction' => :'CallDirection',
107
+ :'conference_id' => :'String',
108
+ :'queue_id' => :'String',
109
+ :'parent_call_id' => :'String'
110
+ }
111
+ end
112
+
113
+ # List of attributes with nullable: true
114
+ def self.openapi_nullable
115
+ Set.new([
116
+ :'call_status',
117
+ :'direction',
118
+ :'conference_id',
119
+ :'queue_id',
120
+ ])
121
+ end
122
+
123
+ # List of class defined in allOf (OpenAPI v3)
124
+ def self.openapi_all_of
125
+ [
126
+ :'Webhook'
127
+ ]
128
+ end
129
+
130
+ # Initializes the object
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ def initialize(attributes = {})
133
+ if (!attributes.is_a?(Hash))
134
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialConnectWebhook` initialize method"
135
+ end
136
+
137
+ # check to see if the attribute exists and convert string to symbol for hash key
138
+ attributes = attributes.each_with_object({}) { |(k, v), h|
139
+ if (!self.class.attribute_map.key?(k.to_sym))
140
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialConnectWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
141
+ end
142
+ h[k.to_sym] = v
143
+ }
144
+
145
+ # call parent's initialize
146
+ super(attributes)
147
+
148
+ if attributes.key?(:'request_type')
149
+ self.request_type = attributes[:'request_type']
150
+ end
151
+
152
+ if attributes.key?(:'account_id')
153
+ self.account_id = attributes[:'account_id']
154
+ end
155
+
156
+ if attributes.key?(:'call_id')
157
+ self.call_id = attributes[:'call_id']
158
+ end
159
+
160
+ if attributes.key?(:'from')
161
+ self.from = attributes[:'from']
162
+ end
163
+
164
+ if attributes.key?(:'to')
165
+ self.to = attributes[:'to']
166
+ end
167
+
168
+ if attributes.key?(:'call_status')
169
+ self.call_status = attributes[:'call_status']
170
+ end
171
+
172
+ if attributes.key?(:'direction')
173
+ self.direction = attributes[:'direction']
174
+ end
175
+
176
+ if attributes.key?(:'conference_id')
177
+ self.conference_id = attributes[:'conference_id']
178
+ end
179
+
180
+ if attributes.key?(:'queue_id')
181
+ self.queue_id = attributes[:'queue_id']
182
+ end
183
+
184
+ if attributes.key?(:'parent_call_id')
185
+ self.parent_call_id = attributes[:'parent_call_id']
186
+ end
187
+ end
188
+
189
+ # Show invalid properties with the reasons. Usually used together with valid?
190
+ # @return Array for valid properties with the reasons
191
+ def list_invalid_properties
192
+ invalid_properties = super
193
+ invalid_properties
194
+ end
195
+
196
+ # Check to see if the all the properties in the model are valid
197
+ # @return true if the model is valid
198
+ def valid?
199
+
200
+ if @request_type.nil?
201
+ false
202
+ else
203
+ list_invalid_properties.length() == 0
204
+ end
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(o)
210
+ return true if self.equal?(o)
211
+ self.class == o.class &&
212
+ request_type == o.request_type &&
213
+ account_id == o.account_id &&
214
+ call_id == o.call_id &&
215
+ from == o.from &&
216
+ to == o.to &&
217
+ call_status == o.call_status &&
218
+ direction == o.direction &&
219
+ conference_id == o.conference_id &&
220
+ queue_id == o.queue_id &&
221
+ parent_call_id == o.parent_call_id && super(o)
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] Object to be compared
226
+ def eql?(o)
227
+ self == o
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Integer] Hash code
232
+ def hash
233
+ [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, parent_call_id].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def self.build_from_hash(attributes)
240
+ new.build_from_hash(attributes)
241
+ end
242
+
243
+ # Builds the object from hash
244
+ # @param [Hash] attributes Model attributes in the form of hash
245
+ # @return [Object] Returns the model itself
246
+ def build_from_hash(attributes)
247
+ return nil unless attributes.is_a?(Hash)
248
+ super(attributes)
249
+ self.class.openapi_types.each_pair do |key, type|
250
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
251
+ self.send("#{key}=", nil)
252
+ elsif type =~ /\AArray<(.*)>/i
253
+ # check to ensure the input is an array given that the attribute
254
+ # is documented as an array but the input is not
255
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
256
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
257
+ end
258
+ elsif !attributes[self.class.attribute_map[key]].nil?
259
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
260
+ end
261
+ end
262
+
263
+ self
264
+ end
265
+
266
+ # Deserializes the data based on type
267
+ # @param string type Data type
268
+ # @param string value Value to be deserialized
269
+ # @return [Object] Deserialized data
270
+ def _deserialize(type, value)
271
+ case type.to_sym
272
+ when :Time
273
+ Time.parse(value)
274
+ when :Date
275
+ Date.parse(value)
276
+ when :String
277
+ value.to_s
278
+ when :Integer
279
+ value.to_i
280
+ when :Float
281
+ value.to_f
282
+ when :Boolean
283
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
284
+ true
285
+ else
286
+ false
287
+ end
288
+ when :Object
289
+ # generic object (usually a Hash), return directly
290
+ value
291
+ when /\AArray<(?<inner_type>.+)>\z/
292
+ inner_type = Regexp.last_match[:inner_type]
293
+ value.map { |v| _deserialize(inner_type, v) }
294
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
295
+ k_type = Regexp.last_match[:k_type]
296
+ v_type = Regexp.last_match[:v_type]
297
+ {}.tap do |hash|
298
+ value.each do |k, v|
299
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
300
+ end
301
+ end
302
+ else # model
303
+ # models (e.g. Pet) or oneOf
304
+ klass = Freeclimb.const_get(type)
305
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
306
+ end
307
+ end
308
+
309
+ # Returns the string representation of the object
310
+ # @return [String] String presentation of the object
311
+ def to_s
312
+ to_hash.to_s
313
+ end
314
+
315
+ # to_body is an alias to to_hash (backward compatibility)
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_body
318
+ to_hash
319
+ end
320
+
321
+ # Returns the object in the form of hash
322
+ # @return [Hash] Returns the object in the form of hash
323
+ def to_hash
324
+ hash = super
325
+ self.class.attribute_map.each_pair do |attr, param|
326
+ value = self.send(attr)
327
+ if value.nil?
328
+ is_nullable = self.class.openapi_nullable.include?(attr)
329
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
330
+ end
331
+
332
+ hash[param] = _to_hash(value)
333
+ end
334
+ hash
335
+ end
336
+
337
+ # Outputs non-array value in the form of hash
338
+ # For object, use to_hash. Otherwise, just return the value
339
+ # @param [Object] value Any valid value
340
+ # @return [Hash] Returns the value in the form of hash
341
+ def _to_hash(value)
342
+ if value.is_a?(Array)
343
+ value.compact.map { |v| _to_hash(v) }
344
+ elsif value.is_a?(Hash)
345
+ {}.tap do |hash|
346
+ value.each { |k, v| hash[k] = _to_hash(v) }
347
+ end
348
+ elsif value.respond_to? :to_hash
349
+ value.to_hash
350
+ else
351
+ value
352
+ end
353
+ end
354
+ end
355
+ end