sendpost_ruby_sdk 2.0.0 → 3.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 (354) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +613 -529
  3. data/docs/AccountCycleUsage.md +18 -0
  4. data/docs/AccountStats.md +3 -3
  5. data/docs/AccountWebhookWithStats.md +58 -0
  6. data/docs/AggregateStat.md +14 -14
  7. data/docs/AggregateStats.md +22 -22
  8. data/docs/Attachment.md +4 -4
  9. data/docs/BlacklistLinks.md +20 -0
  10. data/docs/BlacklistResource.md +38 -0
  11. data/docs/BlacklistedOn.md +20 -0
  12. data/docs/CopyTo.md +6 -6
  13. data/docs/CreateDomainRequest.md +2 -2
  14. data/docs/CreateSuppressionRequest.md +4 -4
  15. data/docs/CreateSuppressionRequestHardBounceInner.md +1 -1
  16. data/docs/CreateSuppressionRequestManualInner.md +1 -1
  17. data/docs/CreateSuppressionRequestSpamComplaintInner.md +1 -1
  18. data/docs/CreateSuppressionRequestUnsubscribeInner.md +1 -1
  19. data/docs/DailyStatistics.md +38 -0
  20. data/docs/DateStat.md +40 -0
  21. data/docs/DeleteResponse.md +4 -4
  22. data/docs/DeleteSubAccountResponse.md +4 -4
  23. data/docs/{DeleteSuppression200ResponseInner.md → DeleteSuppression200Response.md} +2 -4
  24. data/docs/DeleteSuppressionRequest.md +1 -1
  25. data/docs/{EmailMessageReplyTo.md → DeleteSuppressionRequestSuppressionsInner.md} +3 -5
  26. data/docs/DeleteWebhookResponse.md +3 -3
  27. data/docs/Device.md +2 -2
  28. data/docs/DnsRecord.md +22 -0
  29. data/docs/Domain.md +24 -28
  30. data/docs/DomainApi.md +66 -66
  31. data/docs/DomainStat.md +46 -0
  32. data/docs/EIP.md +1 -1
  33. data/docs/EmailAddress.md +4 -4
  34. data/docs/EmailApi.md +4 -4
  35. data/docs/EmailMessage.md +30 -30
  36. data/docs/EmailMessageObject.md +33 -26
  37. data/docs/EmailMessageWithTemplate.md +32 -27
  38. data/docs/EmailResponse.md +10 -10
  39. data/docs/EmailTypeStat.md +40 -0
  40. data/docs/ErrorResponse.md +18 -0
  41. data/docs/ErrorResponseError.md +26 -0
  42. data/docs/ErrorResponseErrorDetailsInner.md +20 -0
  43. data/docs/Event.md +18 -36
  44. data/docs/EventMetadata.md +14 -14
  45. data/docs/GeoLocation.md +8 -8
  46. data/docs/GroupStat.md +40 -0
  47. data/docs/IP.md +13 -43
  48. data/docs/IPAllocationRequest.md +4 -4
  49. data/docs/IPApi.md +19 -19
  50. data/docs/IPDeletionResponse.md +2 -2
  51. data/docs/IPPool.md +13 -21
  52. data/docs/IPPoolCreateRequest.md +10 -8
  53. data/docs/IPPoolDeleteResponse.md +2 -2
  54. data/docs/IPPoolStat.md +44 -0
  55. data/docs/IPPoolUpdateRequest.md +13 -7
  56. data/docs/IPPoolsApi.md +26 -19
  57. data/docs/IPStat.md +46 -0
  58. data/docs/IPUpdateRequest.md +2 -2
  59. data/docs/Label.md +10 -6
  60. data/docs/Member.md +15 -21
  61. data/docs/Message.md +37 -53
  62. data/docs/MessageApi.md +83 -3
  63. data/docs/NewSubAccount.md +18 -0
  64. data/docs/NewWebhook.md +46 -0
  65. data/docs/Os.md +26 -0
  66. data/docs/PostmasterDomainStat.md +30 -0
  67. data/docs/ProviderStat.md +40 -0
  68. data/docs/RAIPPoolStat.md +20 -0
  69. data/docs/RDStat.md +20 -0
  70. data/docs/RIPStat.md +20 -0
  71. data/docs/RStat.md +20 -0
  72. data/docs/Recipient.md +8 -8
  73. data/docs/SDStat.md +42 -0
  74. data/docs/SMTPAuth.md +5 -9
  75. data/docs/SeedContactStats.md +28 -0
  76. data/docs/Stat.md +22 -4
  77. data/docs/StatsAApi.md +24 -24
  78. data/docs/StatsApi.md +19 -19
  79. data/docs/SubAccount.md +13 -27
  80. data/docs/SubAccountApi.md +23 -23
  81. data/docs/SubAccountStat.md +44 -0
  82. data/docs/SubAccountStatForPool.md +42 -0
  83. data/docs/Suppression.md +14 -10
  84. data/docs/SuppressionApi.md +19 -19
  85. data/docs/TPSPStat.md +42 -0
  86. data/docs/UpdateSubAccount.md +2 -2
  87. data/docs/UpdateWebhook.md +23 -23
  88. data/docs/UserAgent.md +7 -7
  89. data/docs/ValidationStat.md +32 -0
  90. data/docs/Webhook.md +31 -29
  91. data/docs/WebhookApi.md +28 -28
  92. data/docs/WebhookObject.md +20 -0
  93. data/docs/WebhookReferenceApi.md +71 -0
  94. data/lib/sendpost_ruby_sdk/api/domain_api.rb +84 -84
  95. data/lib/sendpost_ruby_sdk/api/email_api.rb +6 -6
  96. data/lib/sendpost_ruby_sdk/api/ip_api.rb +24 -24
  97. data/lib/sendpost_ruby_sdk/api/ip_pools_api.rb +25 -25
  98. data/lib/sendpost_ruby_sdk/api/message_api.rb +83 -6
  99. data/lib/sendpost_ruby_sdk/api/stats_a_api.rb +30 -30
  100. data/lib/sendpost_ruby_sdk/api/stats_api.rb +24 -24
  101. data/lib/sendpost_ruby_sdk/api/sub_account_api.rb +33 -33
  102. data/lib/sendpost_ruby_sdk/api/suppression_api.rb +23 -23
  103. data/lib/sendpost_ruby_sdk/api/webhook_api.rb +36 -36
  104. data/lib/sendpost_ruby_sdk/api/webhook_reference_api.rb +82 -0
  105. data/lib/sendpost_ruby_sdk/api_client.rb +2 -2
  106. data/lib/sendpost_ruby_sdk/api_error.rb +2 -2
  107. data/lib/sendpost_ruby_sdk/configuration.rb +2 -2
  108. data/lib/sendpost_ruby_sdk/models/account_cycle_usage.rb +222 -0
  109. data/lib/sendpost_ruby_sdk/models/account_stats.rb +5 -3
  110. data/lib/sendpost_ruby_sdk/models/account_webhook_with_stats.rb +463 -0
  111. data/lib/sendpost_ruby_sdk/models/aggregate_stat.rb +37 -29
  112. data/lib/sendpost_ruby_sdk/models/aggregate_stats.rb +43 -24
  113. data/lib/sendpost_ruby_sdk/models/attachment.rb +48 -4
  114. data/lib/sendpost_ruby_sdk/models/blacklist_links.rb +232 -0
  115. data/lib/sendpost_ruby_sdk/models/blacklist_resource.rb +323 -0
  116. data/lib/sendpost_ruby_sdk/models/blacklisted_on.rb +232 -0
  117. data/lib/sendpost_ruby_sdk/models/copy_to.rb +42 -3
  118. data/lib/sendpost_ruby_sdk/models/create_domain_request.rb +32 -3
  119. data/lib/sendpost_ruby_sdk/models/create_suppression_request.rb +6 -6
  120. data/lib/sendpost_ruby_sdk/models/create_suppression_request_hard_bounce_inner.rb +2 -2
  121. data/lib/sendpost_ruby_sdk/models/create_suppression_request_manual_inner.rb +2 -2
  122. data/lib/sendpost_ruby_sdk/models/create_suppression_request_spam_complaint_inner.rb +2 -2
  123. data/lib/sendpost_ruby_sdk/models/create_suppression_request_unsubscribe_inner.rb +2 -2
  124. data/lib/sendpost_ruby_sdk/models/daily_statistics.rb +322 -0
  125. data/lib/sendpost_ruby_sdk/models/date_stat.rb +339 -0
  126. data/lib/sendpost_ruby_sdk/models/delete_response.rb +5 -4
  127. data/lib/sendpost_ruby_sdk/models/delete_sub_account_response.rb +5 -4
  128. data/lib/sendpost_ruby_sdk/models/delete_suppression200_response.rb +221 -0
  129. data/lib/sendpost_ruby_sdk/models/delete_suppression_request.rb +4 -3
  130. data/lib/sendpost_ruby_sdk/models/delete_suppression_request_suppressions_inner.rb +220 -0
  131. data/lib/sendpost_ruby_sdk/models/delete_webhook_response.rb +5 -4
  132. data/lib/sendpost_ruby_sdk/models/device.rb +5 -3
  133. data/lib/sendpost_ruby_sdk/models/dns_record.rb +276 -0
  134. data/lib/sendpost_ruby_sdk/models/domain.rb +42 -56
  135. data/lib/sendpost_ruby_sdk/models/domain_stat.rb +369 -0
  136. data/lib/sendpost_ruby_sdk/models/eip.rb +4 -3
  137. data/lib/sendpost_ruby_sdk/models/email_address.rb +41 -2
  138. data/lib/sendpost_ruby_sdk/models/email_message.rb +26 -9
  139. data/lib/sendpost_ruby_sdk/models/email_message_object.rb +123 -3
  140. data/lib/sendpost_ruby_sdk/models/email_message_with_template.rb +121 -12
  141. data/lib/sendpost_ruby_sdk/models/email_response.rb +8 -4
  142. data/lib/sendpost_ruby_sdk/models/email_type_stat.rb +339 -0
  143. data/lib/sendpost_ruby_sdk/models/error_response.rb +221 -0
  144. data/lib/sendpost_ruby_sdk/models/error_response_error.rb +297 -0
  145. data/lib/sendpost_ruby_sdk/models/error_response_error_details_inner.rb +231 -0
  146. data/lib/sendpost_ruby_sdk/models/event.rb +94 -118
  147. data/lib/sendpost_ruby_sdk/models/event_metadata.rb +15 -5
  148. data/lib/sendpost_ruby_sdk/models/geo_location.rb +20 -14
  149. data/lib/sendpost_ruby_sdk/models/group_stat.rb +339 -0
  150. data/lib/sendpost_ruby_sdk/models/ip.rb +72 -223
  151. data/lib/sendpost_ruby_sdk/models/ip_allocation_request.rb +29 -33
  152. data/lib/sendpost_ruby_sdk/models/ip_deletion_response.rb +5 -4
  153. data/lib/sendpost_ruby_sdk/models/ip_pool.rb +100 -66
  154. data/lib/sendpost_ruby_sdk/models/ip_pool_create_request.rb +101 -9
  155. data/lib/sendpost_ruby_sdk/models/ip_pool_delete_response.rb +5 -2
  156. data/lib/sendpost_ruby_sdk/models/ip_pool_stat.rb +359 -0
  157. data/lib/sendpost_ruby_sdk/models/ip_pool_update_request.rb +97 -7
  158. data/lib/sendpost_ruby_sdk/models/ip_stat.rb +369 -0
  159. data/lib/sendpost_ruby_sdk/models/ip_update_request.rb +4 -20
  160. data/lib/sendpost_ruby_sdk/models/label.rb +101 -6
  161. data/lib/sendpost_ruby_sdk/models/member.rb +49 -57
  162. data/lib/sendpost_ruby_sdk/models/message.rb +39 -120
  163. data/lib/sendpost_ruby_sdk/models/new_sub_account.rb +257 -0
  164. data/lib/sendpost_ruby_sdk/models/new_webhook.rb +407 -0
  165. data/lib/sendpost_ruby_sdk/models/os.rb +262 -0
  166. data/lib/sendpost_ruby_sdk/models/postmaster_domain_stat.rb +282 -0
  167. data/lib/sendpost_ruby_sdk/models/provider_stat.rb +339 -0
  168. data/lib/sendpost_ruby_sdk/models/r_stat.rb +231 -0
  169. data/lib/sendpost_ruby_sdk/models/raip_pool_stat.rb +231 -0
  170. data/lib/sendpost_ruby_sdk/models/rd_stat.rb +231 -0
  171. data/lib/sendpost_ruby_sdk/models/recipient.rb +82 -3
  172. data/lib/sendpost_ruby_sdk/models/rip_stat.rb +231 -0
  173. data/lib/sendpost_ruby_sdk/models/sd_stat.rb +349 -0
  174. data/lib/sendpost_ruby_sdk/models/seed_contact_stats.rb +281 -0
  175. data/lib/sendpost_ruby_sdk/models/smtp_auth.rb +10 -29
  176. data/lib/sendpost_ruby_sdk/models/stat.rb +108 -16
  177. data/lib/sendpost_ruby_sdk/models/sub_account.rb +57 -115
  178. data/lib/sendpost_ruby_sdk/models/sub_account_stat.rb +359 -0
  179. data/lib/sendpost_ruby_sdk/models/sub_account_stat_for_pool.rb +349 -0
  180. data/lib/sendpost_ruby_sdk/models/suppression.rb +82 -15
  181. data/lib/sendpost_ruby_sdk/models/tpsp_stat.rb +349 -0
  182. data/lib/sendpost_ruby_sdk/models/update_sub_account.rb +32 -3
  183. data/lib/sendpost_ruby_sdk/models/update_webhook.rb +83 -37
  184. data/lib/sendpost_ruby_sdk/models/user_agent.rb +11 -6
  185. data/lib/sendpost_ruby_sdk/models/validation_stat.rb +292 -0
  186. data/lib/sendpost_ruby_sdk/models/webhook.rb +108 -67
  187. data/lib/sendpost_ruby_sdk/models/webhook_object.rb +232 -0
  188. data/lib/sendpost_ruby_sdk/version.rb +3 -3
  189. data/lib/sendpost_ruby_sdk.rb +36 -26
  190. data/sendpost_ruby_sdk.gemspec +39 -0
  191. data/spec/api/webhook_reference_api_spec.rb +46 -0
  192. data/spec/models/account_cycle_usage_spec.rb +36 -0
  193. data/spec/models/account_webhook_with_stats_spec.rb +160 -0
  194. data/spec/models/blacklist_links_spec.rb +42 -0
  195. data/spec/models/blacklist_resource_spec.rb +96 -0
  196. data/spec/models/blacklisted_on_spec.rb +42 -0
  197. data/spec/models/daily_statistics_spec.rb +96 -0
  198. data/spec/models/date_stat_spec.rb +102 -0
  199. data/spec/models/delete_suppression200_response_spec.rb +36 -0
  200. data/spec/models/delete_suppression_request_suppressions_inner_spec.rb +36 -0
  201. data/spec/models/dns_record_spec.rb +52 -0
  202. data/spec/models/domain_stat_spec.rb +120 -0
  203. data/spec/models/email_type_stat_spec.rb +102 -0
  204. data/spec/models/error_response_error_details_inner_spec.rb +42 -0
  205. data/spec/models/error_response_error_spec.rb +64 -0
  206. data/spec/models/error_response_spec.rb +36 -0
  207. data/spec/models/group_stat_spec.rb +102 -0
  208. data/spec/models/ip_pool_stat_spec.rb +114 -0
  209. data/spec/models/ip_stat_spec.rb +120 -0
  210. data/spec/models/new_sub_account_spec.rb +36 -0
  211. data/spec/models/new_webhook_spec.rb +120 -0
  212. data/spec/models/os_spec.rb +60 -0
  213. data/spec/models/postmaster_domain_stat_spec.rb +72 -0
  214. data/spec/models/provider_stat_spec.rb +102 -0
  215. data/spec/models/r_stat_spec.rb +42 -0
  216. data/spec/models/raip_pool_stat_spec.rb +42 -0
  217. data/spec/models/rd_stat_spec.rb +42 -0
  218. data/spec/models/rip_stat_spec.rb +42 -0
  219. data/spec/models/sd_stat_spec.rb +108 -0
  220. data/spec/models/seed_contact_stats_spec.rb +66 -0
  221. data/spec/models/sub_account_stat_for_pool_spec.rb +108 -0
  222. data/spec/models/sub_account_stat_spec.rb +114 -0
  223. data/spec/models/tpsp_stat_spec.rb +108 -0
  224. data/spec/models/validation_stat_spec.rb +78 -0
  225. data/spec/models/webhook_object_spec.rb +42 -0
  226. data/spec/spec_helper.rb +2 -2
  227. metadata +144 -212
  228. data/LICENSE +0 -21
  229. data/docs/AccountStatsStat.md +0 -38
  230. data/docs/AggregatedEmailStats.md +0 -38
  231. data/docs/AutoWarmupPlan.md +0 -80
  232. data/docs/CreateSubAccountRequest.md +0 -18
  233. data/docs/CreateWebhookRequest.md +0 -46
  234. data/docs/DomainDkim.md +0 -22
  235. data/docs/DomainDmarc.md +0 -22
  236. data/docs/DomainGpt.md +0 -22
  237. data/docs/DomainReturnPath.md +0 -22
  238. data/docs/DomainTrack.md +0 -22
  239. data/docs/EmailMessageFrom.md +0 -20
  240. data/docs/EmailMessageToInner.md +0 -26
  241. data/docs/EmailMessageToInnerBccInner.md +0 -22
  242. data/docs/EmailMessageToInnerCcInner.md +0 -22
  243. data/docs/EmailStats.md +0 -20
  244. data/docs/EmailStatsStats.md +0 -38
  245. data/docs/MessageHeaderTo.md +0 -26
  246. data/docs/MessageTo.md +0 -26
  247. data/docs/OperatingSystem.md +0 -26
  248. data/docs/Person.md +0 -20
  249. data/docs/StatStats.md +0 -38
  250. data/docs/ThirdPartySendingProvider.md +0 -38
  251. data/lib/sendpost_ruby_sdk/models/account_stats_stat.rb +0 -310
  252. data/lib/sendpost_ruby_sdk/models/aggregated_email_stats.rb +0 -321
  253. data/lib/sendpost_ruby_sdk/models/auto_warmup_plan.rb +0 -531
  254. data/lib/sendpost_ruby_sdk/models/create_sub_account_request.rb +0 -221
  255. data/lib/sendpost_ruby_sdk/models/create_webhook_request.rb +0 -361
  256. data/lib/sendpost_ruby_sdk/models/delete_suppression200_response_inner.rb +0 -231
  257. data/lib/sendpost_ruby_sdk/models/domain_dkim.rb +0 -239
  258. data/lib/sendpost_ruby_sdk/models/domain_dmarc.rb +0 -239
  259. data/lib/sendpost_ruby_sdk/models/domain_gpt.rb +0 -239
  260. data/lib/sendpost_ruby_sdk/models/domain_return_path.rb +0 -239
  261. data/lib/sendpost_ruby_sdk/models/domain_track.rb +0 -239
  262. data/lib/sendpost_ruby_sdk/models/email_message_from.rb +0 -229
  263. data/lib/sendpost_ruby_sdk/models/email_message_reply_to.rb +0 -229
  264. data/lib/sendpost_ruby_sdk/models/email_message_to_inner.rb +0 -262
  265. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_bcc_inner.rb +0 -240
  266. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_cc_inner.rb +0 -240
  267. data/lib/sendpost_ruby_sdk/models/email_stats.rb +0 -230
  268. data/lib/sendpost_ruby_sdk/models/email_stats_stats.rb +0 -321
  269. data/lib/sendpost_ruby_sdk/models/message_header_to.rb +0 -268
  270. data/lib/sendpost_ruby_sdk/models/message_to.rb +0 -268
  271. data/lib/sendpost_ruby_sdk/models/operating_system.rb +0 -256
  272. data/lib/sendpost_ruby_sdk/models/person.rb +0 -231
  273. data/lib/sendpost_ruby_sdk/models/stat_stats.rb +0 -321
  274. data/lib/sendpost_ruby_sdk/models/third_party_sending_provider.rb +0 -310
  275. data/spec/api/domain_api_spec.rb +0 -85
  276. data/spec/api/email_api_spec.rb +0 -59
  277. data/spec/api/ip_api_spec.rb +0 -98
  278. data/spec/api/ip_pools_api_spec.rb +0 -98
  279. data/spec/api/message_api_spec.rb +0 -47
  280. data/spec/api/stats_a_api_spec.rb +0 -89
  281. data/spec/api/stats_api_spec.rb +0 -78
  282. data/spec/api/sub_account_api_spec.rb +0 -98
  283. data/spec/api/suppression_api_spec.rb +0 -76
  284. data/spec/api/webhook_api_spec.rb +0 -98
  285. data/spec/models/account_stats_spec.rb +0 -42
  286. data/spec/models/account_stats_stat_spec.rb +0 -96
  287. data/spec/models/aggregate_stat_spec.rb +0 -96
  288. data/spec/models/aggregate_stats_spec.rb +0 -96
  289. data/spec/models/aggregated_email_stats_spec.rb +0 -96
  290. data/spec/models/attachment_spec.rb +0 -42
  291. data/spec/models/auto_warmup_plan_spec.rb +0 -222
  292. data/spec/models/copy_to_spec.rb +0 -48
  293. data/spec/models/create_domain_request_spec.rb +0 -36
  294. data/spec/models/create_sub_account_request_spec.rb +0 -36
  295. data/spec/models/create_suppression_request_hard_bounce_inner_spec.rb +0 -36
  296. data/spec/models/create_suppression_request_manual_inner_spec.rb +0 -36
  297. data/spec/models/create_suppression_request_spam_complaint_inner_spec.rb +0 -36
  298. data/spec/models/create_suppression_request_spec.rb +0 -54
  299. data/spec/models/create_suppression_request_unsubscribe_inner_spec.rb +0 -36
  300. data/spec/models/create_webhook_request_spec.rb +0 -120
  301. data/spec/models/delete_response_spec.rb +0 -42
  302. data/spec/models/delete_sub_account_response_spec.rb +0 -42
  303. data/spec/models/delete_suppression200_response_inner_spec.rb +0 -42
  304. data/spec/models/delete_suppression_request_spec.rb +0 -36
  305. data/spec/models/delete_webhook_response_spec.rb +0 -42
  306. data/spec/models/device_spec.rb +0 -36
  307. data/spec/models/domain_dkim_spec.rb +0 -48
  308. data/spec/models/domain_dmarc_spec.rb +0 -48
  309. data/spec/models/domain_gpt_spec.rb +0 -48
  310. data/spec/models/domain_return_path_spec.rb +0 -48
  311. data/spec/models/domain_spec.rb +0 -150
  312. data/spec/models/domain_track_spec.rb +0 -48
  313. data/spec/models/eip_spec.rb +0 -36
  314. data/spec/models/email_address_spec.rb +0 -42
  315. data/spec/models/email_message_from_spec.rb +0 -42
  316. data/spec/models/email_message_object_spec.rb +0 -120
  317. data/spec/models/email_message_reply_to_spec.rb +0 -42
  318. data/spec/models/email_message_spec.rb +0 -138
  319. data/spec/models/email_message_to_inner_bcc_inner_spec.rb +0 -48
  320. data/spec/models/email_message_to_inner_cc_inner_spec.rb +0 -48
  321. data/spec/models/email_message_to_inner_spec.rb +0 -60
  322. data/spec/models/email_message_with_template_spec.rb +0 -138
  323. data/spec/models/email_response_spec.rb +0 -60
  324. data/spec/models/email_stats_spec.rb +0 -42
  325. data/spec/models/email_stats_stats_spec.rb +0 -96
  326. data/spec/models/event_metadata_spec.rb +0 -84
  327. data/spec/models/event_spec.rb +0 -150
  328. data/spec/models/geo_location_spec.rb +0 -60
  329. data/spec/models/ip_allocation_request_spec.rb +0 -42
  330. data/spec/models/ip_deletion_response_spec.rb +0 -42
  331. data/spec/models/ip_pool_create_request_spec.rb +0 -66
  332. data/spec/models/ip_pool_delete_response_spec.rb +0 -42
  333. data/spec/models/ip_pool_spec.rb +0 -108
  334. data/spec/models/ip_pool_update_request_spec.rb +0 -54
  335. data/spec/models/ip_spec.rb +0 -168
  336. data/spec/models/ip_update_request_spec.rb +0 -36
  337. data/spec/models/label_spec.rb +0 -48
  338. data/spec/models/member_spec.rb +0 -102
  339. data/spec/models/message_header_to_spec.rb +0 -60
  340. data/spec/models/message_spec.rb +0 -210
  341. data/spec/models/message_to_spec.rb +0 -60
  342. data/spec/models/operating_system_spec.rb +0 -60
  343. data/spec/models/person_spec.rb +0 -42
  344. data/spec/models/recipient_spec.rb +0 -60
  345. data/spec/models/smtp_auth_spec.rb +0 -60
  346. data/spec/models/stat_spec.rb +0 -42
  347. data/spec/models/stat_stats_spec.rb +0 -96
  348. data/spec/models/sub_account_spec.rb +0 -130
  349. data/spec/models/suppression_spec.rb +0 -60
  350. data/spec/models/third_party_sending_provider_spec.rb +0 -96
  351. data/spec/models/update_sub_account_spec.rb +0 -36
  352. data/spec/models/update_webhook_spec.rb +0 -120
  353. data/spec/models/user_agent_spec.rb +0 -54
  354. data/spec/models/webhook_spec.rb +0 -144
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #SendPost API
3
3
 
