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
@@ -0,0 +1,71 @@
1
+ # Sendpost::WebhookReferenceApi
2
+
3
+ All URIs are relative to *https://api.sendpost.io/api/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**send_post_webhooks_post**](WebhookReferenceApi.md#send_post_webhooks_post) | **POST** /SendPostWebhooks | SendPost Webhook Object |
8
+
9
+
10
+ ## send_post_webhooks_post
11
+
12
+ > send_post_webhooks_post(opts)
13
+
14
+ SendPost Webhook Object
15
+
16
+ ### Examples
17
+
18
+ ```ruby
19
+ require 'time'
20
+ require 'sendpost_ruby_sdk'
21
+
22
+ api_instance = Sendpost::WebhookReferenceApi.new
23
+ opts = {
24
+ webhook_object: # WebhookObject |
25
+ }
26
+
27
+ begin
28
+ # SendPost Webhook Object
29
+ api_instance.send_post_webhooks_post(opts)
30
+ rescue Sendpost::ApiError => e
31
+ puts "Error when calling WebhookReferenceApi->send_post_webhooks_post: #{e}"
32
+ end
33
+ ```
34
+
35
+ #### Using the send_post_webhooks_post_with_http_info variant
36
+
37
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
38
+
39
+ > <Array(nil, Integer, Hash)> send_post_webhooks_post_with_http_info(opts)
40
+
41
+ ```ruby
42
+ begin
43
+ # SendPost Webhook Object
44
+ data, status_code, headers = api_instance.send_post_webhooks_post_with_http_info(opts)
45
+ p status_code # => 2xx
46
+ p headers # => { ... }
47
+ p data # => nil
48
+ rescue Sendpost::ApiError => e
49
+ puts "Error when calling WebhookReferenceApi->send_post_webhooks_post_with_http_info: #{e}"
50
+ end
51
+ ```
52
+
53
+ ### Parameters
54
+
55
+ | Name | Type | Description | Notes |
56
+ | ---- | ---- | ----------- | ----- |
57
+ | **webhook_object** | [**WebhookObject**](WebhookObject.md) | | [optional] |
58
+
59
+ ### Return type
60
+
61
+ nil (empty response body)
62
+
63
+ ### Authorization
64
+
65
+ No authorization required
66
+
67
+ ### HTTP request headers
68
+
69
+ - **Content-Type**: application/json
70
+ - **Accept**: Not defined
71
+
@@ -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
@@ -19,65 +19,59 @@ module Sendpost
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # List Domains
23
- # Retrieve a list of all domains associated with the sub-account, including their DNS records and authentication status.
22
+ # Create Domain
23
+ # Register a new sending domain with SendPost. After creation, you'll receive DNS records that must be configured with your DNS provider before you can send emails. **Domain Setup Process:** 1. Call this endpoint with your domain name 2. Copy the returned DNS records (DKIM, Return-Path, Track, DMARC) 3. Add records to your DNS provider (GoDaddy, Cloudflare, Route53, etc.) 4. Wait for DNS propagation (typically 15 minutes to 48 hours) 5. Verification happens automatically, or trigger manual verification **DNS Records Explained:** | Record | Purpose | Required | |--------|---------|----------| | DKIM | Cryptographically signs emails to prove authenticity | Yes | | Return-Path | Routes bounce notifications through SendPost | Recommended | | Track | Enables click tracking with your domain | Optional | | DMARC | Adds additional authentication layer | Recommended | **Best Practices:** - Use a subdomain like `mail.yourdomain.com` for sending - Keep your root domain for your website - Configure all records for best deliverability
24
+ # @param create_domain_request [CreateDomainRequest]
24
25
  # @param [Hash] opts the optional parameters
25
- # @option opts [Integer] :limit Number of records to return per request
26
- # @option opts [Integer] :offset Number of initial records to skip
27
- # @option opts [String] :search Case insensitive search against domain names
28
- # @return [Array<Domain>]
29
- def get_all_domains(opts = {})
30
- data, _status_code, _headers = get_all_domains_with_http_info(opts)
26
+ # @return [Domain]
27
+ def create_sub_account_domain(create_domain_request, opts = {})
28
+ data, _status_code, _headers = create_sub_account_domain_with_http_info(create_domain_request, opts)
31
29
  data
32
30
  end
33
31
 
