sib-api-v3-sdk 7.5.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +130 -4
  4. data/docs/Body.md +9 -0
  5. data/docs/Body1.md +9 -0
  6. data/docs/Body10.md +11 -0
  7. data/docs/{SendTemplateEmail.md → Body11.md} +2 -2
  8. data/docs/Body12.md +11 -0
  9. data/docs/Body2.md +11 -0
  10. data/docs/Body3.md +9 -0
  11. data/docs/Body4.md +9 -0
  12. data/docs/Body5.md +11 -0
  13. data/docs/Body6.md +18 -0
  14. data/docs/Body7.md +17 -0
  15. data/docs/Body8.md +13 -0
  16. data/docs/Body9.md +8 -0
  17. data/docs/CompaniesApi.md +425 -0
  18. data/docs/CompaniesList.md +8 -0
  19. data/docs/Company.md +11 -0
  20. data/docs/CompanyAttributes.md +7 -0
  21. data/docs/CompanyAttributesInner.md +12 -0
  22. data/docs/ContactsApi.md +69 -4
  23. data/docs/ConversationsApi.md +542 -0
  24. data/docs/ConversationsMessage.md +17 -0
  25. data/docs/ConversationsMessageFile.md +12 -0
  26. data/docs/ConversationsMessageFileImageInfo.md +10 -0
  27. data/docs/CreateContact.md +1 -1
  28. data/docs/CreateSmsCampaign.md +1 -0
  29. data/docs/CreateSubAccount.md +11 -0
  30. data/docs/CreateSubAccountResponse.md +8 -0
  31. data/docs/CreateWebhook.md +2 -1
  32. data/docs/Deal.md +11 -0
  33. data/docs/DealAttributes.md +7 -0
  34. data/docs/DealAttributesInner.md +12 -0
  35. data/docs/DealsApi.md +476 -0
  36. data/docs/DealsList.md +8 -0
  37. data/docs/EmailCampaignsApi.md +6 -5
  38. data/docs/FileData.md +14 -0
  39. data/docs/FileDownloadableLink.md +8 -0
  40. data/docs/FileList.md +7 -0
  41. data/docs/FilesApi.md +318 -0
  42. data/docs/GetCampaignStats.md +3 -0
  43. data/docs/GetContactCampaignStats.md +1 -0
  44. data/docs/GetExtendedContactDetailsStatistics.md +1 -0
  45. data/docs/GetExtendedContactDetailsStatisticsDelivered.md +9 -0
  46. data/docs/GetInboundEmailEvents.md +8 -0
  47. data/docs/GetInboundEmailEventsByUuid.md +15 -0
  48. data/docs/GetInboundEmailEventsByUuidAttachments.md +11 -0
  49. data/docs/GetInboundEmailEventsByUuidLogs.md +9 -0
  50. data/docs/GetInboundEmailEventsEvents.md +11 -0
  51. data/docs/GetScheduledEmailByBatchId.md +9 -0
  52. data/docs/GetScheduledEmailByBatchIdBatches.md +10 -0
  53. data/docs/GetScheduledEmailByMessageId.md +10 -0
  54. data/docs/GetSsoToken.md +1 -1
  55. data/docs/InboundParsingApi.md +199 -0
  56. data/docs/InlineResponse200.md +8 -0
  57. data/docs/InlineResponse201.md +8 -0
  58. data/docs/InlineResponse2011.md +8 -0
  59. data/docs/MasterAccountApi.md +424 -0
  60. data/docs/MasterDetailsResponse.md +14 -0
  61. data/docs/MasterDetailsResponseBillingInfo.md +11 -0
  62. data/docs/MasterDetailsResponseBillingInfoAddress.md +12 -0
  63. data/docs/MasterDetailsResponseBillingInfoName.md +9 -0
  64. data/docs/MasterDetailsResponsePlanInfo.md +13 -0
  65. data/docs/MasterDetailsResponsePlanInfoFeatures.md +12 -0
  66. data/docs/Note.md +14 -0
  67. data/docs/NoteData.md +10 -0
  68. data/docs/NoteId.md +8 -0
  69. data/docs/NoteList.md +7 -0
  70. data/docs/NotesApi.md +312 -0
  71. data/docs/Pipeline.md +8 -0
  72. data/docs/PipelineStage.md +9 -0
  73. data/docs/RequestContactExport.md +1 -2
  74. data/docs/RequestContactImport.md +3 -2
  75. data/docs/ScheduleSmtpEmail.md +10 -0
  76. data/docs/SendSmtpEmail.md +6 -4
  77. data/docs/SendTransacSms.md +1 -0
  78. data/docs/SsoTokenRequest.md +9 -0
  79. data/docs/SubAccountDetailsResponse.md +11 -0
  80. data/docs/SubAccountDetailsResponsePlanInfo.md +10 -0
  81. data/docs/SubAccountDetailsResponsePlanInfoCredits.md +9 -0
  82. data/docs/SubAccountDetailsResponsePlanInfoCreditsEmails.md +9 -0
  83. data/docs/SubAccountDetailsResponsePlanInfoFeatures.md +10 -0
  84. data/docs/SubAccountDetailsResponsePlanInfoFeaturesInbox.md +9 -0
  85. data/docs/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md +9 -0
  86. data/docs/SubAccountDetailsResponsePlanInfoFeaturesUsers.md +9 -0
  87. data/docs/SubAccountUpdatePlanRequest.md +9 -0
  88. data/docs/SubAccountUpdatePlanRequestCredits.md +8 -0
  89. data/docs/SubAccountUpdatePlanRequestFeatures.md +10 -0
  90. data/docs/SubAccountsResponse.md +9 -0
  91. data/docs/SubAccountsResponseSubAccounts.md +11 -0
  92. data/docs/Task.md +13 -0
  93. data/docs/TaskList.md +8 -0
  94. data/docs/TaskReminder.md +10 -0
  95. data/docs/TaskTypes.md +9 -0
  96. data/docs/TasksApi.md +376 -0
  97. data/docs/TransactionalEmailsApi.md +203 -63
  98. data/docs/UpdateBatchContacts.md +8 -0
  99. data/docs/UpdateBatchContactsContacts.md +16 -0
  100. data/docs/UpdateBatchContactsModel.md +9 -0
  101. data/docs/UpdateContact.md +1 -1
  102. data/docs/UpdateEmailCampaign.md +1 -1
  103. data/docs/UpdateSmsCampaign.md +1 -0
  104. data/docs/UpdateSmtpTemplate.md +1 -1
  105. data/docs/UpdateWebhook.md +2 -1
  106. data/docs/UploadImageModel.md +8 -0
  107. data/lib/sib-api-v3-sdk/api/companies_api.rb +409 -0
  108. data/lib/sib-api-v3-sdk/api/contacts_api.rb +61 -2
  109. data/lib/sib-api-v3-sdk/api/conversations_api.rb +504 -0
  110. data/lib/sib-api-v3-sdk/api/deals_api.rb +454 -0
  111. data/lib/sib-api-v3-sdk/api/email_campaigns_api.rb +9 -8
  112. data/lib/sib-api-v3-sdk/api/files_api.rb +313 -0
  113. data/lib/sib-api-v3-sdk/api/inbound_parsing_api.rb +213 -0
  114. data/lib/sib-api-v3-sdk/api/master_account_api.rb +416 -0
  115. data/lib/sib-api-v3-sdk/api/notes_api.rb +308 -0
  116. data/lib/sib-api-v3-sdk/api/tasks_api.rb +375 -0
  117. data/lib/sib-api-v3-sdk/api/transactional_emails_api.rb +201 -62
  118. data/lib/sib-api-v3-sdk/api/webhooks_api.rb +2 -2
  119. data/lib/sib-api-v3-sdk/models/{send_email_attachment.rb → body.rb} +16 -40
  120. data/lib/sib-api-v3-sdk/models/body_1.rb +195 -0
  121. data/lib/sib-api-v3-sdk/models/body_10.rb +225 -0
  122. data/lib/sib-api-v3-sdk/models/{send_template_email.rb → body_11.rb} +12 -12
  123. data/lib/sib-api-v3-sdk/models/body_12.rb +215 -0
  124. data/lib/sib-api-v3-sdk/models/body_2.rb +223 -0
  125. data/lib/sib-api-v3-sdk/models/body_3.rb +200 -0
  126. data/lib/sib-api-v3-sdk/models/body_4.rb +195 -0
  127. data/lib/sib-api-v3-sdk/models/body_5.rb +223 -0
  128. data/lib/sib-api-v3-sdk/models/body_6.rb +320 -0
  129. data/lib/sib-api-v3-sdk/models/body_7.rb +281 -0
  130. data/lib/sib-api-v3-sdk/models/body_8.rb +245 -0
  131. data/lib/sib-api-v3-sdk/models/body_9.rb +190 -0
  132. data/lib/sib-api-v3-sdk/models/companies_list.rb +188 -0
  133. data/lib/sib-api-v3-sdk/models/{send_email.rb → company.rb} +30 -90
  134. data/lib/sib-api-v3-sdk/models/company_attributes.rb +176 -0
  135. data/lib/sib-api-v3-sdk/models/company_attributes_inner.rb +223 -0
  136. data/lib/sib-api-v3-sdk/models/conversations_message.rb +324 -0
  137. data/lib/sib-api-v3-sdk/models/conversations_message_file.rb +239 -0
  138. data/lib/sib-api-v3-sdk/models/conversations_message_file_image_info.rb +236 -0
  139. data/lib/sib-api-v3-sdk/models/create_contact.rb +1 -1
  140. data/lib/sib-api-v3-sdk/models/create_sms_campaign.rb +16 -4
  141. data/lib/sib-api-v3-sdk/models/create_sub_account.rb +259 -0
  142. data/lib/sib-api-v3-sdk/models/create_sub_account_response.rb +190 -0
  143. data/lib/sib-api-v3-sdk/models/create_webhook.rb +17 -7
  144. data/lib/sib-api-v3-sdk/models/deal.rb +220 -0
  145. data/lib/sib-api-v3-sdk/models/deal_attributes.rb +176 -0
  146. data/lib/sib-api-v3-sdk/models/deal_attributes_inner.rb +223 -0
  147. data/lib/sib-api-v3-sdk/models/deals_list.rb +188 -0
  148. data/lib/sib-api-v3-sdk/models/file_data.rb +246 -0
  149. data/lib/sib-api-v3-sdk/models/file_downloadable_link.rb +190 -0
  150. data/lib/sib-api-v3-sdk/models/file_list.rb +176 -0
  151. data/lib/sib-api-v3-sdk/models/get_campaign_stats.rb +36 -1
  152. data/lib/sib-api-v3-sdk/models/get_contact_campaign_stats.rb +15 -4
  153. data/lib/sib-api-v3-sdk/models/get_email_event_report_events.rb +2 -2
  154. data/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics.rb +16 -4
  155. data/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_delivered.rb +205 -0
  156. data/lib/sib-api-v3-sdk/models/get_inbound_email_events.rb +186 -0
  157. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_by_uuid.rb +259 -0
  158. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_by_uuid_attachments.rb +215 -0
  159. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_by_uuid_logs.rb +229 -0
  160. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_events.rb +235 -0
  161. data/lib/sib-api-v3-sdk/models/get_scheduled_email_by_batch_id.rb +196 -0
  162. data/lib/sib-api-v3-sdk/models/get_scheduled_email_by_batch_id_batches.rb +254 -0
  163. data/lib/sib-api-v3-sdk/models/get_scheduled_email_by_message_id.rb +254 -0
  164. data/lib/sib-api-v3-sdk/models/get_sso_token.rb +1 -1
  165. data/lib/sib-api-v3-sdk/models/inline_response_200.rb +191 -0
  166. data/lib/sib-api-v3-sdk/models/inline_response_201.rb +191 -0
  167. data/lib/sib-api-v3-sdk/models/inline_response_201_1.rb +191 -0
  168. data/lib/sib-api-v3-sdk/models/master_details_response.rb +243 -0
  169. data/lib/sib-api-v3-sdk/models/master_details_response_billing_info.rb +214 -0
  170. data/lib/sib-api-v3-sdk/models/master_details_response_billing_info_address.rb +226 -0
  171. data/lib/sib-api-v3-sdk/models/master_details_response_billing_info_name.rb +196 -0
  172. data/lib/sib-api-v3-sdk/models/master_details_response_plan_info.rb +272 -0
  173. data/lib/sib-api-v3-sdk/models/master_details_response_plan_info_features.rb +225 -0
  174. data/lib/sib-api-v3-sdk/models/note.rb +283 -0
  175. data/lib/sib-api-v3-sdk/models/note_data.rb +243 -0
  176. data/lib/sib-api-v3-sdk/models/note_id.rb +186 -0
  177. data/lib/sib-api-v3-sdk/models/note_list.rb +176 -0
  178. data/lib/sib-api-v3-sdk/models/pipeline.rb +188 -0
  179. data/lib/sib-api-v3-sdk/models/pipeline_stage.rb +196 -0
  180. data/lib/sib-api-v3-sdk/models/request_contact_export.rb +6 -11
  181. data/lib/sib-api-v3-sdk/models/request_contact_export_custom_contact_filter.rb +1 -1
  182. data/lib/sib-api-v3-sdk/models/request_contact_import.rb +15 -3
  183. data/lib/sib-api-v3-sdk/models/schedule_smtp_email.rb +206 -0
  184. data/lib/sib-api-v3-sdk/models/send_smtp_email.rb +28 -8
  185. data/lib/sib-api-v3-sdk/models/send_transac_sms.rb +16 -4
  186. data/lib/sib-api-v3-sdk/models/sso_token_request.rb +200 -0
  187. data/lib/sib-api-v3-sdk/models/sub_account_details_response.rb +214 -0
  188. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info.rb +204 -0
  189. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits.rb +195 -0
  190. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits_emails.rb +196 -0
  191. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features.rb +203 -0
  192. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features_inbox.rb +196 -0
  193. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features_landing_page.rb +196 -0
  194. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features_users.rb +196 -0
  195. data/lib/sib-api-v3-sdk/models/sub_account_update_plan_request.rb +194 -0
  196. data/lib/sib-api-v3-sdk/models/sub_account_update_plan_request_credits.rb +186 -0
  197. data/lib/sib-api-v3-sdk/models/sub_account_update_plan_request_features.rb +206 -0
  198. data/lib/sib-api-v3-sdk/models/sub_accounts_response.rb +196 -0
  199. data/lib/sib-api-v3-sdk/models/sub_accounts_response_sub_accounts.rb +235 -0
  200. data/lib/sib-api-v3-sdk/models/task.rb +252 -0
  201. data/lib/sib-api-v3-sdk/models/task_list.rb +188 -0
  202. data/lib/sib-api-v3-sdk/models/task_reminder.rb +257 -0
  203. data/lib/sib-api-v3-sdk/models/task_types.rb +196 -0
  204. data/lib/sib-api-v3-sdk/models/update_batch_contacts.rb +187 -0
  205. data/lib/sib-api-v3-sdk/models/update_batch_contacts_contacts.rb +273 -0
  206. data/lib/sib-api-v3-sdk/models/update_batch_contacts_model.rb +197 -0
  207. data/lib/sib-api-v3-sdk/models/update_contact.rb +1 -1
  208. data/lib/sib-api-v3-sdk/models/update_email_campaign.rb +1 -1
  209. data/lib/sib-api-v3-sdk/models/update_sms_campaign.rb +16 -4
  210. data/lib/sib-api-v3-sdk/models/update_smtp_template.rb +1 -1
  211. data/lib/sib-api-v3-sdk/models/update_webhook.rb +15 -5
  212. data/lib/sib-api-v3-sdk/models/upload_image_model.rb +190 -0
  213. data/lib/sib-api-v3-sdk/version.rb +1 -1
  214. data/lib/sib-api-v3-sdk.rb +84 -3
  215. data/sib-api-v3-sdk.gemspec +2 -1
  216. data/spec/api/companies_api_spec.rb +119 -0
  217. data/spec/api/contacts_api_spec.rb +15 -1
  218. data/spec/api/conversations_api_spec.rb +140 -0
  219. data/spec/api/deals_api_spec.rb +129 -0
  220. data/spec/api/email_campaigns_api_spec.rb +1 -1
  221. data/spec/api/files_api_spec.rb +99 -0
  222. data/spec/api/inbound_parsing_api_spec.rb +76 -0
  223. data/spec/api/master_account_api_spec.rb +119 -0
  224. data/spec/api/notes_api_spec.rb +97 -0
  225. data/spec/api/tasks_api_spec.rb +113 -0
  226. data/spec/api/transactional_emails_api_spec.rb +46 -13
  227. data/spec/models/body_10_spec.rb +59 -0
  228. data/spec/models/{send_template_email_spec.rb → body_11_spec.rb} +7 -7
  229. data/spec/models/body_12_spec.rb +59 -0
  230. data/spec/models/{send_email_attachment_spec.rb → body_1_spec.rb} +8 -8
  231. data/spec/models/body_2_spec.rb +59 -0
  232. data/spec/models/body_3_spec.rb +47 -0
  233. data/spec/models/body_4_spec.rb +47 -0
  234. data/spec/models/body_5_spec.rb +59 -0
  235. data/spec/models/body_6_spec.rb +101 -0
  236. data/spec/models/body_7_spec.rb +95 -0
  237. data/spec/models/body_8_spec.rb +71 -0
  238. data/spec/models/body_9_spec.rb +41 -0
  239. data/spec/models/body_spec.rb +47 -0
  240. data/spec/models/companies_list_spec.rb +41 -0
  241. data/spec/models/company_attributes_inner_spec.rb +65 -0
  242. data/spec/models/company_attributes_spec.rb +35 -0
  243. data/spec/models/company_spec.rb +59 -0
  244. data/spec/models/conversations_message_file_image_info_spec.rb +53 -0
  245. data/spec/models/conversations_message_file_spec.rb +65 -0
  246. data/spec/models/conversations_message_spec.rb +99 -0
  247. data/spec/models/create_sms_campaign_spec.rb +6 -0
  248. data/spec/models/create_sub_account_response_spec.rb +41 -0
  249. data/spec/models/create_sub_account_spec.rb +63 -0
  250. data/spec/models/create_webhook_spec.rb +8 -2
  251. data/spec/models/deal_attributes_inner_spec.rb +65 -0
  252. data/spec/models/deal_attributes_spec.rb +35 -0
  253. data/spec/models/deal_spec.rb +59 -0
  254. data/spec/models/deals_list_spec.rb +41 -0
  255. data/spec/models/file_data_spec.rb +77 -0
  256. data/spec/models/file_downloadable_link_spec.rb +41 -0
  257. data/spec/models/file_list_spec.rb +35 -0
  258. data/spec/models/get_campaign_stats_spec.rb +18 -0
  259. data/spec/models/get_contact_campaign_stats_spec.rb +6 -0
  260. data/spec/models/get_email_event_report_events_spec.rb +1 -1
  261. data/spec/models/get_extended_contact_details_statistics_delivered_spec.rb +47 -0
  262. data/spec/models/get_extended_contact_details_statistics_spec.rb +6 -0
  263. data/spec/models/get_inbound_email_events_by_uuid_attachments_spec.rb +59 -0
  264. data/spec/models/get_inbound_email_events_by_uuid_logs_spec.rb +51 -0
  265. data/spec/models/get_inbound_email_events_by_uuid_spec.rb +83 -0
  266. data/spec/models/get_inbound_email_events_events_spec.rb +59 -0
  267. data/spec/models/get_inbound_email_events_spec.rb +41 -0
  268. data/spec/models/get_scheduled_email_by_batch_id_batches_spec.rb +57 -0
  269. data/spec/models/get_scheduled_email_by_batch_id_spec.rb +47 -0
  270. data/spec/models/get_scheduled_email_by_message_id_spec.rb +57 -0
  271. data/spec/models/inline_response_200_spec.rb +41 -0
  272. data/spec/models/inline_response_201_1_spec.rb +41 -0
  273. data/spec/models/inline_response_201_spec.rb +41 -0
  274. data/spec/models/master_details_response_billing_info_address_spec.rb +65 -0
  275. data/spec/models/master_details_response_billing_info_name_spec.rb +47 -0
  276. data/spec/models/master_details_response_billing_info_spec.rb +59 -0
  277. data/spec/models/master_details_response_plan_info_features_spec.rb +65 -0
  278. data/spec/models/master_details_response_plan_info_spec.rb +75 -0
  279. data/spec/models/master_details_response_spec.rb +77 -0
  280. data/spec/models/note_data_spec.rb +53 -0
  281. data/spec/models/note_id_spec.rb +41 -0
  282. data/spec/models/note_list_spec.rb +35 -0
  283. data/spec/models/note_spec.rb +77 -0
  284. data/spec/models/pipeline_spec.rb +41 -0
  285. data/spec/models/pipeline_stage_spec.rb +47 -0
  286. data/spec/models/request_contact_export_spec.rb +0 -6
  287. data/spec/models/request_contact_import_spec.rb +6 -0
  288. data/spec/models/schedule_smtp_email_spec.rb +53 -0
  289. data/spec/models/send_smtp_email_spec.rb +12 -0
  290. data/spec/models/send_transac_sms_spec.rb +6 -0
  291. data/spec/models/sso_token_request_spec.rb +47 -0
  292. data/spec/models/sub_account_details_response_plan_info_credits_emails_spec.rb +47 -0
  293. data/spec/models/sub_account_details_response_plan_info_credits_spec.rb +47 -0
  294. data/spec/models/sub_account_details_response_plan_info_features_inbox_spec.rb +47 -0
  295. data/spec/models/sub_account_details_response_plan_info_features_landing_page_spec.rb +47 -0
  296. data/spec/models/sub_account_details_response_plan_info_features_spec.rb +53 -0
  297. data/spec/models/sub_account_details_response_plan_info_features_users_spec.rb +47 -0
  298. data/spec/models/sub_account_details_response_plan_info_spec.rb +53 -0
  299. data/spec/models/sub_account_details_response_spec.rb +59 -0
  300. data/spec/models/sub_account_update_plan_request_credits_spec.rb +41 -0
  301. data/spec/models/sub_account_update_plan_request_features_spec.rb +53 -0
  302. data/spec/models/sub_account_update_plan_request_spec.rb +47 -0
  303. data/spec/models/sub_accounts_response_spec.rb +47 -0
  304. data/spec/models/sub_accounts_response_sub_accounts_spec.rb +59 -0
  305. data/spec/models/task_list_spec.rb +41 -0
  306. data/spec/models/task_reminder_spec.rb +57 -0
  307. data/spec/models/task_spec.rb +71 -0
  308. data/spec/models/task_types_spec.rb +47 -0
  309. data/spec/models/{send_email_spec.rb → update_batch_contacts_contacts_spec.rb} +15 -15
  310. data/spec/models/update_batch_contacts_model_spec.rb +47 -0
  311. data/spec/models/update_batch_contacts_spec.rb +41 -0
  312. data/spec/models/update_sms_campaign_spec.rb +6 -0
  313. data/spec/models/update_webhook_spec.rb +7 -1
  314. data/spec/models/upload_image_model_spec.rb +41 -0
  315. metadata +359 -15
  316. data/docs/SendEmail.md +0 -16
  317. data/docs/SendEmailAttachment.md +0 -9
