sunshine-conversations-client 12.2.0 → 12.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG_RB.md +19 -0
  3. data/README.md +10 -5
  4. data/docs/Apple.md +2 -2
  5. data/docs/AppleAllOf.md +2 -2
  6. data/docs/AttachmentsApi.md +2 -2
  7. data/docs/Author.md +2 -2
  8. data/docs/AuthorMessages.md +27 -0
  9. data/docs/AuthorWebhook.md +1 -1
  10. data/docs/Business.md +27 -0
  11. data/docs/BusinessAllOf.md +19 -0
  12. data/docs/ConversationCreateEventAllOfPayload.md +1 -1
  13. data/docs/ConversationMessageDeliveryPayload.md +1 -1
  14. data/docs/ConversationPostbackEventAllOfPayload.md +1 -1
  15. data/docs/ConversationReferralEventAllOfPayload.md +1 -1
  16. data/docs/Message.md +1 -1
  17. data/docs/MessagePost.md +1 -1
  18. data/docs/User.md +10 -12
  19. data/docs/User2.md +27 -0
  20. data/docs/User2AllOf.md +23 -0
  21. data/docs/UserAllOf.md +2 -8
  22. data/docs/UserMergeEventAllOfPayloadMergedUsers.md +2 -2
  23. data/docs/UserResponse.md +1 -1
  24. data/docs/UserUpdateEventAllOfPayload.md +1 -1
  25. data/lib/sunshine-conversations-client/api/activities_api.rb +1 -1
  26. data/lib/sunshine-conversations-client/api/app_keys_api.rb +1 -1
  27. data/lib/sunshine-conversations-client/api/apps_api.rb +1 -1
  28. data/lib/sunshine-conversations-client/api/attachments_api.rb +3 -3
  29. data/lib/sunshine-conversations-client/api/clients_api.rb +1 -1
  30. data/lib/sunshine-conversations-client/api/conversations_api.rb +1 -1
  31. data/lib/sunshine-conversations-client/api/custom_integration_api_keys_api.rb +1 -1
  32. data/lib/sunshine-conversations-client/api/integrations_api.rb +1 -1
  33. data/lib/sunshine-conversations-client/api/messages_api.rb +1 -1
  34. data/lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb +1 -1
  35. data/lib/sunshine-conversations-client/api/participants_api.rb +1 -1
  36. data/lib/sunshine-conversations-client/api/switchboard_actions_api.rb +1 -1
  37. data/lib/sunshine-conversations-client/api/switchboard_integrations_api.rb +1 -1
  38. data/lib/sunshine-conversations-client/api/switchboards_api.rb +1 -1
  39. data/lib/sunshine-conversations-client/api/users_api.rb +1 -1
  40. data/lib/sunshine-conversations-client/api/webhooks_api.rb +1 -1
  41. data/lib/sunshine-conversations-client/api_client.rb +1 -1
  42. data/lib/sunshine-conversations-client/api_error.rb +1 -1
  43. data/lib/sunshine-conversations-client/configuration.rb +1 -1
  44. data/lib/sunshine-conversations-client/models/accept_control_body.rb +1 -1
  45. data/lib/sunshine-conversations-client/models/action.rb +1 -1
  46. data/lib/sunshine-conversations-client/models/action_subset.rb +1 -1
  47. data/lib/sunshine-conversations-client/models/activity.rb +1 -1
  48. data/lib/sunshine-conversations-client/models/activity_all_of.rb +1 -1
  49. data/lib/sunshine-conversations-client/models/activity_post.rb +1 -1
  50. data/lib/sunshine-conversations-client/models/activity_post_all_of.rb +1 -1
  51. data/lib/sunshine-conversations-client/models/activity_types.rb +1 -1
  52. data/lib/sunshine-conversations-client/models/android.rb +1 -1
  53. data/lib/sunshine-conversations-client/models/android_all_of.rb +1 -1
  54. data/lib/sunshine-conversations-client/models/android_update.rb +1 -1
  55. data/lib/sunshine-conversations-client/models/android_update_all_of.rb +1 -1
  56. data/lib/sunshine-conversations-client/models/api_key.rb +1 -1
  57. data/lib/sunshine-conversations-client/models/app.rb +1 -1
  58. data/lib/sunshine-conversations-client/models/app_create_body.rb +1 -1
  59. data/lib/sunshine-conversations-client/models/app_key.rb +1 -1
  60. data/lib/sunshine-conversations-client/models/app_key_create_body.rb +1 -1
  61. data/lib/sunshine-conversations-client/models/app_key_list_response.rb +1 -1
  62. data/lib/sunshine-conversations-client/models/app_key_response.rb +1 -1
  63. data/lib/sunshine-conversations-client/models/app_list_filter.rb +1 -1
  64. data/lib/sunshine-conversations-client/models/app_list_response.rb +1 -1
  65. data/lib/sunshine-conversations-client/models/app_response.rb +1 -1
  66. data/lib/sunshine-conversations-client/models/app_settings.rb +1 -1
  67. data/lib/sunshine-conversations-client/models/app_sub_schema.rb +1 -1
  68. data/lib/sunshine-conversations-client/models/app_update_body.rb +1 -1
  69. data/lib/sunshine-conversations-client/models/apple.rb +3 -3
  70. data/lib/sunshine-conversations-client/models/apple_all_of.rb +3 -3
  71. data/lib/sunshine-conversations-client/models/apple_update.rb +1 -1
  72. data/lib/sunshine-conversations-client/models/attachment_delete_body.rb +1 -1
  73. data/lib/sunshine-conversations-client/models/attachment_media_token_body.rb +1 -1
  74. data/lib/sunshine-conversations-client/models/attachment_media_token_response.rb +1 -1
  75. data/lib/sunshine-conversations-client/models/attachment_response.rb +1 -1
  76. data/lib/sunshine-conversations-client/models/attachment_schema.rb +1 -1
  77. data/lib/sunshine-conversations-client/models/attachment_upload_body.rb +1 -1
  78. data/lib/sunshine-conversations-client/models/author.rb +3 -3
  79. data/lib/sunshine-conversations-client/models/author_messages.rb +321 -0
  80. data/lib/sunshine-conversations-client/models/author_webhook.rb +2 -2
  81. data/lib/sunshine-conversations-client/models/business.rb +300 -0
  82. data/lib/sunshine-conversations-client/models/business_all_of.rb +248 -0
  83. data/lib/sunshine-conversations-client/models/buy.rb +1 -1
  84. data/lib/sunshine-conversations-client/models/campaign.rb +1 -1
  85. data/lib/sunshine-conversations-client/models/carousel_message.rb +1 -1
  86. data/lib/sunshine-conversations-client/models/carousel_message_display_settings.rb +1 -1
  87. data/lib/sunshine-conversations-client/models/client.rb +1 -1
  88. data/lib/sunshine-conversations-client/models/client_add_event.rb +1 -1
  89. data/lib/sunshine-conversations-client/models/client_add_event_all_of.rb +1 -1
  90. data/lib/sunshine-conversations-client/models/client_add_event_all_of_payload.rb +1 -1
  91. data/lib/sunshine-conversations-client/models/client_association.rb +1 -1
  92. data/lib/sunshine-conversations-client/models/client_create.rb +1 -1
  93. data/lib/sunshine-conversations-client/models/client_list_response.rb +1 -1
  94. data/lib/sunshine-conversations-client/models/client_remove_event.rb +1 -1
  95. data/lib/sunshine-conversations-client/models/client_remove_event_all_of.rb +1 -1
  96. data/lib/sunshine-conversations-client/models/client_remove_event_all_of_payload.rb +1 -1
  97. data/lib/sunshine-conversations-client/models/client_response.rb +1 -1
  98. data/lib/sunshine-conversations-client/models/client_type.rb +1 -1
  99. data/lib/sunshine-conversations-client/models/client_update_event.rb +1 -1
  100. data/lib/sunshine-conversations-client/models/client_update_event_all_of.rb +1 -1
  101. data/lib/sunshine-conversations-client/models/client_update_event_all_of_payload.rb +1 -1
  102. data/lib/sunshine-conversations-client/models/confirmation.rb +1 -1
  103. data/lib/sunshine-conversations-client/models/content.rb +1 -1
  104. data/lib/sunshine-conversations-client/models/conversation.rb +1 -1
  105. data/lib/sunshine-conversations-client/models/conversation_all_of.rb +1 -1
  106. data/lib/sunshine-conversations-client/models/conversation_create_body.rb +1 -1
  107. data/lib/sunshine-conversations-client/models/conversation_create_event.rb +1 -1
  108. data/lib/sunshine-conversations-client/models/conversation_create_event_all_of.rb +1 -1
  109. data/lib/sunshine-conversations-client/models/conversation_create_event_all_of_payload.rb +2 -2
  110. data/lib/sunshine-conversations-client/models/conversation_join_event.rb +1 -1
  111. data/lib/sunshine-conversations-client/models/conversation_join_event_all_of.rb +1 -1
  112. data/lib/sunshine-conversations-client/models/conversation_join_event_all_of_payload.rb +1 -1
  113. data/lib/sunshine-conversations-client/models/conversation_leave_event.rb +1 -1
  114. data/lib/sunshine-conversations-client/models/conversation_leave_event_all_of.rb +1 -1
  115. data/lib/sunshine-conversations-client/models/conversation_leave_event_all_of_payload.rb +1 -1
  116. data/lib/sunshine-conversations-client/models/conversation_list_filter.rb +1 -1
  117. data/lib/sunshine-conversations-client/models/conversation_list_response.rb +1 -1
  118. data/lib/sunshine-conversations-client/models/conversation_message_delivery_channel_event.rb +1 -1
  119. data/lib/sunshine-conversations-client/models/conversation_message_delivery_channel_event_all_of.rb +1 -1
  120. data/lib/sunshine-conversations-client/models/conversation_message_delivery_failure_event.rb +1 -1
  121. data/lib/sunshine-conversations-client/models/conversation_message_delivery_failure_event_all_of.rb +1 -1
  122. data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload.rb +2 -2
  123. data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_destination.rb +1 -1
  124. data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_external_messages.rb +1 -1
  125. data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_message.rb +1 -1
  126. data/lib/sunshine-conversations-client/models/conversation_message_delivery_user_event.rb +1 -1
  127. data/lib/sunshine-conversations-client/models/conversation_message_event.rb +1 -1
  128. data/lib/sunshine-conversations-client/models/conversation_message_event_all_of.rb +1 -1
  129. data/lib/sunshine-conversations-client/models/conversation_message_event_all_of_payload.rb +1 -1
  130. data/lib/sunshine-conversations-client/models/conversation_postback_event.rb +1 -1
  131. data/lib/sunshine-conversations-client/models/conversation_postback_event_all_of.rb +1 -1
  132. data/lib/sunshine-conversations-client/models/conversation_postback_event_all_of_payload.rb +2 -2
  133. data/lib/sunshine-conversations-client/models/conversation_read_event.rb +1 -1
  134. data/lib/sunshine-conversations-client/models/conversation_read_event_all_of.rb +1 -1
  135. data/lib/sunshine-conversations-client/models/conversation_read_event_all_of_payload.rb +1 -1
  136. data/lib/sunshine-conversations-client/models/conversation_referral_event.rb +1 -1
  137. data/lib/sunshine-conversations-client/models/conversation_referral_event_all_of.rb +1 -1
  138. data/lib/sunshine-conversations-client/models/conversation_referral_event_all_of_payload.rb +2 -2
  139. data/lib/sunshine-conversations-client/models/conversation_remove_event.rb +1 -1
  140. data/lib/sunshine-conversations-client/models/conversation_remove_event_all_of.rb +1 -1
  141. data/lib/sunshine-conversations-client/models/conversation_remove_event_all_of_payload.rb +1 -1
  142. data/lib/sunshine-conversations-client/models/conversation_response.rb +1 -1
  143. data/lib/sunshine-conversations-client/models/conversation_truncated.rb +1 -1
  144. data/lib/sunshine-conversations-client/models/conversation_type.rb +1 -1
  145. data/lib/sunshine-conversations-client/models/conversation_typing_event.rb +1 -1
  146. data/lib/sunshine-conversations-client/models/conversation_typing_event_all_of.rb +1 -1
  147. data/lib/sunshine-conversations-client/models/conversation_typing_event_all_of_payload.rb +1 -1
  148. data/lib/sunshine-conversations-client/models/conversation_update_body.rb +1 -1
  149. data/lib/sunshine-conversations-client/models/custom.rb +1 -1
  150. data/lib/sunshine-conversations-client/models/custom_all_of.rb +1 -1
  151. data/lib/sunshine-conversations-client/models/custom_update.rb +1 -1
  152. data/lib/sunshine-conversations-client/models/destination.rb +1 -1
  153. data/lib/sunshine-conversations-client/models/device.rb +1 -1
  154. data/lib/sunshine-conversations-client/models/event_sub_schema.rb +1 -1
  155. data/lib/sunshine-conversations-client/models/extra_channel_options.rb +1 -1
  156. data/lib/sunshine-conversations-client/models/extra_channel_options_messenger.rb +1 -1
  157. data/lib/sunshine-conversations-client/models/field.rb +1 -1
  158. data/lib/sunshine-conversations-client/models/file_message.rb +1 -1
  159. data/lib/sunshine-conversations-client/models/form_message.rb +1 -1
  160. data/lib/sunshine-conversations-client/models/form_message_field.rb +1 -1
  161. data/lib/sunshine-conversations-client/models/form_message_field_all_of.rb +1 -1
  162. data/lib/sunshine-conversations-client/models/form_response_message.rb +1 -1
  163. data/lib/sunshine-conversations-client/models/form_response_message_field.rb +1 -1
  164. data/lib/sunshine-conversations-client/models/form_response_message_field_all_of.rb +1 -1
  165. data/lib/sunshine-conversations-client/models/identity.rb +1 -1
  166. data/lib/sunshine-conversations-client/models/image_message.rb +1 -1
  167. data/lib/sunshine-conversations-client/models/inline_object.rb +1 -1
  168. data/lib/sunshine-conversations-client/models/instagram.rb +1 -1
  169. data/lib/sunshine-conversations-client/models/instagram_all_of.rb +1 -1
  170. data/lib/sunshine-conversations-client/models/instagram_update.rb +1 -1
  171. data/lib/sunshine-conversations-client/models/instagram_update_all_of.rb +1 -1
  172. data/lib/sunshine-conversations-client/models/integration.rb +1 -1
  173. data/lib/sunshine-conversations-client/models/integration_api_key.rb +1 -1
  174. data/lib/sunshine-conversations-client/models/integration_api_key_list_response.rb +1 -1
  175. data/lib/sunshine-conversations-client/models/integration_api_key_response.rb +1 -1
  176. data/lib/sunshine-conversations-client/models/integration_id.rb +1 -1
  177. data/lib/sunshine-conversations-client/models/integration_list_filter.rb +1 -1
  178. data/lib/sunshine-conversations-client/models/integration_list_response.rb +1 -1
  179. data/lib/sunshine-conversations-client/models/integration_response.rb +1 -1
  180. data/lib/sunshine-conversations-client/models/integration_type.rb +1 -1
  181. data/lib/sunshine-conversations-client/models/integration_update.rb +1 -1
  182. data/lib/sunshine-conversations-client/models/integration_update_base.rb +1 -1
  183. data/lib/sunshine-conversations-client/models/ios.rb +1 -1
  184. data/lib/sunshine-conversations-client/models/ios_all_of.rb +1 -1
  185. data/lib/sunshine-conversations-client/models/ios_update.rb +1 -1
  186. data/lib/sunshine-conversations-client/models/ios_update_all_of.rb +1 -1
  187. data/lib/sunshine-conversations-client/models/item.rb +1 -1
  188. data/lib/sunshine-conversations-client/models/line.rb +1 -1
  189. data/lib/sunshine-conversations-client/models/line_all_of.rb +1 -1
  190. data/lib/sunshine-conversations-client/models/line_update.rb +1 -1
  191. data/lib/sunshine-conversations-client/models/link.rb +1 -1
  192. data/lib/sunshine-conversations-client/models/links.rb +1 -1
  193. data/lib/sunshine-conversations-client/models/list_message.rb +1 -1
  194. data/lib/sunshine-conversations-client/models/location_message.rb +1 -1
  195. data/lib/sunshine-conversations-client/models/location_message_coordinates.rb +1 -1
  196. data/lib/sunshine-conversations-client/models/location_message_location.rb +1 -1
  197. data/lib/sunshine-conversations-client/models/location_request.rb +1 -1
  198. data/lib/sunshine-conversations-client/models/mailgun.rb +1 -1
  199. data/lib/sunshine-conversations-client/models/mailgun_all_of.rb +1 -1
  200. data/lib/sunshine-conversations-client/models/mailgun_update.rb +1 -1
  201. data/lib/sunshine-conversations-client/models/mailgun_update_all_of.rb +1 -1
  202. data/lib/sunshine-conversations-client/models/match_criteria.rb +1 -1
  203. data/lib/sunshine-conversations-client/models/match_criteria_base.rb +1 -1
  204. data/lib/sunshine-conversations-client/models/match_criteria_mailgun.rb +1 -1
  205. data/lib/sunshine-conversations-client/models/match_criteria_mailgun_all_of.rb +1 -1
  206. data/lib/sunshine-conversations-client/models/match_criteria_messagebird.rb +1 -1
  207. data/lib/sunshine-conversations-client/models/match_criteria_messagebird_all_of.rb +1 -1
  208. data/lib/sunshine-conversations-client/models/match_criteria_twilio.rb +1 -1
  209. data/lib/sunshine-conversations-client/models/match_criteria_twilio_all_of.rb +1 -1
  210. data/lib/sunshine-conversations-client/models/match_criteria_whatsapp.rb +1 -1
  211. data/lib/sunshine-conversations-client/models/match_criteria_whatsapp_all_of.rb +1 -1
  212. data/lib/sunshine-conversations-client/models/message.rb +2 -2
  213. data/lib/sunshine-conversations-client/models/message_bird_update.rb +1 -1
  214. data/lib/sunshine-conversations-client/models/message_list_response.rb +1 -1
  215. data/lib/sunshine-conversations-client/models/message_override.rb +2 -2
  216. data/lib/sunshine-conversations-client/models/message_override_apple.rb +1 -1
  217. data/lib/sunshine-conversations-client/models/message_override_line.rb +1 -1
  218. data/lib/sunshine-conversations-client/models/message_override_messenger.rb +1 -1
  219. data/lib/sunshine-conversations-client/models/message_override_payload.rb +1 -1
  220. data/lib/sunshine-conversations-client/models/message_override_whatsapp.rb +1 -1
  221. data/lib/sunshine-conversations-client/models/message_post.rb +2 -2
  222. data/lib/sunshine-conversations-client/models/message_post_response.rb +1 -1
  223. data/lib/sunshine-conversations-client/models/message_webhook.rb +1 -1
  224. data/lib/sunshine-conversations-client/models/messagebird.rb +1 -1
  225. data/lib/sunshine-conversations-client/models/messagebird_all_of.rb +1 -1
  226. data/lib/sunshine-conversations-client/models/messenger.rb +1 -1
  227. data/lib/sunshine-conversations-client/models/messenger_all_of.rb +1 -1
  228. data/lib/sunshine-conversations-client/models/messenger_update.rb +1 -1
  229. data/lib/sunshine-conversations-client/models/meta.rb +1 -1
  230. data/lib/sunshine-conversations-client/models/offer_control_body.rb +1 -1
  231. data/lib/sunshine-conversations-client/models/page.rb +1 -1
  232. data/lib/sunshine-conversations-client/models/participant.rb +1 -1
  233. data/lib/sunshine-conversations-client/models/participant_join_body.rb +1 -1
  234. data/lib/sunshine-conversations-client/models/participant_leave_body.rb +1 -1
  235. data/lib/sunshine-conversations-client/models/participant_leave_body_participant_id.rb +1 -1
  236. data/lib/sunshine-conversations-client/models/participant_leave_body_user_external_id.rb +1 -1
  237. data/lib/sunshine-conversations-client/models/participant_leave_body_user_id.rb +1 -1
  238. data/lib/sunshine-conversations-client/models/participant_list_response.rb +1 -1
  239. data/lib/sunshine-conversations-client/models/participant_response.rb +1 -1
  240. data/lib/sunshine-conversations-client/models/participant_sub_schema.rb +1 -1
  241. data/lib/sunshine-conversations-client/models/participant_with_user_external_id.rb +1 -1
  242. data/lib/sunshine-conversations-client/models/participant_with_user_id.rb +1 -1
  243. data/lib/sunshine-conversations-client/models/pass_control_body.rb +1 -1
  244. data/lib/sunshine-conversations-client/models/postback.rb +1 -1
  245. data/lib/sunshine-conversations-client/models/postback_webhook.rb +1 -1
  246. data/lib/sunshine-conversations-client/models/prechat_capture.rb +1 -1
  247. data/lib/sunshine-conversations-client/models/profile.rb +1 -1
  248. data/lib/sunshine-conversations-client/models/quoted_message.rb +1 -1
  249. data/lib/sunshine-conversations-client/models/quoted_message_external_message_id.rb +1 -1
  250. data/lib/sunshine-conversations-client/models/quoted_message_message.rb +1 -1
  251. data/lib/sunshine-conversations-client/models/referral.rb +1 -1
  252. data/lib/sunshine-conversations-client/models/referral_details.rb +1 -1
  253. data/lib/sunshine-conversations-client/models/reply.rb +1 -1
  254. data/lib/sunshine-conversations-client/models/source.rb +1 -1
  255. data/lib/sunshine-conversations-client/models/source_webhook.rb +1 -1
  256. data/lib/sunshine-conversations-client/models/source_with_campaign_webhook.rb +1 -1
  257. data/lib/sunshine-conversations-client/models/source_with_campaign_webhook_all_of.rb +1 -1
  258. data/lib/sunshine-conversations-client/models/status.rb +1 -1
  259. data/lib/sunshine-conversations-client/models/switchboard.rb +1 -1
  260. data/lib/sunshine-conversations-client/models/switchboard_accept_control.rb +1 -1
  261. data/lib/sunshine-conversations-client/models/switchboard_accept_control_all_of.rb +1 -1
  262. data/lib/sunshine-conversations-client/models/switchboard_accept_control_all_of_payload.rb +1 -1
  263. data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure.rb +1 -1
  264. data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure_all_of.rb +1 -1
  265. data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure_all_of_payload.rb +1 -1
  266. data/lib/sunshine-conversations-client/models/switchboard_integration.rb +1 -1
  267. data/lib/sunshine-conversations-client/models/switchboard_integration_create_body.rb +1 -1
  268. data/lib/sunshine-conversations-client/models/switchboard_integration_list_response.rb +1 -1
  269. data/lib/sunshine-conversations-client/models/switchboard_integration_response.rb +1 -1
  270. data/lib/sunshine-conversations-client/models/switchboard_integration_update_body.rb +1 -1
  271. data/lib/sunshine-conversations-client/models/switchboard_integration_webhook.rb +1 -1
  272. data/lib/sunshine-conversations-client/models/switchboard_list_response.rb +1 -1
  273. data/lib/sunshine-conversations-client/models/switchboard_offer_control.rb +1 -1
  274. data/lib/sunshine-conversations-client/models/switchboard_offer_control_all_of.rb +1 -1
  275. data/lib/sunshine-conversations-client/models/switchboard_offer_control_all_of_payload.rb +1 -1
  276. data/lib/sunshine-conversations-client/models/switchboard_offer_control_failure.rb +1 -1
  277. data/lib/sunshine-conversations-client/models/switchboard_pass_control.rb +1 -1
  278. data/lib/sunshine-conversations-client/models/switchboard_pass_control_all_of.rb +1 -1
  279. data/lib/sunshine-conversations-client/models/switchboard_pass_control_all_of_payload.rb +1 -1
  280. data/lib/sunshine-conversations-client/models/switchboard_pass_control_failure.rb +1 -1
  281. data/lib/sunshine-conversations-client/models/switchboard_response.rb +1 -1
  282. data/lib/sunshine-conversations-client/models/switchboard_update_body.rb +1 -1
  283. data/lib/sunshine-conversations-client/models/target.rb +1 -1
  284. data/lib/sunshine-conversations-client/models/telegram.rb +1 -1
  285. data/lib/sunshine-conversations-client/models/telegram_all_of.rb +1 -1
  286. data/lib/sunshine-conversations-client/models/telegram_update.rb +1 -1
  287. data/lib/sunshine-conversations-client/models/template_message.rb +1 -1
  288. data/lib/sunshine-conversations-client/models/text_message.rb +1 -1
  289. data/lib/sunshine-conversations-client/models/twilio.rb +1 -1
  290. data/lib/sunshine-conversations-client/models/twilio_all_of.rb +1 -1
  291. data/lib/sunshine-conversations-client/models/twilio_update.rb +1 -1
  292. data/lib/sunshine-conversations-client/models/twitter.rb +1 -1
  293. data/lib/sunshine-conversations-client/models/twitter_all_of.rb +1 -1
  294. data/lib/sunshine-conversations-client/models/twitter_update.rb +1 -1
  295. data/lib/sunshine-conversations-client/models/unity.rb +1 -1
  296. data/lib/sunshine-conversations-client/models/unity_all_of.rb +1 -1
  297. data/lib/sunshine-conversations-client/models/unity_update.rb +1 -1
  298. data/lib/sunshine-conversations-client/models/unity_update_all_of.rb +1 -1
  299. data/lib/sunshine-conversations-client/models/user.rb +81 -49
  300. data/lib/sunshine-conversations-client/models/user2.rb +259 -0
  301. data/lib/sunshine-conversations-client/models/user2_all_of.rb +230 -0
  302. data/lib/sunshine-conversations-client/models/user_all_of.rb +43 -34
  303. data/lib/sunshine-conversations-client/models/user_create_body.rb +1 -1
  304. data/lib/sunshine-conversations-client/models/user_merge_event.rb +1 -1
  305. data/lib/sunshine-conversations-client/models/user_merge_event_all_of.rb +1 -1
  306. data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload.rb +1 -1
  307. data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_clients.rb +1 -1
  308. data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_conversations.rb +1 -1
  309. data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_users.rb +3 -3
  310. data/lib/sunshine-conversations-client/models/user_response.rb +2 -2
  311. data/lib/sunshine-conversations-client/models/user_truncated.rb +1 -1
  312. data/lib/sunshine-conversations-client/models/user_update_body.rb +1 -1
  313. data/lib/sunshine-conversations-client/models/user_update_event.rb +1 -1
  314. data/lib/sunshine-conversations-client/models/user_update_event_all_of.rb +1 -1
  315. data/lib/sunshine-conversations-client/models/user_update_event_all_of_payload.rb +2 -2
  316. data/lib/sunshine-conversations-client/models/viber.rb +1 -1
  317. data/lib/sunshine-conversations-client/models/viber_all_of.rb +1 -1
  318. data/lib/sunshine-conversations-client/models/viber_update.rb +1 -1
  319. data/lib/sunshine-conversations-client/models/web.rb +1 -1
  320. data/lib/sunshine-conversations-client/models/web_all_of.rb +1 -1
  321. data/lib/sunshine-conversations-client/models/web_update.rb +1 -1
  322. data/lib/sunshine-conversations-client/models/web_update_all_of.rb +1 -1
  323. data/lib/sunshine-conversations-client/models/webhook.rb +1 -1
  324. data/lib/sunshine-conversations-client/models/webhook_body.rb +1 -1
  325. data/lib/sunshine-conversations-client/models/webhook_create_body.rb +1 -1
  326. data/lib/sunshine-conversations-client/models/webhook_list_response.rb +1 -1
  327. data/lib/sunshine-conversations-client/models/webhook_response.rb +1 -1
  328. data/lib/sunshine-conversations-client/models/webhook_sub_schema.rb +1 -1
  329. data/lib/sunshine-conversations-client/models/webview.rb +1 -1
  330. data/lib/sunshine-conversations-client/models/whats_app_update.rb +1 -1
  331. data/lib/sunshine-conversations-client/models/whats_app_update_all_of.rb +1 -1
  332. data/lib/sunshine-conversations-client/models/whatsapp.rb +1 -1
  333. data/lib/sunshine-conversations-client/models/whatsapp_all_of.rb +1 -1
  334. data/lib/sunshine-conversations-client/version.rb +2 -2
  335. data/lib/sunshine-conversations-client.rb +6 -1
  336. data/spec/api_client_spec.rb +1 -1
  337. data/spec/configuration_spec.rb +1 -1
  338. data/spec/spec_helper.rb +1 -1
  339. data/sunshine-conversations-client.gemspec +1 -1
  340. metadata +12 -2
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Sunshine Conversations API
3
3
 