4
- ## Introduction SendPost provides email API and SMTP relay which can be used not just to send & measure but also alert & optimised email sending. You can use SendPost to: * Send personalised emails to multiple recipients using email API * Track opens and clicks * Analyse statistics around open, clicks, bounce, unsubscribe and spam At and advanced level you can use it to: * Manage multiple sub-accounts which may map to your promotional or transactional sending, multiple product lines or multiple customers * Classify your emails using groups for better analysis * Analyse and fix email sending at sub-account level, IP Pool level or group level * Have automated alerts to notify disruptions regarding email sending * Manage different dedicated IP Pools so to better control your email sending * Automatically know when IP or domain is blacklisted or sender score is down * Leverage pro deliverability tools to get significantly better email deliverability & inboxing [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e) # Overview ## REST API SendPost API is built on REST API principles. Authenticated users can interact with any of the API endpoints to perform: * **GET**- to get a resource * **POST** - to create a resource * **PUT** - to update an existing resource * **DELETE** - to delete a resource The API endpoint for all API calls is: <code>https://api.sendpost.io/api/v1</code> Some conventions that have been followed in the API design overall are following: * All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. * All resource endpoints end with singular name and not plural. So we have <code>domain</code> instead of domains for domain resource endpoint. Likewise we have <code>sender</code> instead of senders for sender resource endpoint. * Body submitted for POST / PUT API calls as well as JSON response from SendPost API follow camelcase convention * All timestamps returned in response (created or submittedAt response fields) are UNIX nano epoch timestamp. <aside class=\"success\"> All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. </aside> SendPost uses conventional HTTP response codes to indicate the success or failure of an API request. * Codes in the <code>2xx</code> range indicate success. * Codes in the <code>4xx</code> range indicate an error owing due to unauthorize access, incorrect request parameters or body etc. * Code in the <code>5xx</code> range indicate an eror with SendPost's servers ( internal service issue or maintenance ) <aside class=\"info\"> SendPost all responses return <code>created</code> in UNIX nano epoch timestamp. </aside> ## Authentication SendPost uses API keys for authentication. You can register a new SendPost API key at our [developer portal](https://app.sendpost.io/register). SendPost expects the API key to be included in all API requests to the server in a header that looks like the following: `X-SubAccount-ApiKey: AHEZEP8192SEGH` This API key is used for all Sub-Account level operations such as: * Sending emails * Retrieving stats regarding open, click, bounce, unsubscribe and spam * Uploading suppressions list * Verifying sending domains and more In addition to <code>X-SubAccount-ApiKey</code> you also have another API Key <code>X-Account-APIKey</code> which is used for Account level operations such as : * Creating and managing sub-accounts * Allocating IPs for your account * Getting overall billing and usage information * Email List validation * Creating and managing alerts and more <aside class=\"notice\"> You must look at individual API reference page to look at whether <code>X-SubAccount-ApiKey</code> is required or <code>X-Account-ApiKey</code> </aside> In case an incorrect API Key header is specified or if it is missed you will get HTTP Response 401 ( Unauthorized ) response from SendPost. ## HTTP Response Headers Code | Reason | Details ---------------| -----------------------| ----------- 200 | Success | Everything went well 401 | Unauthorized | Incorrect or missing API header either <code>X-SubAccount-ApiKey</code> or <code>X-Account-ApiKey</code> 403 | Forbidden | Typically sent when resource with same name or details already exist 406 | Missing resource id | Resource id specified is either missing or doesn't exist 422 | Unprocessable entity | Request body is not in proper format 500 | Internal server error | Some error happened at SendPost while processing API request 503 | Service Unavailable | SendPost is offline for maintenance. Please try again later # API SDKs We have native SendPost SDKs in the following programming languages. You can integrate with them or create your own SDK with our API specification. In case you need any assistance with respect to API then do reachout to our team from website chat or email us at **hello@sendpost.io** * [PHP](https://github.com/sendpost/sendpost_php_sdk) * [Javascript](https://github.com/sendpost/sendpost_javascript_sdk) * [Ruby](https://github.com/sendpost/sendpost_ruby_sdk) * [Python](https://github.com/sendpost/sendpost_python_sdk) * [Golang](https://github.com/sendpost/sendpost_go_sdk) # API Reference SendX REST API can be broken down into two major sub-sections: * Sub-Account * Account Sub-Account API operations enable common email sending API use-cases like sending bulk email, adding new domains or senders for email sending programmatically, retrieving stats, adding suppressions etc. All Sub-Account API operations need to pass <code>X-SubAccount-ApiKey</code> header with every API call. The Account API operations allow users to manage multiple sub-accounts and manage IPs. A single parent SendPost account can have 100's of sub-accounts. You may want to create sub-accounts for different products your company is running or to segregate types of emails or for managing email sending across multiple customers of yours. # SMTP Reference Simple Mail Transfer Protocol (SMTP) is a quick and easy way to send email from one server to another. SendPost provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server. This means you can count on SendPost's delivery at scale for your SMTP needs. ## Integrating SMTP 1. Get the SMTP `username` and `password` from your SendPost account. 2. Set the server host in your email client or application to `smtp.sendpost.io`. This setting is sometimes referred to as the external SMTP server or the SMTP relay. 3. Set the `username` and `password`. 4. Set the port to `587` (or as specified below). ## SMTP Ports - For an unencrypted or a TLS connection, use port `25`, `2525` or `587`. - For a SSL connection, use port `465` - Check your firewall and network to ensure they're not blocking any of our SMTP Endpoints. SendPost supports STARTTLS for establishing a TLS-encrypted connection. STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined in [RFC 3207](https://www.ietf.org/rfc/rfc3207.txt). To set up a STARTTLS connection, the SMTP client connects to the SendPost SMTP endpoint `smtp.sendpost.io` on port 25, 587, or 2525, issues an EHLO command, and waits for the server to announce that it supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new encrypted connection, and the SMTP session proceeds normally. <aside class=\"success\"> If you are unsure which port to use, a TLS connection on port 587 is typically recommended. </aside> ## Sending email from your application ```javascript \"use strict\"; const nodemailer = require(\"nodemailer\"); async function main() { // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: \"smtp.sendpost.io\", port: 587, secure: false, // true for 465, false for other ports auth: { user: \"<username>\" , // generated ethereal user pass: \"<password>\", // generated ethereal password }, requireTLS: true, debug: true, logger: true, }); // send mail with defined transport object try { let info = await transporter.sendMail({ from: 'erlich@piedpiper.com', to: 'gilfoyle@piedpiper.com', subject: 'Test Email Subject', html: '<h1>Hello Geeks!!!</h1>', }); console.log(\"Message sent: %s\", info.messageId); } catch (e) { console.log(e) } } main().catch(console.error); ``` For PHP ```php <?php // Import PHPMailer classes into the global namespace use PHPMailer\\PHPMailer\\PHPMailer; use PHPMailer\\PHPMailer\\SMTP; use PHPMailer\\PHPMailer\\Exception; // Load Composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true); // Settings try { $mail->SMTPDebug = SMTP::DEBUG_CONNECTION; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'smtp.sendpost.io'; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '<username>'; // SMTP username $mail->Password = '<password>'; // SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption $mail->Port = 587; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('erlich@piedpiper.com', 'Erlich'); $mail->addAddress('gilfoyle@piedpiper.com', 'Gilfoyle'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\"; } ``` For Python ```python #!/usr/bin/python3 import sys import os import re from smtplib import SMTP import ssl from email.mime.text import MIMEText SMTPserver = 'smtp.sendpost.io' PORT = 587 sender = 'erlich@piedpiper.com' destination = ['gilfoyle@piedpiper.com'] USERNAME = \"<username>\" PASSWORD = \"<password>\" # typical values for text_subtype are plain, html, xml text_subtype = 'plain' content=\"\"\"\\ Test message \"\"\" subject=\"Sent from Python\" try: msg = MIMEText(content, text_subtype) msg['Subject']= subject msg['From'] = sender conn = SMTP(SMTPserver, PORT) conn.ehlo() context = ssl.create_default_context() conn.starttls(context=context) # upgrade to tls conn.ehlo() conn.set_debuglevel(True) conn.login(USERNAME, PASSWORD) try: resp = conn.sendmail(sender, destination, msg.as_string()) print(\"Send Mail Response: \", resp) except Exception as e: print(\"Send Email Error: \", e) finally: conn.quit() except Exception as e: print(\"Error:\", e) ``` For Golang ```go package main import ( \"fmt\" \"net/smtp\" \"os\" ) // Sending Email Using Smtp in Golang func main() { username := \"<username>\" password := \"<password>\" from := \"erlich@piedpiper.com\" toList := []string{\"gilfoyle@piedpiper.com\"} host := \"smtp.sendpost.io\" port := \"587\" // recommended // This is the message to send in the mail msg := \"Hello geeks!!!\" // We can't send strings directly in mail, // strings need to be converted into slice bytes body := []byte(msg) // PlainAuth uses the given username and password to // authenticate to host and act as identity. // Usually identity should be the empty string, // to act as username. auth := smtp.PlainAuth(\"\", username, password, host) // SendMail uses TLS connection to send the mail // The email is sent to all address in the toList, // the body should be of type bytes, not strings // This returns error if any occured. err := smtp.SendMail(host+\":\"+port, auth, from, toList, body) // handling the errors if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(\"Successfully sent mail to all user in toList\") } ``` For Java ```java // implementation 'com.sun.mail:javax.mail:1.6.2' import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SMTPConnect { // This address must be verified. static final String FROM = \"erlich@piedpiper.com\"; static final String FROMNAME = \"Erlich Bachman\"; // Replace recipient@example.com with a \"To\" address. If your account // is still in the sandbox, this address must be verified. static final String TO = \"gilfoyle@piedpiper.com\"; // Replace smtp_username with your SendPost SMTP user name. static final String SMTP_USERNAME = \"<username>\"; // Replace smtp_password with your SendPost SMTP password. static final String SMTP_PASSWORD = \"<password>\"; // SMTP Host Name static final String HOST = \"smtp.sendpost.io\"; // The port you will connect to on SendPost SMTP Endpoint. static final int PORT = 587; static final String SUBJECT = \"SendPost SMTP Test (SMTP interface accessed using Java)\"; static final String BODY = String.join( System.getProperty(\"line.separator\"), \"<h1>SendPost SMTP Test</h1>\", \"<p>This email was sent with SendPost using the \", \"<a href='https://github.com/eclipse-ee4j/mail'>Javamail Package</a>\", \" for <a href='https://www.java.com'>Java</a>.\" ); public static void main(String[] args) throws Exception { // Create a Properties object to contain connection configuration information. Properties props = System.getProperties(); props.put(\"mail.transport.protocol\", \"smtp\"); props.put(\"mail.smtp.port\", PORT); props.put(\"mail.smtp.starttls.enable\", \"true\"); props.put(\"mail.smtp.debug\", \"true\"); props.put(\"mail.smtp.auth\", \"true\"); // Create a Session object to represent a mail session with the specified properties. Session session = Session.getDefaultInstance(props); // Create a message with the specified information. MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(FROM,FROMNAME)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); msg.setSubject(SUBJECT); msg.setContent(BODY,\"text/html\"); // Create a transport. Transport transport = session.getTransport(); // Send the message. try { System.out.println(\"Sending...\"); // Connect to SendPost SMTP using the SMTP username and password you specified above. transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); // Send the email. transport.sendMessage(msg, msg.getAllRecipients()); System.out.println(\"Email sent!\"); } catch (Exception ex) { System.out.println(\"The email was not sent.\"); System.out.println(\"Error message: \" + ex.getMessage()); System.out.println(ex); } // Close and terminate the connection. } } ``` Many programming languages support sending email using SMTP. This capability might be built into the programming language itself, or it might be available as an add-on, plug-in, or library. You can take advantage of this capability by sending email through SendPost from within application programs that you write. We have provided examples in Python3, Golang, Java, PHP, JS.
4
+ ## Introduction > ### 📌 API versioning & the v1 response contract > > This reference documents the **v1 response contract** — the stable, camelCase > response shape that SendPost commits to. This is the shape you should build against. > > **During the current deprecation window**, requests authenticated with an account > or sub-account API key receive the **legacy** response shape by default, so existing > integrations keep working unchanged. To receive the documented v1 shape today, send: > > ``` > X-SendPost-Public-Contract: v1 > ``` > > **How to tell which shape you got.** Every public response echoes the applied > contract in the `X-SendPost-Public-Contract` response header. While the legacy > shape is being served, responses also carry standard deprecation signals: > `Deprecation: true`, a `Sunset` header with the exact cut-over date, and a > `Link: <...>; rel=\"deprecation\"` header pointing at the migration guide. **Read the > `Sunset` header for the authoritative end date** rather than hardcoding one. > > **After the sunset date**, v1 becomes the default and the legacy shape is no longer > served. New integrations should send `X-SendPost-Public-Contract: v1` now and rely on > the shapes in this reference. SendPost provides email API and SMTP relay which can be used not just to send & measure but also alert & optimised email sending. You can use SendPost to: * Send personalised emails to multiple recipients using email API * Track opens and clicks * Analyse statistics around open, clicks, bounce, unsubscribe and spam At and advanced level you can use it to: * Manage multiple sub-accounts which may map to your promotional or transactional sending, multiple product lines or multiple customers * Classify your emails using groups for better analysis * Analyse and fix email sending at sub-account level, IP Pool level or group level * Have automated alerts to notify disruptions regarding email sending * Manage different dedicated IP Pools so to better control your email sending * Automatically know when IP or domain is blacklisted or sender score is down * Leverage pro deliverability tools to get significantly better email deliverability & inboxing [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e) # Overview ## REST API SendPost API is built on REST API principles. Authenticated users can interact with any of the API endpoints to perform: * **GET**- to get a resource * **POST** - to create a resource * **PUT** - to update an existing resource * **DELETE** - to delete a resource The API endpoint for all API calls is: <code>https://api.sendpost.io/api/v1</code> Some conventions that have been followed in the API design overall are following: * All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. * All resource endpoints end with singular name and not plural. So we have <code>domain</code> instead of domains for domain resource endpoint. Likewise we have <code>sender</code> instead of senders for sender resource endpoint. * Body submitted for POST / PUT API calls as well as JSON response from SendPost API follow camelcase convention * All timestamps returned in response (created or submittedAt response fields) are UNIX nano epoch timestamp. <aside class=\"success\"> All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. </aside> SendPost uses conventional HTTP response codes to indicate the success or failure of an API request. * Codes in the <code>2xx</code> range indicate success. * Codes in the <code>4xx</code> range indicate an error owing due to unauthorize access, incorrect request parameters or body etc. * Code in the <code>5xx</code> range indicate an eror with SendPost's servers ( internal service issue or maintenance ) <aside class=\"info\"> SendPost all responses return <code>created</code> in UNIX nano epoch timestamp. </aside> ## Authentication SendPost uses API keys for authentication. You can register a new SendPost API key at our [developer portal](https://app.sendpost.io/register). SendPost expects the API key to be included in all API requests to the server in a header that looks like the following: `X-SubAccount-ApiKey: AHEZEP8192SEGH` This API key is used for all Sub-Account level operations such as: * Sending emails * Retrieving stats regarding open, click, bounce, unsubscribe and spam * Uploading suppressions list * Verifying sending domains and more In addition to <code>X-SubAccount-ApiKey</code> you also have another API Key <code>X-Account-APIKey</code> which is used for Account level operations such as : * Creating and managing sub-accounts * Allocating IPs for your account * Getting overall billing and usage information * Email List validation * Creating and managing alerts and more <aside class=\"notice\"> You must look at individual API reference page to look at whether <code>X-SubAccount-ApiKey</code> is required or <code>X-Account-ApiKey</code> </aside> In case an incorrect API Key header is specified or if it is missed you will get HTTP Response 401 ( Unauthorized ) response from SendPost. ## HTTP Response Headers Code | Reason | Details ---------------| -----------------------| ----------- 200 | Success | Everything went well 401 | Unauthorized | Incorrect or missing API header either <code>X-SubAccount-ApiKey</code> or <code>X-Account-ApiKey</code> 403 | Forbidden | Typically sent when resource with same name or details already exist 406 | Missing resource id | Resource id specified is either missing or doesn't exist 422 | Unprocessable entity | Request body is not in proper format 500 | Internal server error | Some error happened at SendPost while processing API request 503 | Service Unavailable | SendPost is offline for maintenance. Please try again later # API SDKs We have native SendPost SDKs in the following programming languages. You can integrate with them or create your own SDK with our API specification. In case you need any assistance with respect to API then do reachout to our team from website chat or email us at **hello@sendpost.io** * [PHP](https://github.com/sendpost/sendpost_php_sdk) * [Javascript](https://github.com/sendpost/sendpost_javascript_sdk) * [Ruby](https://github.com/sendpost/sendpost_ruby_sdk) * [Python](https://github.com/sendpost/sendpost_python_sdk) * [Golang](https://github.com/sendpost/sendpost_go_sdk) # API Reference SendX REST API can be broken down into two major sub-sections: * Sub-Account * Account Sub-Account API operations enable common email sending API use-cases like sending bulk email, adding new domains or senders for email sending programmatically, retrieving stats, adding suppressions etc. All Sub-Account API operations need to pass <code>X-SubAccount-ApiKey</code> header with every API call. The Account API operations allow users to manage multiple sub-accounts and manage IPs. A single parent SendPost account can have 100's of sub-accounts. You may want to create sub-accounts for different products your company is running or to segregate types of emails or for managing email sending across multiple customers of yours. # SMTP Reference Simple Mail Transfer Protocol (SMTP) is a quick and easy way to send email from one server to another. SendPost provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server. This means you can count on SendPost's delivery at scale for your SMTP needs. ## Integrating SMTP 1. Get the SMTP `username` and `password` from your SendPost account. 2. Set the server host in your email client or application to `smtp.sendpost.io`. This setting is sometimes referred to as the external SMTP server or the SMTP relay. 3. Set the `username` and `password`. 4. Set the port to `587` (or as specified below). ## SMTP Ports - For an unencrypted or a TLS connection, use port `25`, `2525` or `587`. - For a SSL connection, use port `465` - Check your firewall and network to ensure they're not blocking any of our SMTP Endpoints. SendPost supports STARTTLS for establishing a TLS-encrypted connection. STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined in [RFC 3207](https://www.ietf.org/rfc/rfc3207.txt). To set up a STARTTLS connection, the SMTP client connects to the SendPost SMTP endpoint `smtp.sendpost.io` on port 25, 587, or 2525, issues an EHLO command, and waits for the server to announce that it supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new encrypted connection, and the SMTP session proceeds normally. <aside class=\"success\"> If you are unsure which port to use, a TLS connection on port 587 is typically recommended. </aside> ## Sending email from your application ```javascript \"use strict\"; const nodemailer = require(\"nodemailer\"); async function main() { // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: \"smtp.sendpost.io\", port: 587, secure: false, // true for 465, false for other ports auth: { user: \"<username>\" , // generated ethereal user pass: \"<password>\", // generated ethereal password }, requireTLS: true, debug: true, logger: true, }); // send mail with defined transport object try { let info = await transporter.sendMail({ from: 'erlich@piedpiper.com', to: 'gilfoyle@piedpiper.com', subject: 'Test Email Subject', html: '<h1>Hello Geeks!!!</h1>', }); console.log(\"Message sent: %s\", info.messageId); } catch (e) { console.log(e) } } main().catch(console.error); ``` For PHP ```php <?php // Import PHPMailer classes into the global namespace use PHPMailer\\PHPMailer\\PHPMailer; use PHPMailer\\PHPMailer\\SMTP; use PHPMailer\\PHPMailer\\Exception; // Load Composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true); // Settings try { $mail->SMTPDebug = SMTP::DEBUG_CONNECTION; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'smtp.sendpost.io'; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '<username>'; // SMTP username $mail->Password = '<password>'; // SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption $mail->Port = 587; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('erlich@piedpiper.com', 'Erlich'); $mail->addAddress('gilfoyle@piedpiper.com', 'Gilfoyle'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\"; } ``` For Python ```python #!/usr/bin/python3 import sys import os import re from smtplib import SMTP import ssl from email.mime.text import MIMEText SMTPserver = 'smtp.sendpost.io' PORT = 587 sender = 'erlich@piedpiper.com' destination = ['gilfoyle@piedpiper.com'] USERNAME = \"<username>\" PASSWORD = \"<password>\" # typical values for text_subtype are plain, html, xml text_subtype = 'plain' content=\"\"\"\\ Test message \"\"\" subject=\"Sent from Python\" try: msg = MIMEText(content, text_subtype) msg['Subject']= subject msg['From'] = sender conn = SMTP(SMTPserver, PORT) conn.ehlo() context = ssl.create_default_context() conn.starttls(context=context) # upgrade to tls conn.ehlo() conn.set_debuglevel(True) conn.login(USERNAME, PASSWORD) try: resp = conn.sendmail(sender, destination, msg.as_string()) print(\"Send Mail Response: \", resp) except Exception as e: print(\"Send Email Error: \", e) finally: conn.quit() except Exception as e: print(\"Error:\", e) ``` For Golang ```go package main import ( \"fmt\" \"net/smtp\" \"os\" ) // Sending Email Using Smtp in Golang func main() { username := \"<username>\" password := \"<password>\" from := \"erlich@piedpiper.com\" toList := []string{\"gilfoyle@piedpiper.com\"} host := \"smtp.sendpost.io\" port := \"587\" // recommended // This is the message to send in the mail msg := \"Hello geeks!!!\" // We can't send strings directly in mail, // strings need to be converted into slice bytes body := []byte(msg) // PlainAuth uses the given username and password to // authenticate to host and act as identity. // Usually identity should be the empty string, // to act as username. auth := smtp.PlainAuth(\"\", username, password, host) // SendMail uses TLS connection to send the mail // The email is sent to all address in the toList, // the body should be of type bytes, not strings // This returns error if any occured. err := smtp.SendMail(host+\":\"+port, auth, from, toList, body) // handling the errors if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(\"Successfully sent mail to all user in toList\") } ``` For Java ```java // implementation 'com.sun.mail:javax.mail:1.6.2' import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SMTPConnect { // This address must be verified. static final String FROM = \"erlich@piedpiper.com\"; static final String FROMNAME = \"Erlich Bachman\"; // Replace recipient@example.com with a \"To\" address. If your account // is still in the sandbox, this address must be verified. static final String TO = \"gilfoyle@piedpiper.com\"; // Replace smtp_username with your SendPost SMTP user name. static final String SMTP_USERNAME = \"<username>\"; // Replace smtp_password with your SendPost SMTP password. static final String SMTP_PASSWORD = \"<password>\"; // SMTP Host Name static final String HOST = \"smtp.sendpost.io\"; // The port you will connect to on SendPost SMTP Endpoint. static final int PORT = 587; static final String SUBJECT = \"SendPost SMTP Test (SMTP interface accessed using Java)\"; static final String BODY = String.join( System.getProperty(\"line.separator\"), \"<h1>SendPost SMTP Test</h1>\", \"<p>This email was sent with SendPost using the \", \"<a href='https://github.com/eclipse-ee4j/mail'>Javamail Package</a>\", \" for <a href='https://www.java.com'>Java</a>.\" ); public static void main(String[] args) throws Exception { // Create a Properties object to contain connection configuration information. Properties props = System.getProperties(); props.put(\"mail.transport.protocol\", \"smtp\"); props.put(\"mail.smtp.port\", PORT); props.put(\"mail.smtp.starttls.enable\", \"true\"); props.put(\"mail.smtp.debug\", \"true\"); props.put(\"mail.smtp.auth\", \"true\"); // Create a Session object to represent a mail session with the specified properties. Session session = Session.getDefaultInstance(props); // Create a message with the specified information. MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(FROM,FROMNAME)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); msg.setSubject(SUBJECT); msg.setContent(BODY,\"text/html\"); // Create a transport. Transport transport = session.getTransport(); // Send the message. try { System.out.println(\"Sending...\"); // Connect to SendPost SMTP using the SMTP username and password you specified above. transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); // Send the email. transport.sendMessage(msg, msg.getAllRecipients()); System.out.println(\"Email sent!\"); } catch (Exception ex) { System.out.println(\"The email was not sent.\"); System.out.println(\"Error message: \" + ex.getMessage()); System.out.println(ex); } // Close and terminate the connection. } } ``` Many programming languages support sending email using SMTP. This capability might be built into the programming language itself, or it might be available as an add-on, plug-in, or library. You can take advantage of this capability by sending email through SendPost from within application programs that you write. We have provided examples in Python3, Golang, Java, PHP, JS. # API Contract Versioning (Public REST) The public REST API uses a versioned response contract so field changes stay non-breaking: * Send `X-SendPost-Public-Contract: v1` to opt into the current v1 response shape, or `legacy` for the pre-v1 shape. If the header is omitted, the applied contract is policy-driven — `legacy` before the published sunset date, `v1` after it. * Every response echoes `X-SendPost-Public-Contract: <applied>`. When the `legacy` contract is served, responses also include `Deprecation: true`, `Sunset: <RFC1123 date>`, and `Link: <doc-url>; rel=\"deprecation\"`. * Migrate to `v1` before the sunset date. Notable legacy → v1 field changes: Suppression `smtp_error` → `smtpError`, Stat `email_type` → `emailType`. > `X-SendPost-Private-Api: true` is an internal header used only by the SendPost dashboard to receive richer internal objects. It is not part of the public SDK contract and should not be set by API integrations.
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.13.0
@@ -14,101 +14,65 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Sendpost
17
+ # A dedicated IP address used for sending emails. Dedicated IPs give you full control over your sender reputation, as your deliverability is not affected by other senders. **IP Warmup:** New IPs should be gradually \"warmed up\" by slowly increasing sending volume over 4-6 weeks to establish reputation with ISPs.
17
18
  class IP