34
- # List Domains
35
- # Retrieve a list of all domains associated with the sub-account, including their DNS records and authentication status.
32
+ # Create Domain
33
+ # Register a new sending domain with SendPost. After creation, you&#39;ll receive DNS records that must be configured with your DNS provider before you can send emails. **Domain Setup Process:** 1. Call this endpoint with your domain name 2. Copy the returned DNS records (DKIM, Return-Path, Track, DMARC) 3. Add records to your DNS provider (GoDaddy, Cloudflare, Route53, etc.) 4. Wait for DNS propagation (typically 15 minutes to 48 hours) 5. Verification happens automatically, or trigger manual verification **DNS Records Explained:** | Record | Purpose | Required | |--------|---------|----------| | DKIM | Cryptographically signs emails to prove authenticity | Yes | | Return-Path | Routes bounce notifications through SendPost | Recommended | | Track | Enables click tracking with your domain | Optional | | DMARC | Adds additional authentication layer | Recommended | **Best Practices:** - Use a subdomain like &#x60;mail.yourdomain.com&#x60; for sending - Keep your root domain for your website - Configure all records for best deliverability
34
+ # @param create_domain_request [CreateDomainRequest]
36
35
  # @param [Hash] opts the optional parameters
37
- # @option opts [Integer] :limit Number of records to return per request
38
- # @option opts [Integer] :offset Number of initial records to skip
39
- # @option opts [String] :search Case insensitive search against domain names
40
- # @return [Array<(Array<Domain>, Integer, Hash)>] Array<Domain> data, response status code and response headers
41
- def get_all_domains_with_http_info(opts = {})
36
+ # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
37
+ def create_sub_account_domain_with_http_info(create_domain_request, opts = {})
42
38
  if @api_client.config.debugging
43
- @api_client.config.logger.debug 'Calling API: DomainApi.get_all_domains ...'
44
- end
45
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
46
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DomainApi.get_all_domains, must be greater than or equal to 1.'
39
+ @api_client.config.logger.debug 'Calling API: DomainApi.create_sub_account_domain ...'
47
40
  end
48
-
49
- if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
50
- fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DomainApi.get_all_domains, must be greater than or equal to 0.'
41
+ # verify the required parameter 'create_domain_request' is set
42
+ if @api_client.config.client_side_validation && create_domain_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_domain_request' when calling DomainApi.create_sub_account_domain"
51
44
  end
52
-
53
45
  # resource path
54
46
  local_var_path = '/subaccount/domain'
55
47
 
56
48
  # query parameters
57
49
  query_params = opts[:query_params] || {}
58
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
59
- query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
60
- query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
61
50
 
62
51
  # header parameters
63
52
  header_params = opts[:header_params] || {}
64
53
  # HTTP header 'Accept' (if needed)
65
54
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
66
60
 
67
61
  # form parameters
68
62
  form_params = opts[:form_params] || {}
69
63
 
70
64
  # http body (model)
71
- post_body = opts[:debug_body]
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_domain_request)
72
66
 
73
67
  # return_type
74
- return_type = opts[:debug_return_type] || 'Array<Domain>'
68
+ return_type = opts[:debug_return_type] || 'Domain'
75
69
 
76
70
  # auth_names
77
71
  auth_names = opts[:debug_auth_names] || ['subAccountAuth']
78
72
 
79
73
  new_options = opts.merge(
80
- :operation => :"DomainApi.get_all_domains",
74
+ :operation => :"DomainApi.create_sub_account_domain",
81
75
  :header_params => header_params,
82
76
  :query_params => query_params,
83
77
  :form_params => form_params,
@@ -86,35 +80,35 @@ module Sendpost
86
80
  :return_type => return_type
87
81
  )
88
82
 
89
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
84
  if @api_client.config.debugging
91
- @api_client.config.logger.debug "API called: DomainApi#get_all_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ @api_client.config.logger.debug "API called: DomainApi#create_sub_account_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
86
  end
93
87
  return data, status_code, headers
94
88
  end
95
89
 
96
90
  # Delete Domain
97
- # Delete a specific domain using its `id`.
91
+ # Remove a sending domain from your sub-account. Once deleted, you can no longer send emails from addresses on this domain. **Before Deleting:** - Ensure no active email campaigns use this domain - Update sender addresses in your applications - Consider impact on email deliverability **Note:** DNS records for the domain will become orphaned. You may want to remove them from your DNS provider.
98
92
  # @param domain_id [String] The unique ID of the domain to delete.
99
93
  # @param [Hash] opts the optional parameters