4
- The version of the OpenAPI document: 12.2.0
4
+ The version of the OpenAPI document: 12.3.0
5
5
 
6
6
  Generated by: https://openapi-generator.tech
7
7
  OpenAPI Generator version: 4.3.1
@@ -11,57 +11,76 @@ require 'date'
11
11
 
12
12
  module SunshineConversationsClient
13
13
  class User
14
- # The unique ID of the user.
15
- attr_accessor :id
16
-
17
- # An optional ID that can also be used to retrieve the user.
18
- attr_accessor :external_id
19
-
20
- attr_accessor :signed_up_at
21
-
22
- attr_accessor :profile
23
-
24
- attr_accessor :metadata
14
+ # The type of the author.
15
+ attr_accessor :type
16
+
17
+ # The id of the user. Only supported when `type` is user.
18
+ attr_accessor :user_id
19
+
20
+ # The externalId of the user. Only supported when `type` is user.
21
+ attr_accessor :user_external_id
22
+
23
+ # The display name of the message author.
24
+ attr_accessor :display_name
25
+
26
+ # A custom message icon URL. The image must be JPG, PNG, or GIF format.
27
+ attr_accessor :avatar_url
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
25
45
 
26
- # The user's connected identities.
27
- attr_accessor :identities
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
28
50
 
