twilio-api-sdk 1.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 (278) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +213 -0
  4. data/bin/console +15 -0
  5. data/lib/twilio_ap_is/api_helper.rb +10 -0
  6. data/lib/twilio_ap_is/apis/accounts_v1_auth_token_promotion_api.rb +27 -0
  7. data/lib/twilio_ap_is/apis/accounts_v1_aws_api.rb +137 -0
  8. data/lib/twilio_ap_is/apis/accounts_v1_bulk_consents_api.rb +41 -0
  9. data/lib/twilio_ap_is/apis/accounts_v1_bulk_contacts_api.rb +36 -0
  10. data/lib/twilio_ap_is/apis/accounts_v1_messaging_geopermissions_api.rb +54 -0
  11. data/lib/twilio_ap_is/apis/accounts_v1_public_key_api.rb +136 -0
  12. data/lib/twilio_ap_is/apis/accounts_v1_safelist_api.rb +69 -0
  13. data/lib/twilio_ap_is/apis/accounts_v1_secondary_auth_token_api.rb +39 -0
  14. data/lib/twilio_ap_is/apis/base_api.rb +67 -0
  15. data/lib/twilio_ap_is/apis/chat_v3_channel_api.rb +51 -0
  16. data/lib/twilio_ap_is/apis/conversations_v1_address_configuration_api.rb +218 -0
  17. data/lib/twilio_ap_is/apis/conversations_v1_binding_api.rb +116 -0
  18. data/lib/twilio_ap_is/apis/conversations_v1_configuration_api.rb +133 -0
  19. data/lib/twilio_ap_is/apis/conversations_v1_conversation_api.rb +550 -0
  20. data/lib/twilio_ap_is/apis/conversations_v1_conversation_with_participants_api.rb +182 -0
  21. data/lib/twilio_ap_is/apis/conversations_v1_credential_api.rb +189 -0
  22. data/lib/twilio_ap_is/apis/conversations_v1_delivery_receipt_api.rb +183 -0
  23. data/lib/twilio_ap_is/apis/conversations_v1_message_api.rb +497 -0
  24. data/lib/twilio_ap_is/apis/conversations_v1_notification_api.rb +124 -0
  25. data/lib/twilio_ap_is/apis/conversations_v1_participant_api.rb +546 -0
  26. data/lib/twilio_ap_is/apis/conversations_v1_participant_conversation_api.rb +99 -0
  27. data/lib/twilio_ap_is/apis/conversations_v1_role_api.rb +325 -0
  28. data/lib/twilio_ap_is/apis/conversations_v1_service_api.rb +98 -0
  29. data/lib/twilio_ap_is/apis/conversations_v1_user_api.rb +364 -0
  30. data/lib/twilio_ap_is/apis/conversations_v1_user_conversation_api.rb +335 -0
  31. data/lib/twilio_ap_is/apis/conversations_v1_webhook_api.rb +561 -0
  32. data/lib/twilio_ap_is/apis/notify_v1_binding_api.rb +186 -0
  33. data/lib/twilio_ap_is/apis/notify_v1_credential_api.rb +183 -0
  34. data/lib/twilio_ap_is/apis/notify_v1_notification_api.rb +174 -0
  35. data/lib/twilio_ap_is/apis/notify_v1_service_api.rb +262 -0
  36. data/lib/twilio_ap_is/apis/taskrouter_v1_activity_api.rb +177 -0
  37. data/lib/twilio_ap_is/apis/taskrouter_v1_event_api.rb +125 -0
  38. data/lib/twilio_ap_is/apis/taskrouter_v1_task_api.rb +310 -0
  39. data/lib/twilio_ap_is/apis/taskrouter_v1_task_channel_api.rb +173 -0
  40. data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_api.rb +232 -0
  41. data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_bulk_real_time_statistics_api.rb +36 -0
  42. data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_cumulative_statistics_api.rb +63 -0
  43. data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_real_time_statistics_api.rb +41 -0
  44. data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_statistics_api.rb +63 -0
  45. data/lib/twilio_ap_is/apis/taskrouter_v1_task_queues_statistics_api.rb +72 -0
  46. data/lib/twilio_ap_is/apis/taskrouter_v1_task_reservation_api.rb +396 -0
  47. data/lib/twilio_ap_is/apis/taskrouter_v1_worker_api.rb +232 -0
  48. data/lib/twilio_ap_is/apis/taskrouter_v1_worker_channel_api.rb +126 -0
  49. data/lib/twilio_ap_is/apis/taskrouter_v1_worker_reservation_api.rb +385 -0
  50. data/lib/twilio_ap_is/apis/taskrouter_v1_worker_statistics_api.rb +57 -0
  51. data/lib/twilio_ap_is/apis/taskrouter_v1_workers_cumulative_statistics_api.rb +51 -0
  52. data/lib/twilio_ap_is/apis/taskrouter_v1_workers_real_time_statistics_api.rb +35 -0
  53. data/lib/twilio_ap_is/apis/taskrouter_v1_workers_statistics_api.rb +63 -0
  54. data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_api.rb +213 -0
  55. data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_cumulative_statistics_api.rb +68 -0
  56. data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_real_time_statistics_api.rb +41 -0
  57. data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_statistics_api.rb +67 -0
  58. data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_api.rb +225 -0
  59. data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_cumulative_statistics_api.rb +62 -0
  60. data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_real_time_statistics_api.rb +35 -0
  61. data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_statistics_api.rb +61 -0
  62. data/lib/twilio_ap_is/apis/verify_v2_service_api.rb +178 -0
  63. data/lib/twilio_ap_is/apis/verify_v2_verification_api.rb +143 -0
  64. data/lib/twilio_ap_is/apis/verify_v2_verification_check_api.rb +61 -0
  65. data/lib/twilio_ap_is/client.rb +417 -0
  66. data/lib/twilio_ap_is/configuration.rb +187 -0
  67. data/lib/twilio_ap_is/exceptions/api_exception.rb +21 -0
  68. data/lib/twilio_ap_is/exceptions/v2_services_verifications429_error_exception.rb +63 -0
  69. data/lib/twilio_ap_is/http/api_response.rb +19 -0
  70. data/lib/twilio_ap_is/http/auth/basic_auth.rb +62 -0
  71. data/lib/twilio_ap_is/http/http_call_back.rb +10 -0
  72. data/lib/twilio_ap_is/http/http_method_enum.rb +10 -0
  73. data/lib/twilio_ap_is/http/http_request.rb +10 -0
  74. data/lib/twilio_ap_is/http/http_response.rb +10 -0
  75. data/lib/twilio_ap_is/http/proxy_settings.rb +22 -0
  76. data/lib/twilio_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
  77. data/lib/twilio_ap_is/logging/sdk_logger.rb +17 -0
  78. data/lib/twilio_ap_is/models/access_token.rb +188 -0
  79. data/lib/twilio_ap_is/models/access_token_enum_factor_types.rb +26 -0
  80. data/lib/twilio_ap_is/models/activity.rb +189 -0
  81. data/lib/twilio_ap_is/models/auth_token_promotion.rb +142 -0
  82. data/lib/twilio_ap_is/models/base_model.rb +110 -0
  83. data/lib/twilio_ap_is/models/binding.rb +269 -0
  84. data/lib/twilio_ap_is/models/binding_binding_type.rb +53 -0
  85. data/lib/twilio_ap_is/models/bucket.rb +186 -0
  86. data/lib/twilio_ap_is/models/bulk_consents.rb +83 -0
  87. data/lib/twilio_ap_is/models/bulk_contacts.rb +83 -0
  88. data/lib/twilio_ap_is/models/challenge.rb +317 -0
  89. data/lib/twilio_ap_is/models/challenge_enum_challenge_reasons.rb +41 -0
  90. data/lib/twilio_ap_is/models/challenge_enum_challenge_statuses.rb +45 -0
  91. data/lib/twilio_ap_is/models/challenge_enum_factor_types.rb +41 -0
  92. data/lib/twilio_ap_is/models/channel.rb +249 -0
  93. data/lib/twilio_ap_is/models/channel_channel_type.rb +36 -0
  94. data/lib/twilio_ap_is/models/channel_webhook_enabled_type.rb +36 -0
  95. data/lib/twilio_ap_is/models/configuration.rb +164 -0
  96. data/lib/twilio_ap_is/models/configuration_address.rb +199 -0
  97. data/lib/twilio_ap_is/models/configuration_address_auto_creation_type.rb +40 -0
  98. data/lib/twilio_ap_is/models/configuration_address_method.rb +36 -0
  99. data/lib/twilio_ap_is/models/configuration_address_type.rb +60 -0
  100. data/lib/twilio_ap_is/models/configuration_webhook.rb +154 -0
  101. data/lib/twilio_ap_is/models/configuration_webhook_method.rb +46 -0
  102. data/lib/twilio_ap_is/models/configuration_webhook_target.rb +37 -0
  103. data/lib/twilio_ap_is/models/conversation.rb +264 -0
  104. data/lib/twilio_ap_is/models/conversation_message.rb +268 -0
  105. data/lib/twilio_ap_is/models/conversation_message_order_type.rb +36 -0
  106. data/lib/twilio_ap_is/models/conversation_message_receipt.rb +219 -0
  107. data/lib/twilio_ap_is/models/conversation_message_receipt_delivery_status.rb +49 -0
  108. data/lib/twilio_ap_is/models/conversation_participant.rb +240 -0
  109. data/lib/twilio_ap_is/models/conversation_scoped_webhook.rb +178 -0
  110. data/lib/twilio_ap_is/models/conversation_scoped_webhook_method.rb +36 -0
  111. data/lib/twilio_ap_is/models/conversation_scoped_webhook_target.rb +40 -0
  112. data/lib/twilio_ap_is/models/conversation_state.rb +45 -0
  113. data/lib/twilio_ap_is/models/conversation_webhook_method.rb +36 -0
  114. data/lib/twilio_ap_is/models/conversation_webhook_target.rb +37 -0
  115. data/lib/twilio_ap_is/models/conversation_with_participants.rb +264 -0
  116. data/lib/twilio_ap_is/models/conversation_with_participants_state.rb +45 -0
  117. data/lib/twilio_ap_is/models/credential.rb +175 -0
  118. data/lib/twilio_ap_is/models/credential1.rb +174 -0
  119. data/lib/twilio_ap_is/models/credential_aws.rb +153 -0
  120. data/lib/twilio_ap_is/models/credential_public_key.rb +153 -0
  121. data/lib/twilio_ap_is/models/credential_push_type.rb +41 -0
  122. data/lib/twilio_ap_is/models/entity.rb +177 -0
  123. data/lib/twilio_ap_is/models/event.rb +270 -0
  124. data/lib/twilio_ap_is/models/factor.rb +235 -0
  125. data/lib/twilio_ap_is/models/factor_enum_factor_statuses.rb +36 -0
  126. data/lib/twilio_ap_is/models/factor_enum_factor_type.rb +40 -0
  127. data/lib/twilio_ap_is/models/factor_enum_notification_platforms.rb +40 -0
  128. data/lib/twilio_ap_is/models/factor_enum_totp_algorithms.rb +40 -0
  129. data/lib/twilio_ap_is/models/form_enum_form_types.rb +26 -0
  130. data/lib/twilio_ap_is/models/list_activity_response.rb +94 -0
  131. data/lib/twilio_ap_is/models/list_binding_response.rb +94 -0
  132. data/lib/twilio_ap_is/models/list_configuration_address_response.rb +95 -0
  133. data/lib/twilio_ap_is/models/list_conversation_message_receipt_response.rb +95 -0
  134. data/lib/twilio_ap_is/models/list_conversation_message_response.rb +94 -0
  135. data/lib/twilio_ap_is/models/list_conversation_participant_response.rb +94 -0
  136. data/lib/twilio_ap_is/models/list_conversation_response.rb +94 -0
  137. data/lib/twilio_ap_is/models/list_conversation_scoped_webhook_response.rb +94 -0
  138. data/lib/twilio_ap_is/models/list_credential_aws_response.rb +94 -0
  139. data/lib/twilio_ap_is/models/list_credential_public_key_response.rb +94 -0
  140. data/lib/twilio_ap_is/models/list_credential_response.rb +94 -0
  141. data/lib/twilio_ap_is/models/list_event_response.rb +94 -0
  142. data/lib/twilio_ap_is/models/list_participant_conversation_response.rb +94 -0
  143. data/lib/twilio_ap_is/models/list_role_response.rb +94 -0
  144. data/lib/twilio_ap_is/models/list_service_binding_response.rb +94 -0
  145. data/lib/twilio_ap_is/models/list_service_conversation_message_receipt_response.rb +95 -0
  146. data/lib/twilio_ap_is/models/list_service_conversation_message_response.rb +94 -0
  147. data/lib/twilio_ap_is/models/list_service_conversation_participant_response.rb +94 -0
  148. data/lib/twilio_ap_is/models/list_service_conversation_response.rb +94 -0
  149. data/lib/twilio_ap_is/models/list_service_conversation_scoped_webhook_response.rb +94 -0
  150. data/lib/twilio_ap_is/models/list_service_participant_conversation_response.rb +94 -0
  151. data/lib/twilio_ap_is/models/list_service_response.rb +94 -0
  152. data/lib/twilio_ap_is/models/list_service_role_response.rb +94 -0
  153. data/lib/twilio_ap_is/models/list_service_user_conversation_response.rb +94 -0
  154. data/lib/twilio_ap_is/models/list_service_user_response.rb +94 -0
  155. data/lib/twilio_ap_is/models/list_task_channel_response.rb +94 -0
  156. data/lib/twilio_ap_is/models/list_task_queue_response.rb +94 -0
  157. data/lib/twilio_ap_is/models/list_task_queues_statistics_response.rb +95 -0
  158. data/lib/twilio_ap_is/models/list_task_reservation_response.rb +94 -0
  159. data/lib/twilio_ap_is/models/list_task_response.rb +94 -0
  160. data/lib/twilio_ap_is/models/list_user_conversation_response.rb +94 -0
  161. data/lib/twilio_ap_is/models/list_user_response.rb +94 -0
  162. data/lib/twilio_ap_is/models/list_worker_channel_response.rb +94 -0
  163. data/lib/twilio_ap_is/models/list_worker_reservation_response.rb +94 -0
  164. data/lib/twilio_ap_is/models/list_worker_response.rb +94 -0
  165. data/lib/twilio_ap_is/models/list_workflow_response.rb +94 -0
  166. data/lib/twilio_ap_is/models/list_workspace_response.rb +94 -0
  167. data/lib/twilio_ap_is/models/messaging_configuration.rb +170 -0
  168. data/lib/twilio_ap_is/models/meta.rb +140 -0
  169. data/lib/twilio_ap_is/models/msg_geopermissions.rb +86 -0
  170. data/lib/twilio_ap_is/models/new_factor.rb +277 -0
  171. data/lib/twilio_ap_is/models/new_factor_enum_factor_statuses.rb +36 -0
  172. data/lib/twilio_ap_is/models/new_factor_enum_factor_types.rb +40 -0
  173. data/lib/twilio_ap_is/models/new_factor_enum_notification_platforms.rb +40 -0
  174. data/lib/twilio_ap_is/models/new_factor_enum_totp_algorithms.rb +40 -0
  175. data/lib/twilio_ap_is/models/notif_priority.rb +43 -0
  176. data/lib/twilio_ap_is/models/notification.rb +363 -0
  177. data/lib/twilio_ap_is/models/notification1.rb +181 -0
  178. data/lib/twilio_ap_is/models/participant_conversation.rb +325 -0
  179. data/lib/twilio_ap_is/models/participant_conversation_state.rb +41 -0
  180. data/lib/twilio_ap_is/models/rate_limit.rb +189 -0
  181. data/lib/twilio_ap_is/models/role.rb +192 -0
  182. data/lib/twilio_ap_is/models/role_role_type.rb +40 -0
  183. data/lib/twilio_ap_is/models/safelist.rb +88 -0
  184. data/lib/twilio_ap_is/models/safelist1.rb +99 -0
  185. data/lib/twilio_ap_is/models/secondary_auth_token.rb +145 -0
  186. data/lib/twilio_ap_is/models/service.rb +164 -0
  187. data/lib/twilio_ap_is/models/service1.rb +380 -0
  188. data/lib/twilio_ap_is/models/service2.rb +350 -0
  189. data/lib/twilio_ap_is/models/service_binding.rb +226 -0
  190. data/lib/twilio_ap_is/models/service_binding_binding_type.rb +47 -0
  191. data/lib/twilio_ap_is/models/service_configuration.rb +180 -0
  192. data/lib/twilio_ap_is/models/service_conversation.rb +264 -0
  193. data/lib/twilio_ap_is/models/service_conversation_message.rb +282 -0
  194. data/lib/twilio_ap_is/models/service_conversation_message_order_type.rb +36 -0
  195. data/lib/twilio_ap_is/models/service_conversation_message_receipt.rb +233 -0
  196. data/lib/twilio_ap_is/models/service_conversation_message_receipt_delivery_status.rb +49 -0
  197. data/lib/twilio_ap_is/models/service_conversation_participant.rb +256 -0
  198. data/lib/twilio_ap_is/models/service_conversation_scoped_webhook.rb +191 -0
  199. data/lib/twilio_ap_is/models/service_conversation_scoped_webhook_method.rb +36 -0
  200. data/lib/twilio_ap_is/models/service_conversation_scoped_webhook_target.rb +40 -0
  201. data/lib/twilio_ap_is/models/service_conversation_state.rb +45 -0
  202. data/lib/twilio_ap_is/models/service_conversation_with_participants.rb +264 -0
  203. data/lib/twilio_ap_is/models/service_conversation_with_participants_state.rb +45 -0
  204. data/lib/twilio_ap_is/models/service_notification.rb +155 -0
  205. data/lib/twilio_ap_is/models/service_participant_conversation.rb +325 -0
  206. data/lib/twilio_ap_is/models/service_participant_conversation_state.rb +41 -0
  207. data/lib/twilio_ap_is/models/service_role.rb +192 -0
  208. data/lib/twilio_ap_is/models/service_role_role_type.rb +40 -0
  209. data/lib/twilio_ap_is/models/service_stats_conversations_rate_limiting_errors_source.rb +36 -0
  210. data/lib/twilio_ap_is/models/service_user.rb +250 -0
  211. data/lib/twilio_ap_is/models/service_user_conversation.rb +317 -0
  212. data/lib/twilio_ap_is/models/service_user_conversation_notification_level.rb +37 -0
  213. data/lib/twilio_ap_is/models/service_user_conversation_state.rb +41 -0
  214. data/lib/twilio_ap_is/models/service_webhook_configuration.rb +160 -0
  215. data/lib/twilio_ap_is/models/service_webhook_configuration_method.rb +37 -0
  216. data/lib/twilio_ap_is/models/stats_twilsock_rate_limiting_errors_source.rb +26 -0
  217. data/lib/twilio_ap_is/models/task_channel.rb +204 -0
  218. data/lib/twilio_ap_is/models/task_queue.rb +278 -0
  219. data/lib/twilio_ap_is/models/task_queue_bulk_real_time_statistics.rb +141 -0
  220. data/lib/twilio_ap_is/models/task_queue_cumulative.rb +356 -0
  221. data/lib/twilio_ap_is/models/task_queue_real_time_statistics.rb +250 -0
  222. data/lib/twilio_ap_is/models/task_queue_statistics.rb +135 -0
  223. data/lib/twilio_ap_is/models/task_queue_task_order.rb +40 -0
  224. data/lib/twilio_ap_is/models/task_queues_stats.rb +124 -0
  225. data/lib/twilio_ap_is/models/task_reservation.rb +210 -0
  226. data/lib/twilio_ap_is/models/task_reservation_call_status.rb +44 -0
  227. data/lib/twilio_ap_is/models/task_reservation_conference_event.rb +56 -0
  228. data/lib/twilio_ap_is/models/task_reservation_status.rb +61 -0
  229. data/lib/twilio_ap_is/models/task_reservation_supervisor_mode.rb +40 -0
  230. data/lib/twilio_ap_is/models/task_router_task.rb +394 -0
  231. data/lib/twilio_ap_is/models/task_status.rb +53 -0
  232. data/lib/twilio_ap_is/models/user.rb +250 -0
  233. data/lib/twilio_ap_is/models/user_binding_binding_type.rb +52 -0
  234. data/lib/twilio_ap_is/models/user_conversation.rb +317 -0
  235. data/lib/twilio_ap_is/models/user_conversation_notification_level.rb +37 -0
  236. data/lib/twilio_ap_is/models/user_conversation_state.rb +41 -0
  237. data/lib/twilio_ap_is/models/v2_form.rb +112 -0
  238. data/lib/twilio_ap_is/models/verification.rb +262 -0
  239. data/lib/twilio_ap_is/models/verification_attempt.rb +219 -0
  240. data/lib/twilio_ap_is/models/verification_attempt_enum_attempt_status.rb +40 -0
  241. data/lib/twilio_ap_is/models/verification_attempt_enum_call_status.rb +60 -0
  242. data/lib/twilio_ap_is/models/verification_attempt_enum_channels.rb +49 -0
  243. data/lib/twilio_ap_is/models/verification_attempt_enum_conversion_status.rb +38 -0
  244. data/lib/twilio_ap_is/models/verification_attempt_enum_message_status.rb +80 -0
  245. data/lib/twilio_ap_is/models/verification_attempts.rb +129 -0
  246. data/lib/twilio_ap_is/models/verification_attempts_summary_enum_channels.rb +48 -0
  247. data/lib/twilio_ap_is/models/verification_check.rb +231 -0
  248. data/lib/twilio_ap_is/models/verification_check_enum_channel.rb +50 -0
  249. data/lib/twilio_ap_is/models/verification_enum_channel.rb +50 -0
  250. data/lib/twilio_ap_is/models/verification_enum_risk_check.rb +39 -0
  251. data/lib/twilio_ap_is/models/verification_enum_status.rb +37 -0
  252. data/lib/twilio_ap_is/models/verification_template.rb +126 -0
  253. data/lib/twilio_ap_is/models/webhook.rb +222 -0
  254. data/lib/twilio_ap_is/models/webhook_enum_status.rb +37 -0
  255. data/lib/twilio_ap_is/models/webhook_enum_version.rb +37 -0
  256. data/lib/twilio_ap_is/models/worker.rb +247 -0
  257. data/lib/twilio_ap_is/models/worker_channel.rb +244 -0
  258. data/lib/twilio_ap_is/models/worker_instance_statistics.rb +122 -0
  259. data/lib/twilio_ap_is/models/worker_reservation.rb +210 -0
  260. data/lib/twilio_ap_is/models/worker_reservation_call_status.rb +44 -0
  261. data/lib/twilio_ap_is/models/worker_reservation_conference_event.rb +56 -0
  262. data/lib/twilio_ap_is/models/worker_reservation_status.rb +61 -0
  263. data/lib/twilio_ap_is/models/worker_statistics.rb +122 -0
  264. data/lib/twilio_ap_is/models/workers_cumulative_statistics.rb +221 -0
  265. data/lib/twilio_ap_is/models/workers_real_time_statistics.rb +124 -0
  266. data/lib/twilio_ap_is/models/workflow.rb +247 -0
  267. data/lib/twilio_ap_is/models/workflow_cumulative_statistics.rb +347 -0
  268. data/lib/twilio_ap_is/models/workflow_real_time_statistics.rb +173 -0
  269. data/lib/twilio_ap_is/models/workflow_statistics.rb +135 -0
  270. data/lib/twilio_ap_is/models/workspace.rb +285 -0
  271. data/lib/twilio_ap_is/models/workspace_cumulative_statistics.rb +334 -0
  272. data/lib/twilio_ap_is/models/workspace_queue_order.rb +40 -0
  273. data/lib/twilio_ap_is/models/workspace_real_time_statistics.rb +185 -0
  274. data/lib/twilio_ap_is/models/workspace_statistics.rb +122 -0
  275. data/lib/twilio_ap_is/utilities/date_time_helper.rb +11 -0
  276. data/lib/twilio_ap_is/utilities/file_wrapper.rb +28 -0
  277. data/lib/twilio_ap_is.rb +326 -0
  278. metadata +361 -0