18
- # Unique ID for the IP
19
+ # Unique identifier for the IP resource
19
20
  attr_accessor :id
20
21
 
21
- # The public IP address associated with the resource
22
+ # The public IPv4 address used for sending emails. This is the IP that receiving mail servers will see.
22
23
  attr_accessor :public_ip
23
24
 
24
- attr_accessor :system_domain
25
-
26
- # The reverse DNS hostname for the IP
25
+ # The reverse DNS (PTR record) hostname for this IP. Properly configured rDNS is important for deliverability. Format: sp{id}.{region}.sendpost.email
27
26
  attr_accessor :reverse_dns_hostname
28
27
 
29
- # Type of the IP
28
+ # Type of IP allocation: - `0` = Shared IP (shared with other SendPost senders, pooled reputation) - `1` = Dedicated IP (exclusive to your account, your own reputation)
30
29
  attr_accessor :type
31
30
 
32
- # Configuration for Gmail delivery settings in JSON format
33
- attr_accessor :gmail_settings
34
-
35
- # Configuration for Yahoo delivery settings in JSON format
36
- attr_accessor :yahoo_settings
37
-
38
- # Configuration for AOL delivery settings in JSON format
39
- attr_accessor :aol_settings
40
-
41
- # Configuration for Microsoft delivery settings in JSON format
42
- attr_accessor :microsoft_settings
43
-
44
- # Configuration for Comcast delivery settings in JSON format
45
- attr_accessor :comcast_settings
46
-
47
- # Configuration for Yandex delivery settings in JSON format
48
- attr_accessor :yandex_settings
49
-
50
- # Configuration for GMX delivery settings in JSON format
51
- attr_accessor :gmx_settings
52
-
53
- # Configuration for Mail.ru delivery settings in JSON format
54
- attr_accessor :mailru_settings
55
-
56
- # Configuration for iCloud delivery settings in JSON format
57
- attr_accessor :icloud_settings
31
+ # Whether automatic IP warmup is enabled. When enabled, SendPost automatically manages sending volume to gradually build reputation on this IP.
32
+ attr_accessor :auto_warmup_enabled
58
33
 