29
51
  # Attribute mapping from ruby-style variable name to JSON key.
30
52
  def self.attribute_map
31
53
  {
32
- :'id' => :'id',
33
- :'external_id' => :'externalId',
34
- :'signed_up_at' => :'signedUpAt',
35
- :'profile' => :'profile',
36
- :'metadata' => :'metadata',
37
- :'identities' => :'identities'
54
+ :'type' => :'type',
55
+ :'user_id' => :'userId',
56
+ :'user_external_id' => :'userExternalId',
57
+ :'display_name' => :'displayName',
58
+ :'avatar_url' => :'avatarUrl'
38
59
  }
39
60
  end
40
61
 
41
62
  # Attribute type mapping.
42
63
  def self.openapi_types
43
64
  {
44
- :'id' => :'String',
45
- :'external_id' => :'String',
46
- :'signed_up_at' => :'String',
47
- :'profile' => :'Profile',
48
- :'metadata' => :'Object',
49
- :'identities' => :'Array<Identity>'
65
+ :'type' => :'String',
66
+ :'user_id' => :'String',
67
+ :'user_external_id' => :'String',
68
+ :'display_name' => :'String',
69
+ :'avatar_url' => :'String'
50
70
  }
51
71
  end
52
72
 
53
73
  # List of attributes with nullable: true