@@ -0,0 +1,317 @@
1
+ # twilio_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module TwilioApIs
8
+ # Challenge Model.
9
+ class Challenge < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # A 34 character string that uniquely identifies this Challenge.
14
+ # @return [String]
15
+ attr_accessor :sid
16
+
17
+ # The unique SID identifier of the Account.
18
+ # @return [String]
19
+ attr_accessor :account_sid
20
+
21
+ # The unique SID identifier of the Service.
22
+ # @return [String]
23
+ attr_accessor :service_sid
24
+
25
+ # The unique SID identifier of the Entity.
26
+ # @return [String]
27
+ attr_accessor :entity_sid
28
+
29
+ # Customer unique identity for the Entity owner of the Challenge. This
30
+ # identifier should be immutable, not PII, length between 8 and 64
31
+ # characters, and generated by your external system, such as your user's
32
+ # UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric
33
+ # characters.
34
+ # @return [String]
35
+ attr_accessor :identity
36
+
37
+ # The unique SID identifier of the Factor.
38
+ # @return [String]
39
+ attr_accessor :factor_sid
40
+
41
+ # The date that this Challenge was created, given in [ISO
42
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
43
+ # @return [DateTime]
44
+ attr_accessor :date_created
45
+
46
+ # The date that this Challenge was updated, given in [ISO
47
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
48
+ # @return [DateTime]
49
+ attr_accessor :date_updated
50
+
51
+ # The date that this Challenge was responded, given in [ISO
52
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
53
+ # @return [DateTime]
54
+ attr_accessor :date_responded
55
+
56
+ # The date-time when this Challenge expires, given in [ISO
57
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is
58
+ # five (5) minutes after Challenge creation. The max value is sixty (60)
59
+ # minutes after creation.
60
+ # @return [DateTime]
61
+ attr_accessor :expiration_date
62
+
63
+ # The Status of this Challenge. One of `pending`, `expired`, `approved` or
64
+ # `denied`.
65
+ # @return [ChallengeEnumChallengeStatuses]
66
+ attr_accessor :status
67
+
68
+ # Reason for the Challenge to be in certain `status`. One of `none`,
69
+ # `not_needed` or `not_requested`.
70
+ # @return [ChallengeEnumChallengeReasons]
71
+ attr_accessor :responded_reason
72
+
73
+ # Details provided to give context about the Challenge. Intended to be shown
74
+ # to the end user.
75
+ # @return [Object]
76
+ attr_accessor :details
77
+
78
+ # Details provided to give context about the Challenge. Intended to be
79
+ # hidden from the end user. It must be a stringified JSON with only strings
80
+ # values eg. `{"ip": "172.168.1.234"}`
81
+ # @return [Object]
82
+ attr_accessor :hidden_details
83
+
84
+ # Custom metadata associated with the challenge. This is added by the
85
+ # Device/SDK directly to allow for the inclusion of device information. It
86
+ # must be a stringified JSON with only strings values eg. `{"os":
87
+ # "Android"}`. Can be up to 1024 characters in length.
88
+ # @return [Object]
89
+ attr_accessor :metadata
90
+
91
+ # The Factor Type of this Challenge. Currently `push` and `totp` are
92
+ # supported.
93
+ # @return [ChallengeEnumFactorTypes]
94
+ attr_accessor :factor_type
95
+
96
+ # The URL of this resource.
97
+ # @return [String]
98
+ attr_accessor :url
99
+
100
+ # Contains a dictionary of URL links to nested resources of this Challenge.
101
+ # @return [Object]
102
+ attr_accessor :links
103
+
104
+ # A mapping from model property names to API property names.
105
+ def self.names
106
+ @_hash = {} if @_hash.nil?
107
+ @_hash['sid'] = 'sid'
108
+ @_hash['account_sid'] = 'account_sid'
109
+ @_hash['service_sid'] = 'service_sid'
110
+ @_hash['entity_sid'] = 'entity_sid'
111
+ @_hash['identity'] = 'identity'
112
+ @_hash['factor_sid'] = 'factor_sid'
113
+ @_hash['date_created'] = 'date_created'
114
+ @_hash['date_updated'] = 'date_updated'
115
+ @_hash['date_responded'] = 'date_responded'
116
+ @_hash['expiration_date'] = 'expiration_date'
117
+ @_hash['status'] = 'status'
118
+ @_hash['responded_reason'] = 'responded_reason'
119
+ @_hash['details'] = 'details'
120
+ @_hash['hidden_details'] = 'hidden_details'
121
+ @_hash['metadata'] = 'metadata'
122
+ @_hash['factor_type'] = 'factor_type'
123
+ @_hash['url'] = 'url'
124
+ @_hash['links'] = 'links'
125
+ @_hash
126
+ end
127
+
128
+ # An array for optional fields
129
+ def self.optionals
130
+ %w[
131
+ sid
132
+ account_sid
133
+ service_sid
134
+ entity_sid
135
+ identity
136
+ factor_sid
137
+ date_created
138
+ date_updated
139
+ date_responded
140
+ expiration_date
141
+ status
142
+ responded_reason
143
+ details
144
+ hidden_details
145
+ metadata
146
+ factor_type
147
+ url
148
+ links
149
+ ]
150
+ end
151
+
152
+ # An array for nullable fields
153
+ def self.nullables
154
+ %w[
155
+ sid
156
+ account_sid
157
+ service_sid
158
+ entity_sid
159
+ identity
160
+ factor_sid
161
+ date_created
162
+ date_updated
163
+ date_responded
164
+ expiration_date
165
+ details
166
+ hidden_details
167
+ metadata
168
+ url
169
+ links
170
+ ]
171
+ end
172
+
173
+ def initialize(sid: SKIP, account_sid: SKIP, service_sid: SKIP,
174
+ entity_sid: SKIP, identity: SKIP, factor_sid: SKIP,
175
+ date_created: SKIP, date_updated: SKIP, date_responded: SKIP,
176
+ expiration_date: SKIP, status: SKIP, responded_reason: SKIP,
177
+ details: SKIP, hidden_details: SKIP, metadata: SKIP,
178
+ factor_type: SKIP, url: SKIP, links: SKIP,
179
+ additional_properties: nil)
180
+ # Add additional model properties to the instance
181
+ additional_properties = {} if additional_properties.nil?
182
+
183
+ @sid = sid unless sid == SKIP
184
+ @account_sid = account_sid unless account_sid == SKIP
185
+ @service_sid = service_sid unless service_sid == SKIP
186
+ @entity_sid = entity_sid unless entity_sid == SKIP
187
+ @identity = identity unless identity == SKIP
188
+ @factor_sid = factor_sid unless factor_sid == SKIP
189
+ @date_created = date_created unless date_created == SKIP
190
+ @date_updated = date_updated unless date_updated == SKIP
191
+ @date_responded = date_responded unless date_responded == SKIP
192
+ @expiration_date = expiration_date unless expiration_date == SKIP
193
+ @status = status unless status == SKIP
194
+ @responded_reason = responded_reason unless responded_reason == SKIP
195
+ @details = details unless details == SKIP
196
+ @hidden_details = hidden_details unless hidden_details == SKIP
197
+ @metadata = metadata unless metadata == SKIP
198
+ @factor_type = factor_type unless factor_type == SKIP
199
+ @url = url unless url == SKIP
200
+ @links = links unless links == SKIP
201
+ @additional_properties = additional_properties
202
+ end
203
+
204
+ # Creates an instance of the object from a hash.
205
+ def self.from_hash(hash)
206
+ return nil unless hash
207
+
208
+ # Extract variables from the hash.
209
+ sid = hash.key?('sid') ? hash['sid'] : SKIP
210
+ account_sid = hash.key?('account_sid') ? hash['account_sid'] : SKIP
211
+ service_sid = hash.key?('service_sid') ? hash['service_sid'] : SKIP
212
+ entity_sid = hash.key?('entity_sid') ? hash['entity_sid'] : SKIP
213
+ identity = hash.key?('identity') ? hash['identity'] : SKIP
214
+ factor_sid = hash.key?('factor_sid') ? hash['factor_sid'] : SKIP
215
+ date_created = if hash.key?('date_created')
216
+ (DateTimeHelper.from_rfc3339(hash['date_created']) if hash['date_created'])
217
+ else
218
+ SKIP
219
+ end
220
+ date_updated = if hash.key?('date_updated')
221
+ (DateTimeHelper.from_rfc3339(hash['date_updated']) if hash['date_updated'])
222
+ else
223
+ SKIP
224
+ end
225
+ date_responded = if hash.key?('date_responded')
226
+ (DateTimeHelper.from_rfc3339(hash['date_responded']) if hash['date_responded'])
227
+ else
228
+ SKIP
229
+ end
230
+ expiration_date = if hash.key?('expiration_date')
231
+ (DateTimeHelper.from_rfc3339(hash['expiration_date']) if hash['expiration_date'])
232
+ else
233
+ SKIP
234
+ end
235
+ status = hash.key?('status') ? hash['status'] : SKIP
236
+ responded_reason =
237
+ hash.key?('responded_reason') ? hash['responded_reason'] : SKIP
238
+ details = hash.key?('details') ? hash['details'] : SKIP
239
+ hidden_details =
240
+ hash.key?('hidden_details') ? hash['hidden_details'] : SKIP
241
+ metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
242
+ factor_type = hash.key?('factor_type') ? hash['factor_type'] : SKIP
243
+ url = hash.key?('url') ? hash['url'] : SKIP
244
+ links = hash.key?('links') ? hash['links'] : SKIP
245
+
246
+ # Create a new hash for additional properties, removing known properties.
247
+ new_hash = hash.reject { |k, _| names.value?(k) }
248
+
249
+ additional_properties = APIHelper.get_additional_properties(
250
+ new_hash, proc { |value| value }
251
+ )
252
+
253
+ # Create object from extracted values.
254
+ Challenge.new(sid: sid,
255
+ account_sid: account_sid,
256
+ service_sid: service_sid,
257
+ entity_sid: entity_sid,
258
+ identity: identity,
259
+ factor_sid: factor_sid,
260
+ date_created: date_created,
261
+ date_updated: date_updated,
262
+ date_responded: date_responded,
263
+ expiration_date: expiration_date,
264
+ status: status,
265
+ responded_reason: responded_reason,
266
+ details: details,
267
+ hidden_details: hidden_details,
268
+ metadata: metadata,
269
+ factor_type: factor_type,
270
+ url: url,
271
+ links: links,
272
+ additional_properties: additional_properties)
273
+ end
274
+
275
+ def to_custom_date_created
276
+ DateTimeHelper.to_rfc3339(date_created)
277
+ end
278
+
279
+ def to_custom_date_updated
280
+ DateTimeHelper.to_rfc3339(date_updated)
281
+ end
282
+
283
+ def to_custom_date_responded
284
+ DateTimeHelper.to_rfc3339(date_responded)
285
+ end
286
+
287
+ def to_custom_expiration_date
288
+ DateTimeHelper.to_rfc3339(expiration_date)
289
+ end
290
+
291
+ # Provides a human-readable string representation of the object.
292
+ def to_s
293
+ class_name = self.class.name.split('::').last
294
+ "<#{class_name} sid: #{@sid}, account_sid: #{@account_sid}, service_sid: #{@service_sid},"\
295
+ " entity_sid: #{@entity_sid}, identity: #{@identity}, factor_sid: #{@factor_sid},"\
296
+ " date_created: #{@date_created}, date_updated: #{@date_updated}, date_responded:"\
297
+ " #{@date_responded}, expiration_date: #{@expiration_date}, status: #{@status},"\
298
+ " responded_reason: #{@responded_reason}, details: #{@details}, hidden_details:"\
299
+ " #{@hidden_details}, metadata: #{@metadata}, factor_type: #{@factor_type}, url: #{@url},"\
300
+ " links: #{@links}, additional_properties: #{@additional_properties}>"
301
+ end
302
+
303
+ # Provides a debugging-friendly string with detailed object information.
304
+ def inspect
305
+ class_name = self.class.name.split('::').last
306
+ "<#{class_name} sid: #{@sid.inspect}, account_sid: #{@account_sid.inspect}, service_sid:"\
307
+ " #{@service_sid.inspect}, entity_sid: #{@entity_sid.inspect}, identity:"\
308
+ " #{@identity.inspect}, factor_sid: #{@factor_sid.inspect}, date_created:"\
309
+ " #{@date_created.inspect}, date_updated: #{@date_updated.inspect}, date_responded:"\
310
+ " #{@date_responded.inspect}, expiration_date: #{@expiration_date.inspect}, status:"\
311
+ " #{@status.inspect}, responded_reason: #{@responded_reason.inspect}, details:"\
312
+ " #{@details.inspect}, hidden_details: #{@hidden_details.inspect}, metadata:"\
313
+ " #{@metadata.inspect}, factor_type: #{@factor_type.inspect}, url: #{@url.inspect}, links:"\
314
+ " #{@links.inspect}, additional_properties: #{@additional_properties}>"
315
+ end
316
+ end
317
+ end
@@ -0,0 +1,41 @@
1
+ # twilio_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TwilioApIs
7
+ # Reason for the Challenge to be in certain `status`. One of `none`,
8
+ # `not_needed` or `not_requested`.
9
+ class ChallengeEnumChallengeReasons
10
+ CHALLENGE_ENUM_CHALLENGE_REASONS = [
11
+ # TODO: Write general description for NONE
12
+ NONE = 'none'.freeze,
13
+
14
+ # TODO: Write general description for NOT_NEEDED
15
+ NOT_NEEDED = 'not_needed'.freeze,
16
+
17
+ # TODO: Write general description for NOT_REQUESTED
18
+ NOT_REQUESTED = 'not_requested'.freeze
19
+ ].freeze
20
+
21
+ def self.validate(value)
22
+ return false if value.nil?
23
+
24
+ CHALLENGE_ENUM_CHALLENGE_REASONS.include?(value)
25
+ end
26
+
27
+ def self.from_value(value, default_value = NONE)
28
+ return default_value if value.nil?
29
+
30
+ str = value.to_s.strip
31
+
32
+ case str.downcase
33
+ when 'none' then NONE
34
+ when 'not_needed' then NOT_NEEDED
35
+ when 'not_requested' then NOT_REQUESTED
36
+ else
37
+ default_value
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,45 @@
1
+ # twilio_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TwilioApIs
7
+ # The Status of this Challenge. One of `pending`, `expired`, `approved` or
8
+ # `denied`.
9
+ class ChallengeEnumChallengeStatuses
10
+ CHALLENGE_ENUM_CHALLENGE_STATUSES = [
11
+ # TODO: Write general description for PENDING
12
+ PENDING = 'pending'.freeze,
13
+
14
+ # TODO: Write general description for EXPIRED
15
+ EXPIRED = 'expired'.freeze,
16
+
17
+ # TODO: Write general description for APPROVED
18
+ APPROVED = 'approved'.freeze,
19
+
20
+ # TODO: Write general description for DENIED
21
+ DENIED = 'denied'.freeze
22
+ ].freeze
23
+
24
+ def self.validate(value)
25
+ return false if value.nil?
26
+
27
+ CHALLENGE_ENUM_CHALLENGE_STATUSES.include?(value)
28
+ end
29
+
30
+ def self.from_value(value, default_value = PENDING)
31
+ return default_value if value.nil?
32
+
33
+ str = value.to_s.strip
34
+
35
+ case str.downcase
36
+ when 'pending' then PENDING
37
+ when 'expired' then EXPIRED
38
+ when 'approved' then APPROVED
39
+ when 'denied' then DENIED
40
+ else
41
+ default_value
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,41 @@
1
+ # twilio_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TwilioApIs
7
+ # The Factor Type of this Challenge. Currently `push` and `totp` are
8
+ # supported.
9
+ class ChallengeEnumFactorTypes
10
+ CHALLENGE_ENUM_FACTOR_TYPES = [
11
+ # TODO: Write general description for PUSH
12
+ PUSH = 'push'.freeze,
13
+
14
+ # TODO: Write general description for TOTP
15
+ TOTP = 'totp'.freeze,
16
+
17
+ # TODO: Write general description for PASSKEYS
18
+ PASSKEYS = 'passkeys'.freeze
19
+ ].freeze
20
+
21
+ def self.validate(value)
22
+ return false if value.nil?
23
+
24
+ CHALLENGE_ENUM_FACTOR_TYPES.include?(value)
25
+ end
26
+
27
+ def self.from_value(value, default_value = PUSH)
28
+ return default_value if value.nil?
29
+
30
+ str = value.to_s.strip
31
+
32
+ case str.downcase
33
+ when 'push' then PUSH
34
+ when 'totp' then TOTP
35
+ when 'passkeys' then PASSKEYS
36
+ else
37
+ default_value
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,249 @@
1
+ # twilio_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module TwilioApIs
8
+ # Channel Model.
9
+ class Channel < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The unique string that we created to identify the Channel resource.
14
+ # @return [String]
15
+ attr_accessor :sid
16
+
17
+ # The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that
18
+ # created the Channel resource.
19
+ # @return [String]
20
+ attr_accessor :account_sid
21
+
22
+ # The SID of the
23
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the
24
+ # Channel resource is associated with.
25
+ # @return [String]
26
+ attr_accessor :service_sid
27
+
28
+ # The string that you assigned to describe the resource.
29
+ # @return [String]
30
+ attr_accessor :friendly_name
31
+
32
+ # An application-defined string that uniquely identifies the resource. It
33
+ # can be used to address the resource in place of the resource's `sid` in
34
+ # the URL.
35
+ # @return [String]
36
+ attr_accessor :unique_name
37
+
38
+ # The JSON string that stores application-specific data. If attributes have
39
+ # not been set, `{}` is returned.
40
+ # @return [String]
41
+ attr_accessor :attributes
42
+
43
+ # The visibility of the channel. Can be: `public` or `private`.
44
+ # @return [ChannelChannelType]
45
+ attr_accessor :type
46
+
47
+ # The date and time in GMT when the resource was created specified in [ISO
48
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
49
+ # @return [DateTime]
50
+ attr_accessor :date_created
51
+
52
+ # The date and time in GMT when the resource was last updated specified in
53
+ # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
54
+ # @return [DateTime]
55
+ attr_accessor :date_updated
56
+
57
+ # The `identity` of the User that created the channel. If the Channel was
58
+ # created by using the API, the value is `system`.
59
+ # @return [String]
60
+ attr_accessor :created_by
61
+
62
+ # The number of Members in the Channel.
63
+ # @return [Integer]
64
+ attr_accessor :members_count
65
+
66
+ # The number of Messages that have been passed in the Channel.
67
+ # @return [Integer]
68
+ attr_accessor :messages_count
69
+
70
+ # The unique ID of the [Messaging
71
+ # Service](https://www.twilio.com/docs/messaging/api/service-resource) this
72
+ # channel belongs to.
73
+ # @return [String]
74
+ attr_accessor :messaging_service_sid
75
+
76
+ # The absolute URL of the Channel resource.
77
+ # @return [String]
78
+ attr_accessor :url
79
+
80
+ # A mapping from model property names to API property names.
81
+ def self.names
82
+ @_hash = {} if @_hash.nil?
83
+ @_hash['sid'] = 'sid'
84
+ @_hash['account_sid'] = 'account_sid'
85
+ @_hash['service_sid'] = 'service_sid'
86
+ @_hash['friendly_name'] = 'friendly_name'
87
+ @_hash['unique_name'] = 'unique_name'
88
+ @_hash['attributes'] = 'attributes'
89
+ @_hash['type'] = 'type'
90
+ @_hash['date_created'] = 'date_created'
91
+ @_hash['date_updated'] = 'date_updated'
92
+ @_hash['created_by'] = 'created_by'
93
+ @_hash['members_count'] = 'members_count'
94
+ @_hash['messages_count'] = 'messages_count'
95
+ @_hash['messaging_service_sid'] = 'messaging_service_sid'
96
+ @_hash['url'] = 'url'
97
+ @_hash
98
+ end
99
+
100
+ # An array for optional fields
101
+ def self.optionals
102
+ %w[
103
+ sid
104
+ account_sid
105
+ service_sid
106
+ friendly_name
107
+ unique_name
108
+ attributes
109
+ type
110
+ date_created
111
+ date_updated
112
+ created_by
113
+ members_count
114
+ messages_count
115
+ messaging_service_sid
116
+ url
117
+ ]
118
+ end
119
+
120
+ # An array for nullable fields
121
+ def self.nullables
122
+ %w[
123
+ sid
124
+ account_sid
125
+ service_sid
126
+ friendly_name
127
+ unique_name
128
+ attributes
129
+ date_created
130
+ date_updated
131
+ created_by
132
+ messaging_service_sid
133
+ url
134
+ ]
135
+ end
136
+
137
+ def initialize(sid: SKIP, account_sid: SKIP, service_sid: SKIP,
138
+ friendly_name: SKIP, unique_name: SKIP, attributes: SKIP,
139
+ type: SKIP, date_created: SKIP, date_updated: SKIP,
140
+ created_by: SKIP, members_count: 0, messages_count: 0,
141
+ messaging_service_sid: SKIP, url: SKIP,
142
+ additional_properties: nil)
143
+ # Add additional model properties to the instance
144
+ additional_properties = {} if additional_properties.nil?
145
+
146
+ @sid = sid unless sid == SKIP
147
+ @account_sid = account_sid unless account_sid == SKIP
148
+ @service_sid = service_sid unless service_sid == SKIP
149
+ @friendly_name = friendly_name unless friendly_name == SKIP
150
+ @unique_name = unique_name unless unique_name == SKIP
151
+ @attributes = attributes unless attributes == SKIP
152
+ @type = type unless type == SKIP
153
+ @date_created = date_created unless date_created == SKIP
154
+ @date_updated = date_updated unless date_updated == SKIP
155
+ @created_by = created_by unless created_by == SKIP
156
+ @members_count = members_count unless members_count == SKIP
157
+ @messages_count = messages_count unless messages_count == SKIP
158
+ @messaging_service_sid = messaging_service_sid unless messaging_service_sid == SKIP
159
+ @url = url unless url == SKIP
160
+ @additional_properties = additional_properties
161
+ end
162
+
163
+ # Creates an instance of the object from a hash.
164
+ def self.from_hash(hash)
165
+ return nil unless hash
166
+
167
+ # Extract variables from the hash.
168
+ sid = hash.key?('sid') ? hash['sid'] : SKIP
169
+ account_sid = hash.key?('account_sid') ? hash['account_sid'] : SKIP
170
+ service_sid = hash.key?('service_sid') ? hash['service_sid'] : SKIP
171
+ friendly_name = hash.key?('friendly_name') ? hash['friendly_name'] : SKIP
172
+ unique_name = hash.key?('unique_name') ? hash['unique_name'] : SKIP
173
+ attributes = hash.key?('attributes') ? hash['attributes'] : SKIP
174
+ type = hash.key?('type') ? hash['type'] : SKIP
175
+ date_created = if hash.key?('date_created')
176
+ (DateTimeHelper.from_rfc3339(hash['date_created']) if hash['date_created'])
177
+ else
178
+ SKIP
179
+ end
180
+ date_updated = if hash.key?('date_updated')
181
+ (DateTimeHelper.from_rfc3339(hash['date_updated']) if hash['date_updated'])
182
+ else
183
+ SKIP
184
+ end
185
+ created_by = hash.key?('created_by') ? hash['created_by'] : SKIP
186
+ members_count = hash['members_count'] ||= 0
187
+ messages_count = hash['messages_count'] ||= 0
188
+ messaging_service_sid =
189
+ hash.key?('messaging_service_sid') ? hash['messaging_service_sid'] : SKIP
190
+ url = hash.key?('url') ? hash['url'] : SKIP
191
+
192
+ # Create a new hash for additional properties, removing known properties.
193
+ new_hash = hash.reject { |k, _| names.value?(k) }
194
+
195
+ additional_properties = APIHelper.get_additional_properties(
196
+ new_hash, proc { |value| value }
197
+ )
198
+
199
+ # Create object from extracted values.
200
+ Channel.new(sid: sid,
201
+ account_sid: account_sid,
202
+ service_sid: service_sid,
203
+ friendly_name: friendly_name,
204
+ unique_name: unique_name,
205
+ attributes: attributes,
206
+ type: type,
207
+ date_created: date_created,
208
+ date_updated: date_updated,
209
+ created_by: created_by,
210
+ members_count: members_count,
211
+ messages_count: messages_count,
212
+ messaging_service_sid: messaging_service_sid,
213
+ url: url,
214
+ additional_properties: additional_properties)
215
+ end
216
+
217
+ def to_custom_date_created
218
+ DateTimeHelper.to_rfc3339(date_created)
219
+ end
220
+
221
+ def to_custom_date_updated
222
+ DateTimeHelper.to_rfc3339(date_updated)
223
+ end
224
+
225
+ # Provides a human-readable string representation of the object.
226
+ def to_s
227
+ class_name = self.class.name.split('::').last
228
+ "<#{class_name} sid: #{@sid}, account_sid: #{@account_sid}, service_sid: #{@service_sid},"\
229
+ " friendly_name: #{@friendly_name}, unique_name: #{@unique_name}, attributes:"\
230
+ " #{@attributes}, type: #{@type}, date_created: #{@date_created}, date_updated:"\
231
+ " #{@date_updated}, created_by: #{@created_by}, members_count: #{@members_count},"\
232
+ " messages_count: #{@messages_count}, messaging_service_sid: #{@messaging_service_sid}, url:"\
233
+ " #{@url}, additional_properties: #{@additional_properties}>"
234
+ end
235
+
236
+ # Provides a debugging-friendly string with detailed object information.
237
+ def inspect
238
+ class_name = self.class.name.split('::').last
239
+ "<#{class_name} sid: #{@sid.inspect}, account_sid: #{@account_sid.inspect}, service_sid:"\
240
+ " #{@service_sid.inspect}, friendly_name: #{@friendly_name.inspect}, unique_name:"\
241
+ " #{@unique_name.inspect}, attributes: #{@attributes.inspect}, type: #{@type.inspect},"\
242
+ " date_created: #{@date_created.inspect}, date_updated: #{@date_updated.inspect},"\
243
+ " created_by: #{@created_by.inspect}, members_count: #{@members_count.inspect},"\
244
+ " messages_count: #{@messages_count.inspect}, messaging_service_sid:"\
245
+ " #{@messaging_service_sid.inspect}, url: #{@url.inspect}, additional_properties:"\
246
+ " #{@additional_properties}>"
247
+ end
248
+ end
249
+ end