100
94
  # @return [DeleteResponse]
101
- def subaccount_domain_domain_id_delete(domain_id, opts = {})
102
- data, _status_code, _headers = subaccount_domain_domain_id_delete_with_http_info(domain_id, opts)
95
+ def delete_sub_account_domain(domain_id, opts = {})
96
+ data, _status_code, _headers = delete_sub_account_domain_with_http_info(domain_id, opts)
103
97
  data
104
98
  end
105
99
 
106
100
  # Delete Domain
107
- # Delete a specific domain using its &#x60;id&#x60;.
101
+ # Remove a sending domain from your sub-account. Once deleted, you can no longer send emails from addresses on this domain. **Before Deleting:** - Ensure no active email campaigns use this domain - Update sender addresses in your applications - Consider impact on email deliverability **Note:** DNS records for the domain will become orphaned. You may want to remove them from your DNS provider.
108
102
  # @param domain_id [String] The unique ID of the domain to delete.
109
103
  # @param [Hash] opts the optional parameters
110
104
  # @return [Array<(DeleteResponse, Integer, Hash)>] DeleteResponse data, response status code and response headers
111
- def subaccount_domain_domain_id_delete_with_http_info(domain_id, opts = {})
105
+ def delete_sub_account_domain_with_http_info(domain_id, opts = {})
112
106
  if @api_client.config.debugging
113
- @api_client.config.logger.debug 'Calling API: DomainApi.subaccount_domain_domain_id_delete ...'
107
+ @api_client.config.logger.debug 'Calling API: DomainApi.delete_sub_account_domain ...'
114
108
  end
115
109
  # verify the required parameter 'domain_id' is set
116
110
  if @api_client.config.client_side_validation && domain_id.nil?
117
- fail ArgumentError, "Missing the required parameter 'domain_id' when calling DomainApi.subaccount_domain_domain_id_delete"
111
+ fail ArgumentError, "Missing the required parameter 'domain_id' when calling DomainApi.delete_sub_account_domain"
118
112
  end
119
113
  # resource path
120
114
  local_var_path = '/subaccount/domain/{domain_id}'.sub('{' + 'domain_id' + '}', CGI.escape(domain_id.to_s))
@@ -140,7 +134,7 @@ module Sendpost
140
134
  auth_names = opts[:debug_auth_names] || ['subAccountAuth']
141
135
 