54
74
  def self.openapi_nullable
55
75
  Set.new([
56
- :'external_id',
57
76
  ])
58
77
  end
59
78
 
60
79
  # List of class defined in allOf (OpenAPI v3)
61
80
  def self.openapi_all_of
62
81
  [
63
- :'UserAllOf',
64
- :'UserTruncated'
82
+ :'Author',
83
+ :'UserAllOf'
65
84
  ]
66
85
  end
67
86
 
@@ -80,27 +99,24 @@ module SunshineConversationsClient
80
99
  h[k.to_sym] = v
81
100
  }
82
101
 
83
- if attributes.key?(:'id')
84
- self.id = attributes[:'id']
85
- end
86
-
87
- if attributes.key?(:'external_id')
88
- self.external_id = attributes[:'external_id']
102
+ if attributes.key?(:'type')
103
+ self.type = attributes[:'type']
89
104
  end
90
105
 
91
- if attributes.key?(:'signed_up_at')
92
- self.signed_up_at = attributes[:'signed_up_at']
106
+ if attributes.key?(:'user_id')
107
+ self.user_id = attributes[:'user_id']
93
108
  end
94
109
 
95
- if attributes.key?(:'profile')
96
- self.profile = attributes[:'profile']
110
+ if attributes.key?(:'user_external_id')
111
+ self.user_external_id = attributes[:'user_external_id']
97
112
  end