59
- # Configuration for Zoho delivery settings in JSON format
60
- attr_accessor :zoho_settings
34
+ # Custom labels/tags for organizing IPs
35
+ attr_accessor :labels
61
36
 
62
- # Configuration for QQ delivery settings in JSON format
63
- attr_accessor :qq_settings
64
-
65
- # Default delivery settings in JSON format
66
- attr_accessor :default_settings
67
-
68
- # Configuration for AT&T delivery settings in JSON format
69
- attr_accessor :att_settings
37
+ # Current state of the IP: - `0` = Warmup (IP is in warmup phase, gradually building reputation) - `1` = Normal (IP is fully warmed and ready for full sending volume)
38
+ attr_accessor :state
70
39
 
71
- # The timestamp (UNIX epoch) when the IP was created
40
+ # UNIX epoch timestamp in nanoseconds when the IP was allocated
72
41
  attr_accessor :created
73
42
 
74
- # Classification of the infrastructure
75
- attr_accessor :infra_classification
76
-
77
- # Indicates whether infrastructure monitoring is enabled
78
- attr_accessor :infra_monitor
79
-
80
- # The state of the IP
81
- attr_accessor :state
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
82
59
 
83
- # The auto-warmup plan associated with the IP. Can be null if no warmup plan is assigned.
84
- attr_accessor :auto_warmup_plan
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
85
64
 