@@ -0,0 +1,283 @@
1
+ =begin
2
+ #SendinBlue API
3
+
4
+ #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
5
+
6
+ OpenAPI spec version: 3.0.0
7
+ Contact: contact@sendinblue.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SibApiV3Sdk
16
+ # Note Details
17
+ class Note
18
+ # Unique note Id
19
+ attr_accessor :id
20
+
21
+ # Text content of a note
22
+ attr_accessor :text
23
+
24
+ # Contact ids linked to a note
25
+ attr_accessor :contact_ids
26
+
27
+ # Deal ids linked to a note
28
+ attr_accessor :deal_ids
29
+
30
+ # Account details of user which created the note
31
+ attr_accessor :author_id
32
+
33
+ # Note created date/time
34
+ attr_accessor :created_at
35
+
36
+ # Note updated date/time
37
+ attr_accessor :updated_at
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'id' => :'id',
43
+ :'text' => :'text',
44
+ :'contact_ids' => :'contactIds',
45
+ :'deal_ids' => :'dealIds',
46
+ :'author_id' => :'authorId',
47
+ :'created_at' => :'createdAt',
48
+ :'updated_at' => :'updatedAt'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'id' => :'String',
56
+ :'text' => :'String',
57
+ :'contact_ids' => :'Array<Integer>',
58
+ :'deal_ids' => :'Array<String>',
59
+ :'author_id' => :'Object',
60
+ :'created_at' => :'DateTime',
61
+ :'updated_at' => :'DateTime'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ if attributes.has_key?(:'id')
74
+ self.id = attributes[:'id']
75
+ end
76
+
77
+ if attributes.has_key?(:'text')
78
+ self.text = attributes[:'text']
79
+ end
80
+
81
+ if attributes.has_key?(:'contactIds')
82
+ if (value = attributes[:'contactIds']).is_a?(Array)
83
+ self.contact_ids = value
84
+ end
85
+ end
86
+
87
+ if attributes.has_key?(:'dealIds')
88
+ if (value = attributes[:'dealIds']).is_a?(Array)
89
+ self.deal_ids = value
90
+ end
91
+ end
92
+
93
+ if attributes.has_key?(:'authorId')
94
+ self.author_id = attributes[:'authorId']
95
+ end
96
+
97
+ if attributes.has_key?(:'createdAt')
98
+ self.created_at = attributes[:'createdAt']
99
+ end
100
+
101
+ if attributes.has_key?(:'updatedAt')
102
+ self.updated_at = attributes[:'updatedAt']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ if @text.nil?
111
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
112
+ end
113
+
114
+ if @text.to_s.length > 3000
115
+ invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 3000.')
116
+ end
117
+
118
+ if @text.to_s.length < 1
119
+ invalid_properties.push('invalid value for "text", the character length must be great than or equal to 1.')
120
+ end
121
+
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ return false if @text.nil?
129
+ return false if @text.to_s.length > 3000
130
+ return false if @text.to_s.length < 1
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] text Value to be assigned
136
+ def text=(text)
137
+ if text.nil?
138
+ fail ArgumentError, 'text cannot be nil'
139
+ end
140
+
141
+ if text.to_s.length > 3000
142
+ fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 3000.'
143
+ end
144
+
145
+ if text.to_s.length < 1
146
+ fail ArgumentError, 'invalid value for "text", the character length must be great than or equal to 1.'
147
+ end
148
+
149
+ @text = text
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ id == o.id &&
158
+ text == o.text &&
159
+ contact_ids == o.contact_ids &&
160
+ deal_ids == o.deal_ids &&
161
+ author_id == o.author_id &&
162
+ created_at == o.created_at &&
163
+ updated_at == o.updated_at
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Fixnum] Hash code
174
+ def hash
175
+ [id, text, contact_ids, deal_ids, author_id, created_at, updated_at].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :BOOLEAN
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ temp_model = SibApiV3Sdk.const_get(type).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map { |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+
282
+ end
283
+ end
@@ -0,0 +1,243 @@
1
+ =begin
2
+ #SendinBlue API
3
+
4
+ #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
5
+
6
+ OpenAPI spec version: 3.0.0
7
+ Contact: contact@sendinblue.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SibApiV3Sdk
16
+ # Note data to be saved
17
+ class NoteData
18
+ # Text content of a note
19
+ attr_accessor :text
20
+
21
+ # Contact Ids linked to a note
22
+ attr_accessor :contact_ids
23
+
24
+ # Deal Ids linked to a note
25
+ attr_accessor :deal_ids
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'text' => :'text',
31
+ :'contact_ids' => :'contactIds',
32
+ :'deal_ids' => :'dealIds'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'text' => :'String',
40
+ :'contact_ids' => :'Array<Integer>',
41
+ :'deal_ids' => :'Array<String>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'text')
54
+ self.text = attributes[:'text']
55
+ end
56
+
57
+ if attributes.has_key?(:'contactIds')
58
+ if (value = attributes[:'contactIds']).is_a?(Array)
59
+ self.contact_ids = value
60
+ end
61
+ end
62
+
63
+ if attributes.has_key?(:'dealIds')
64
+ if (value = attributes[:'dealIds']).is_a?(Array)
65
+ self.deal_ids = value
66
+ end
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ if @text.nil?
75
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
76
+ end
77
+
78
+ if @text.to_s.length > 3000
79
+ invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 3000.')
80
+ end
81
+
82
+ if @text.to_s.length < 1
83
+ invalid_properties.push('invalid value for "text", the character length must be great than or equal to 1.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @text.nil?
93
+ return false if @text.to_s.length > 3000
94
+ return false if @text.to_s.length < 1
95
+ true
96
+ end
97
+
98
+ # Custom attribute writer method with validation
99
+ # @param [Object] text Value to be assigned
100
+ def text=(text)
101
+ if text.nil?
102
+ fail ArgumentError, 'text cannot be nil'
103
+ end
104
+
105
+ if text.to_s.length > 3000
106
+ fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 3000.'
107
+ end
108
+
109
+ if text.to_s.length < 1
110
+ fail ArgumentError, 'invalid value for "text", the character length must be great than or equal to 1.'
111
+ end
112
+
113
+ @text = text
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ text == o.text &&
122
+ contact_ids == o.contact_ids &&
123
+ deal_ids == o.deal_ids
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [text, contact_ids, deal_ids].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.swagger_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :DateTime
165
+ DateTime.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :BOOLEAN
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ temp_model = SibApiV3Sdk.const_get(type).new
196
+ temp_model.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ next if value.nil?
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+ end
@@ -0,0 +1,186 @@
1
+ =begin
2
+ #SendinBlue API
3
+
4
+ #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
5
+
6
+ OpenAPI spec version: 3.0.0
7
+ Contact: contact@sendinblue.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SibApiV3Sdk
16
+ # Updated Note ID
17
+ class NoteId
18
+ # Unique note Id
19
+ attr_accessor :id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id' => :'id'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'id' => :'String'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
42
+
43
+ if attributes.has_key?(:'id')
44
+ self.id = attributes[:'id']
45
+ end
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properties with the reasons
50
+ def list_invalid_properties
51
+ invalid_properties = Array.new
52
+ invalid_properties
53
+ end
54
+
55
+ # Check to see if the all the properties in the model are valid
56
+ # @return true if the model is valid
57
+ def valid?
58
+ true
59
+ end
60
+
61
+ # Checks equality by comparing each attribute.
62
+ # @param [Object] Object to be compared
63
+ def ==(o)
64
+ return true if self.equal?(o)
65
+ self.class == o.class &&
66
+ id == o.id
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [id].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+ self.class.swagger_types.each_pair do |key, type|
87
+ if type =~ /\AArray<(.*)>/i
88
+ # check to ensure the input is an array given that the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
92
+ end
93
+ elsif !attributes[self.class.attribute_map[key]].nil?
94
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
95
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
96
+ end
97
+
98
+ self
99
+ end
100
+
101
+ # Deserializes the data based on type
102
+ # @param string type Data type
103
+ # @param string value Value to be deserialized
104
+ # @return [Object] Deserialized data
105
+ def _deserialize(type, value)
106
+ case type.to_sym
107
+ when :DateTime
108
+ DateTime.parse(value)
109
+ when :Date
110
+ Date.parse(value)
111
+ when :String
112
+ value.to_s
113
+ when :Integer
114
+ value.to_i
115
+ when :Float
116
+ value.to_f
117
+ when :BOOLEAN
118
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
119
+ true
120
+ else
121
+ false
122
+ end
123
+ when :Object
124
+ # generic object (usually a Hash), return directly
125
+ value
126
+ when /\AArray<(?<inner_type>.+)>\z/
127
+ inner_type = Regexp.last_match[:inner_type]
128
+ value.map { |v| _deserialize(inner_type, v) }
129
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
130
+ k_type = Regexp.last_match[:k_type]
131
+ v_type = Regexp.last_match[:v_type]
132
+ {}.tap do |hash|
133
+ value.each do |k, v|
134
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
135
+ end
136
+ end
137
+ else # model
138
+ temp_model = SibApiV3Sdk.const_get(type).new
139
+ temp_model.build_from_hash(value)
140
+ end
141
+ end
142
+
143
+ # Returns the string representation of the object
144
+ # @return [String] String presentation of the object
145
+ def to_s
146
+ to_hash.to_s
147
+ end
148
+
149
+ # to_body is an alias to to_hash (backward compatibility)
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_body
152
+ to_hash
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ next if value.nil?
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map { |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+
185
+ end
186
+ end