142
136
  new_options = opts.merge(
143
- :operation => :"DomainApi.subaccount_domain_domain_id_delete",
137
+ :operation => :"DomainApi.delete_sub_account_domain",
144
138
  :header_params => header_params,
145
139
  :query_params => query_params,
146
140
  :form_params => form_params,
@@ -151,39 +145,50 @@ module Sendpost
151
145
 
152
146
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
153
147
  if @api_client.config.debugging
154
- @api_client.config.logger.debug "API called: DomainApi#subaccount_domain_domain_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
+ @api_client.config.logger.debug "API called: DomainApi#delete_sub_account_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
149
  end
156
150
  return data, status_code, headers
157
151
  end
158
152
 
159
- # Get Domain
160
- # Retrieve details of a specific domain using its `id`.
161
- # @param domain_id [String] The unique ID of the domain to retrieve.
153
+ # List Domains
154
+ # Retrieve all sending domains configured for this sub-account. Use this endpoint to audit your domain setup, check verification status, or retrieve DNS records for configuration. **Each domain record includes:** - Domain name and unique ID - DNS records to configure (DKIM, Return-Path, Track, DMARC) - Verification status for each record type - Failure messages for troubleshooting - Creation timestamp **Verification Status Values:** - `true` - Record verified and active - `false` - Record not verified (check DNS configuration) **Use Cases:** - Audit all configured sending domains - Export DNS records for documentation - Identify domains pending verification - Monitor domain health across multiple domains **Pagination:** Use `limit` and `offset` for large domain lists.
162
155
  # @param [Hash] opts the optional parameters
163
- # @return [Domain]
164
- def subaccount_domain_domain_id_get(domain_id, opts = {})
165
- data, _status_code, _headers = subaccount_domain_domain_id_get_with_http_info(domain_id, opts)
156
+ # @option opts [Integer] :limit Number of records to return per request. Default is 20. (default to 20)
157
+ # @option opts [Integer] :offset Number of initial records to skip for pagination. (default to 0)
158
+ # @option opts [String] :search Case insensitive search against domain names. Useful for finding specific domains in large lists.
159
+ # @return [Array<Domain>]
160
+ def get_all_domains(opts = {})
161
+ data, _status_code, _headers = get_all_domains_with_http_info(opts)
166
162
  data
167
163
  end
168
164
 
169
- # Get Domain
170
- # Retrieve details of a specific domain using its &#x60;id&#x60;.
171
- # @param domain_id [String] The unique ID of the domain to retrieve.
165
+ # List Domains
166
+ # Retrieve all sending domains configured for this sub-account. Use this endpoint to audit your domain setup, check verification status, or retrieve DNS records for configuration. **Each domain record includes:** - Domain name and unique ID - DNS records to configure (DKIM, Return-Path, Track, DMARC) - Verification status for each record type - Failure messages for troubleshooting - Creation timestamp **Verification Status Values:** - &#x60;true&#x60; - Record verified and active - &#x60;false&#x60; - Record not verified (check DNS configuration) **Use Cases:** - Audit all configured sending domains - Export DNS records for documentation - Identify domains pending verification - Monitor domain health across multiple domains **Pagination:** Use &#x60;limit&#x60; and &#x60;offset&#x60; for large domain lists.
172
167
  # @param [Hash] opts the optional parameters
173
- # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
174
- def subaccount_domain_domain_id_get_with_http_info(domain_id, opts = {})
168
+ # @option opts [Integer] :limit Number of records to return per request. Default is 20. (default to 20)
169
+ # @option opts [Integer] :offset Number of initial records to skip for pagination. (default to 0)
170
+ # @option opts [String] :search Case insensitive search against domain names. Useful for finding specific domains in large lists.
171
+ # @return [Array<(Array<Domain>, Integer, Hash)>] Array<Domain> data, response status code and response headers
172
+ def get_all_domains_with_http_info(opts = {})
175
173
  if @api_client.config.debugging
176
- @api_client.config.logger.debug 'Calling API: DomainApi.subaccount_domain_domain_id_get ...'
174
+ @api_client.config.logger.debug 'Calling API: DomainApi.get_all_domains ...'
177
175
  end
178
- # verify the required parameter 'domain_id' is set
179
- if @api_client.config.client_side_validation && domain_id.nil?
180
- fail ArgumentError, "Missing the required parameter 'domain_id' when calling DomainApi.subaccount_domain_domain_id_get"
176
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
177
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DomainApi.get_all_domains, must be greater than or equal to 1.'
178
+ end
179
+
180
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
181
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DomainApi.get_all_domains, must be greater than or equal to 0.'
181
182
  end
183
+
182
184
  # resource path
183
- local_var_path = '/subaccount/domain/{domain_id}'.sub('{' + 'domain_id' + '}', CGI.escape(domain_id.to_s))
185
+ local_var_path = '/subaccount/domain'
184
186
 
185
187
  # query parameters
186
188
  query_params = opts[:query_params] || {}
189
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
190
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
191
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
187
192
 
188
193
  # header parameters
189
194
  header_params = opts[:header_params] || {}
@@ -197,13 +202,13 @@ module Sendpost
197
202
  post_body = opts[:debug_body]
198
203
 
199
204
  # return_type
200
- return_type = opts[:debug_return_type] || 'Domain'
205
+ return_type = opts[:debug_return_type] || 'Array<Domain>'
201
206
 
202
207
  # auth_names
203
208
  auth_names = opts[:debug_auth_names] || ['subAccountAuth']
204
209
 
205
210
  new_options = opts.merge(
206
- :operation => :"DomainApi.subaccount_domain_domain_id_get",
211
+ :operation => :"DomainApi.get_all_domains",
207
212
  :header_params => header_params,
208
213
  :query_params => query_params,
209
214
  :form_params => form_params,
@@ -214,36 +219,36 @@ module Sendpost
214
219
 
215
220
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
216
221
  if @api_client.config.debugging
217
- @api_client.config.logger.debug "API called: DomainApi#subaccount_domain_domain_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
+ @api_client.config.logger.debug "API called: DomainApi#get_all_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
223
  end
219
224
  return data, status_code, headers
220
225
  end
221
226
 
222
- # Create Domain
223
- # Add a new domain using its `name`.
224
- # @param create_domain_request [CreateDomainRequest]
227
+ # Get Domain
228
+ # Retrieve detailed information about a specific sending domain, including DNS record configuration and verification status. **Response includes:** - Domain name and ID - DKIM, Return-Path, Track, and DMARC DNS records to configure - Verification status for each record type - Failure reasons if verification failed - Domain registration date **Use Cases:** - Check verification status before sending emails - Retrieve DNS records during domain setup - Debug DNS configuration issues - Audit domain settings for compliance
229
+ # @param domain_id [String] The unique ID of the domain to retrieve.
225
230
  # @param [Hash] opts the optional parameters
226
231
  # @return [Domain]
227
- def subaccount_domain_post(create_domain_request, opts = {})
228
- data, _status_code, _headers = subaccount_domain_post_with_http_info(create_domain_request, opts)
232
+ def get_sub_account_domain(domain_id, opts = {})
233
+ data, _status_code, _headers = get_sub_account_domain_with_http_info(domain_id, opts)
229
234
  data
230
235
  end
231
236
 
232
- # Create Domain
233
- # Add a new domain using its &#x60;name&#x60;.
234
- # @param create_domain_request [CreateDomainRequest]
237
+ # Get Domain
238
+ # Retrieve detailed information about a specific sending domain, including DNS record configuration and verification status. **Response includes:** - Domain name and ID - DKIM, Return-Path, Track, and DMARC DNS records to configure - Verification status for each record type - Failure reasons if verification failed - Domain registration date **Use Cases:** - Check verification status before sending emails - Retrieve DNS records during domain setup - Debug DNS configuration issues - Audit domain settings for compliance
239
+ # @param domain_id [String] The unique ID of the domain to retrieve.
235
240
  # @param [Hash] opts the optional parameters
236
241
  # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
237
- def subaccount_domain_post_with_http_info(create_domain_request, opts = {})
242
+ def get_sub_account_domain_with_http_info(domain_id, opts = {})
238
243
  if @api_client.config.debugging
239
- @api_client.config.logger.debug 'Calling API: DomainApi.subaccount_domain_post ...'
244
+ @api_client.config.logger.debug 'Calling API: DomainApi.get_sub_account_domain ...'
240
245
  end
241
- # verify the required parameter 'create_domain_request' is set
242
- if @api_client.config.client_side_validation && create_domain_request.nil?
243
- fail ArgumentError, "Missing the required parameter 'create_domain_request' when calling DomainApi.subaccount_domain_post"
246
+ # verify the required parameter 'domain_id' is set
247
+ if @api_client.config.client_side_validation && domain_id.nil?
248
+ fail ArgumentError, "Missing the required parameter 'domain_id' when calling DomainApi.get_sub_account_domain"
244
249
  end
245
250
  # resource path
246
- local_var_path = '/subaccount/domain'
251
+ local_var_path = '/subaccount/domain/{domain_id}'.sub('{' + 'domain_id' + '}', CGI.escape(domain_id.to_s))
247
252
 
248
253
  # query parameters
249
254
  query_params = opts[:query_params] || {}
@@ -252,17 +257,12 @@ module Sendpost
252
257
  header_params = opts[:header_params] || {}
253
258
  # HTTP header 'Accept' (if needed)
254
259
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
255
- # HTTP header 'Content-Type'
256
- content_type = @api_client.select_header_content_type(['application/json'])
257
- if !content_type.nil?
258
- header_params['Content-Type'] = content_type
259
- end
260
260
 
261
261
  # form parameters
262
262
  form_params = opts[:form_params] || {}
263
263
 
264
264
  # http body (model)
265
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_domain_request)
265
+ post_body = opts[:debug_body]
266
266
 
267
267
  # return_type
268
268
  return_type = opts[:debug_return_type] || 'Domain'
@@ -271,7 +271,7 @@ module Sendpost
271
271
  auth_names = opts[:debug_auth_names] || ['subAccountAuth']
272
272
 
273
273
  new_options = opts.merge(
274
- :operation => :"DomainApi.subaccount_domain_post",
274
+ :operation => :"DomainApi.get_sub_account_domain",
275
275
  :header_params => header_params,
276
276
  :query_params => query_params,
277
277
  :form_params => form_params,
@@ -280,9 +280,9 @@ module Sendpost
280
280
  :return_type => return_type
281
281
  )
282
282
 
283
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
283
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
284
284
  if @api_client.config.debugging
285
- @api_client.config.logger.debug "API called: DomainApi#subaccount_domain_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
285
+ @api_client.config.logger.debug "API called: DomainApi#get_sub_account_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
286
  end
287
287
  return data, status_code, headers
288
288
  end