86
65
  # Attribute mapping from ruby-style variable name to JSON key.
87
66
  def self.attribute_map
88
67
  {
89
68
  :'id' => :'id',
90
- :'public_ip' => :'publicIP',
91
- :'system_domain' => :'systemDomain',
92
- :'reverse_dns_hostname' => :'reverseDNSHostname',
69
+ :'public_ip' => :'publicIp',
70
+ :'reverse_dns_hostname' => :'reverseDnsHostname',
93
71
  :'type' => :'type',
94
- :'gmail_settings' => :'gmailSettings',
95
- :'yahoo_settings' => :'yahooSettings',
96
- :'aol_settings' => :'aolSettings',
97
- :'microsoft_settings' => :'microsoftSettings',
98
- :'comcast_settings' => :'comcastSettings',
99
- :'yandex_settings' => :'yandexSettings',
100
- :'gmx_settings' => :'gmxSettings',
101
- :'mailru_settings' => :'mailruSettings',
102
- :'icloud_settings' => :'icloudSettings',
103
- :'zoho_settings' => :'zohoSettings',
104
- :'qq_settings' => :'qqSettings',
105
- :'default_settings' => :'defaultSettings',
106
- :'att_settings' => :'attSettings',
107
- :'created' => :'created',
108
- :'infra_classification' => :'infraClassification',
109
- :'infra_monitor' => :'infraMonitor',
72
+ :'auto_warmup_enabled' => :'autoWarmupEnabled',
73
+ :'labels' => :'labels',
110
74
  :'state' => :'state',
111
- :'auto_warmup_plan' => :'autoWarmupPlan'
75
+ :'created' => :'created'
112
76
  }