98
113
 
99
- if attributes.key?(:'metadata')
100
- self.metadata = attributes[:'metadata']
114
+ if attributes.key?(:'display_name')
115
+ self.display_name = attributes[:'display_name']
101
116
  end
102
117
 
103
- if attributes.key?(:'identities')
118
+ if attributes.key?(:'avatar_url')
119
+ self.avatar_url = attributes[:'avatar_url']
104
120
  end
105
121
  end
106
122
 
@@ -108,26 +124,42 @@ module SunshineConversationsClient
108
124
  # @return Array for valid properties with the reasons
109
125
  def list_invalid_properties
110
126
  invalid_properties = Array.new
127
+ if @type.nil?
128
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
129
+ end
130
+
111
131
  invalid_properties
112
132
  end
113
133
 
114
134
  # Check to see if the all the properties in the model are valid
115
135
  # @return true if the model is valid
116
136
  def valid?
137
+ return false if @type.nil?
138
+ type_validator = EnumAttributeValidator.new('String', ["user"])
139
+ return false unless type_validator.valid?(@type)
117
140
  true
118
141
  end
119
142
 
143
+ # Custom attribute writer method checking allowed values (enum).
144
+ # @param [Object] type Object to be assigned
145
+ def type=(type)
146
+ validator = EnumAttributeValidator.new('String', ["user"])
147
+ unless validator.valid?(type)
148
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
149
+ end
150
+ @type = type
151
+ end
152
+
120
153
  # Checks equality by comparing each attribute.