113
77
  end
114
78
 
@@ -127,27 +91,12 @@ module Sendpost
127
91
  {
128
92
  :'id' => :'Integer',
129
93
  :'public_ip' => :'String',
130
- :'system_domain' => :'Domain',
131
94
  :'reverse_dns_hostname' => :'String',
132
95
  :'type' => :'Integer',
133
- :'gmail_settings' => :'String',
134
- :'yahoo_settings' => :'String',
135
- :'aol_settings' => :'String',
136
- :'microsoft_settings' => :'String',
137
- :'comcast_settings' => :'String',
138
- :'yandex_settings' => :'String',
139
- :'gmx_settings' => :'String',
140
- :'mailru_settings' => :'String',
141
- :'icloud_settings' => :'String',
142
- :'zoho_settings' => :'String',
143
- :'qq_settings' => :'String',
144
- :'default_settings' => :'String',
145
- :'att_settings' => :'String',
146
- :'created' => :'Integer',
147
- :'infra_classification' => :'String',
148
- :'infra_monitor' => :'Boolean',
96
+ :'auto_warmup_enabled' => :'Boolean',
97
+ :'labels' => :'Array<Label>',
149
98
  :'state' => :'Integer',
150
- :'auto_warmup_plan' => :'AutoWarmupPlan'
99
+ :'created' => :'Integer'
151
100
  }
152
101
  end
153
102
 
@@ -175,18 +124,10 @@ module Sendpost
175
124
 
176
125
  if attributes.key?(:'id')
177
126
  self.id = attributes[:'id']
178
- else
179
- self.id = nil
180
127
  end
181
128
 
182
129
  if attributes.key?(:'public_ip')
183
130
  self.public_ip = attributes[:'public_ip']
184
- else
185
- self.public_ip = nil
186
- end
187
-
188
- if attributes.key?(:'system_domain')
189
- self.system_domain = attributes[:'system_domain']
190
131
  end
191
132
 
192
133
  if attributes.key?(:'reverse_dns_hostname')
@@ -197,78 +138,22 @@ module Sendpost
197
138
  self.type = attributes[:'type']
198
139
  end
199
140
 
200
- if attributes.key?(:'gmail_settings')
201
- self.gmail_settings = attributes[:'gmail_settings']
202
- end
203
-
204
- if attributes.key?(:'yahoo_settings')
205
- self.yahoo_settings = attributes[:'yahoo_settings']
206
- end
207
-
208
- if attributes.key?(:'aol_settings')
209
- self.aol_settings = attributes[:'aol_settings']
210
- end
211
-
212
- if attributes.key?(:'microsoft_settings')
213
- self.microsoft_settings = attributes[:'microsoft_settings']
214
- end
215
-
216
- if attributes.key?(:'comcast_settings')
217
- self.comcast_settings = attributes[:'comcast_settings']
218
- end
219
-
220
- if attributes.key?(:'yandex_settings')
221
- self.yandex_settings = attributes[:'yandex_settings']
222
- end
223
-
224
- if attributes.key?(:'gmx_settings')
225
- self.gmx_settings = attributes[:'gmx_settings']
226
- end
227
-
228
- if attributes.key?(:'mailru_settings')
229
- self.mailru_settings = attributes[:'mailru_settings']
230
- end
231
-
232
- if attributes.key?(:'icloud_settings')
233
- self.icloud_settings = attributes[:'icloud_settings']
234
- end
235
-
236
- if attributes.key?(:'zoho_settings')
237
- self.zoho_settings = attributes[:'zoho_settings']
238
- end
239
-
240
- if attributes.key?(:'qq_settings')
241
- self.qq_settings = attributes[:'qq_settings']
242
- end
243
-
244
- if attributes.key?(:'default_settings')
245
- self.default_settings = attributes[:'default_settings']
246
- end
247
-
248
- if attributes.key?(:'att_settings')
249
- self.att_settings = attributes[:'att_settings']
250
- end
251
-
252
- if attributes.key?(:'created')
253
- self.created = attributes[:'created']
254
- else
255
- self.created = nil
141
+ if attributes.key?(:'auto_warmup_enabled')
142
+ self.auto_warmup_enabled = attributes[:'auto_warmup_enabled']
256
143
  end