121
154
  # @param [Object] Object to be compared
122
155
  def ==(o)
123
156
  return true if self.equal?(o)
124
157
  self.class == o.class &&
125
- id == o.id &&
126
- external_id == o.external_id &&
127
- signed_up_at == o.signed_up_at &&
128
- profile == o.profile &&
129
- metadata == o.metadata &&
130
- identities == o.identities
158
+ type == o.type &&
159
+ user_id == o.user_id &&
160
+ user_external_id == o.user_external_id &&
161
+ display_name == o.display_name &&
162
+ avatar_url == o.avatar_url
131
163
  end
132
164
 
133
165
  # @see the `==` method
@@ -139,7 +171,7 @@ module SunshineConversationsClient
139
171
  # Calculates hash code according to all attributes.
140
172
  # @return [Integer] Hash code
141
173
  def hash
142
- [id, external_id, signed_up_at, profile, metadata, identities].hash
174
+ [type, user_id, user_external_id, display_name, avatar_url].hash
143
175
  end
144
176
 
145
177
  # Builds the object from hash
@@ -0,0 +1,259 @@
1
+ =begin
2
+ #Sunshine Conversations API
3
+
4
+ The version of the OpenAPI document: 12.3.0
5
+
6
+ Generated by: https://openapi-generator.tech
7
+ OpenAPI Generator version: 4.3.1
8
+ =end
9
+
10
+ require 'date'
11
+
12
+ module SunshineConversationsClient
13
+ class User2
14
+ # The unique ID of the user.
15
+ attr_accessor :id
16
+
17
+ # An optional ID that can also be used to retrieve the user.
18
+ attr_accessor :external_id
19
+
20
+ attr_accessor :signed_up_at
21
+
22
+ attr_accessor :profile
23
+
24
+ attr_accessor :metadata
25
+
26
+ # The user's connected identities.
27
+ attr_accessor :identities
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'id' => :'id',
33
+ :'external_id' => :'externalId',
34
+ :'signed_up_at' => :'signedUpAt',
35
+ :'profile' => :'profile',
36
+ :'metadata' => :'metadata',
37
+ :'identities' => :'identities'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'id' => :'String',
45
+ :'external_id' => :'String',
46
+ :'signed_up_at' => :'String',
47
+ :'profile' => :'Profile',
48
+ :'metadata' => :'Object',
49
+ :'identities' => :'Array<Identity>'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ :'external_id',
57
+ ])
58
+ end
59
+
60
+ # List of class defined in allOf (OpenAPI v3)
61
+ def self.openapi_all_of
62
+ [
63
+ :'User2AllOf',
64
+ :'UserTruncated'
65
+ ]
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::User2` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::User2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'id')
84
+ self.id = attributes[:'id']
85
+ end
86
+
87
+ if attributes.key?(:'external_id')
88
+ self.external_id = attributes[:'external_id']
89
+ end
90
+
91
+ if attributes.key?(:'signed_up_at')
92
+ self.signed_up_at = attributes[:'signed_up_at']
93
+ end
94
+
95
+ if attributes.key?(:'profile')
96
+ self.profile = attributes[:'profile']
97
+ end
98
+
99
+ if attributes.key?(:'metadata')
100
+ self.metadata = attributes[:'metadata']
101
+ end
102
+
103
+ if attributes.key?(:'identities')
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ id == o.id &&
126
+ external_id == o.external_id &&
127
+ signed_up_at == o.signed_up_at &&
128
+ profile == o.profile &&
129
+ metadata == o.metadata &&
130
+ identities == o.identities
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [id, external_id, signed_up_at, profile, metadata, identities].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ SunshineConversationsClient.const_get(type).build_from_hash(value)
210
+ end
211
+ end
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_hash (backward compatibility)
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ if value.nil?
232
+ is_nullable = self.class.openapi_nullable.include?(attr)
233
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
234
+ end
235
+
236
+ hash[param] = _to_hash(value)
237
+ end
238
+ hash
239
+ end
240
+
241
+ # Outputs non-array value in the form of hash
242
+ # For object, use to_hash. Otherwise, just return the value
243
+ # @param [Object] value Any valid value
244
+ # @return [Hash] Returns the value in the form of hash
245
+ def _to_hash(value)
246
+ if value.is_a?(Array)
247
+ value.compact.map { |v| _to_hash(v) }
248
+ elsif value.is_a?(Hash)
249
+ {}.tap do |hash|
250
+ value.each { |k, v| hash[k] = _to_hash(v) }
251
+ end
252
+ elsif value.respond_to? :to_hash
253
+ value.to_hash
254
+ else
255
+ value
256
+ end
257
+ end
258
+ end
259
+ end
@@ -0,0 +1,230 @@
1
+ =begin
2
+ #Sunshine Conversations API
3
+
4
+ The version of the OpenAPI document: 12.3.0
5
+
6
+ Generated by: https://openapi-generator.tech
7
+ OpenAPI Generator version: 4.3.1
8
+ =end
9
+
10
+ require 'date'
11
+
12
+ module SunshineConversationsClient
13
+ class User2AllOf
14
+ attr_accessor :signed_up_at
15
+
16
+ attr_accessor :profile
17
+
18
+ attr_accessor :metadata
19
+
20
+ # The user's connected identities.
21
+ attr_accessor :identities
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'signed_up_at' => :'signedUpAt',
27
+ :'profile' => :'profile',
28
+ :'metadata' => :'metadata',
29
+ :'identities' => :'identities'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'signed_up_at' => :'String',
37
+ :'profile' => :'Profile',
38
+ :'metadata' => :'Object',
39
+ :'identities' => :'Array<Identity>'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::User2AllOf` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::User2AllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'signed_up_at')
65
+ self.signed_up_at = attributes[:'signed_up_at']
66
+ end
67
+
68
+ if attributes.key?(:'profile')
69
+ self.profile = attributes[:'profile']
70
+ end
71
+
72
+ if attributes.key?(:'metadata')
73
+ self.metadata = attributes[:'metadata']
74
+ end
75
+
76
+ if attributes.key?(:'identities')
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ signed_up_at == o.signed_up_at &&
99
+ profile == o.profile &&
100
+ metadata == o.metadata &&
101
+ identities == o.identities
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [signed_up_at, profile, metadata, identities].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ new.build_from_hash(attributes)
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.openapi_types.each_pair do |key, type|
129
+ if type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :DateTime
150
+ DateTime.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ SunshineConversationsClient.const_get(type).build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+ end
230
+ end