257
144
 
258
- if attributes.key?(:'infra_classification')
259
- self.infra_classification = attributes[:'infra_classification']
260
- end
261
-
262
- if attributes.key?(:'infra_monitor')
263
- self.infra_monitor = attributes[:'infra_monitor']
145
+ if attributes.key?(:'labels')
146
+ if (value = attributes[:'labels']).is_a?(Array)
147
+ self.labels = value
148
+ end
264
149
  end
265
150
 
266
151
  if attributes.key?(:'state')
267
152
  self.state = attributes[:'state']
268
153
  end
269
154
 
270
- if attributes.key?(:'auto_warmup_plan')
271
- self.auto_warmup_plan = attributes[:'auto_warmup_plan']
155
+ if attributes.key?(:'created')
156
+ self.created = attributes[:'created']
272
157
  end
273
158
  end
274
159
 
@@ -277,18 +162,6 @@ module Sendpost
277
162
  def list_invalid_properties
278
163
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
279
164
  invalid_properties = Array.new
280
- if @id.nil?
281
- invalid_properties.push('invalid value for "id", id cannot be nil.')
282
- end
283
-
284
- if @public_ip.nil?
285
- invalid_properties.push('invalid value for "public_ip", public_ip cannot be nil.')
286
- end
287
-
288
- if @created.nil?
289
- invalid_properties.push('invalid value for "created", created cannot be nil.')
290
- end
291
-
292
165
  invalid_properties
293
166
  end
294
167
 
@@ -296,40 +169,31 @@ module Sendpost
296
169
  # @return true if the model is valid
297
170
  def valid?
298
171
  warn '[DEPRECATED] the `valid?` method is obsolete'
299
- return false if @id.nil?
300
- return false if @public_ip.nil?
301
- return false if @created.nil?
172
+ type_validator = EnumAttributeValidator.new('Integer', [0, 1])
173
+ return false unless type_validator.valid?(@type)
174
+ state_validator = EnumAttributeValidator.new('Integer', [0, 1])
175
+ return false unless state_validator.valid?(@state)
302
176
  true
303
177
  end
304
178
 
305
- # Custom attribute writer method with validation
306
- # @param [Object] id Value to be assigned
307
- def id=(id)
308
- if id.nil?
309
- fail ArgumentError, 'id cannot be nil'
310
- end
311
-
312
- @id = id
313
- end
314
-
315
- # Custom attribute writer method with validation
316
- # @param [Object] public_ip Value to be assigned
317
- def public_ip=(public_ip)
318
- if public_ip.nil?
319
- fail ArgumentError, 'public_ip cannot be nil'
179
+ # Custom attribute writer method checking allowed values (enum).
180
+ # @param [Object] type Object to be assigned
181
+ def type=(type)
182
+ validator = EnumAttributeValidator.new('Integer', [0, 1])
183
+ unless validator.valid?(type)
184
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
320
185
  end
321
-
322
- @public_ip = public_ip
186
+ @type = type
323
187
  end
324
188
 
325
- # Custom attribute writer method with validation
326
- # @param [Object] created Value to be assigned
327
- def created=(created)
328
- if created.nil?
329
- fail ArgumentError, 'created cannot be nil'
189
+ # Custom attribute writer method checking allowed values (enum).
190
+ # @param [Object] state Object to be assigned
191
+ def state=(state)
192
+ validator = EnumAttributeValidator.new('Integer', [0, 1])
193
+ unless validator.valid?(state)
194
+ fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
330
195
  end
331
-
332
- @created = created
196
+ @state = state
333
197
  end
334
198
 
335
199
  # Checks equality by comparing each attribute.
@@ -339,27 +203,12 @@ module Sendpost
339
203
  self.class == o.class &&
340
204
  id == o.id &&
341
205
  public_ip == o.public_ip &&
342
- system_domain == o.system_domain &&
343
206
  reverse_dns_hostname == o.reverse_dns_hostname &&
344
207
  type == o.type &&
345
- gmail_settings == o.gmail_settings &&
346
- yahoo_settings == o.yahoo_settings &&
347
- aol_settings == o.aol_settings &&
348
- microsoft_settings == o.microsoft_settings &&
349
- comcast_settings == o.comcast_settings &&
350
- yandex_settings == o.yandex_settings &&
351
- gmx_settings == o.gmx_settings &&
352
- mailru_settings == o.mailru_settings &&
353
- icloud_settings == o.icloud_settings &&
354
- zoho_settings == o.zoho_settings &&
355
- qq_settings == o.qq_settings &&
356
- default_settings == o.default_settings &&
357
- att_settings == o.att_settings &&
358
- created == o.created &&
359
- infra_classification == o.infra_classification &&
360
- infra_monitor == o.infra_monitor &&
208
+ auto_warmup_enabled == o.auto_warmup_enabled &&
209
+ labels == o.labels &&
361
210
  state == o.state &&
362
- auto_warmup_plan == o.auto_warmup_plan
211
+ created == o.created
363
212
  end
364
213
 
365
214
  # @see the `==` method
@@ -371,7 +220,7 @@ module Sendpost
371
220
  # Calculates hash code according to all attributes.
372
221
  # @return [Integer] Hash code
373
222
  def hash
374
- [id, public_ip, system_domain, reverse_dns_hostname, type, gmail_settings, yahoo_settings, aol_settings, microsoft_settings, comcast_settings, yandex_settings, gmx_settings, mailru_settings, icloud_settings, zoho_settings, qq_settings, default_settings, att_settings, created, infra_classification, infra_monitor, state, auto_warmup_plan].hash
223
+ [id, public_ip, reverse_dns_hostname, type, auto_warmup_enabled, labels, state, created].hash
375
224
  end
376
225
 
377
226
  # Builds the object from hash