sendpost_ruby_sdk 1.2.2 → 2.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 (287) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -0
  3. data/README.md +580 -145
  4. data/docs/AccountStats.md +20 -0
  5. data/docs/AccountStatsStat.md +38 -0
  6. data/docs/AggregateStat.md +38 -0
  7. data/docs/AggregateStats.md +38 -0
  8. data/docs/AggregatedEmailStats.md +38 -0
  9. data/docs/Attachment.md +4 -4
  10. data/docs/AutoWarmupPlan.md +80 -0
  11. data/docs/CopyTo.md +5 -5
  12. data/docs/CreateDomainRequest.md +18 -0
  13. data/docs/CreateSubAccountRequest.md +18 -0
  14. data/docs/CreateSuppressionRequest.md +24 -0
  15. data/docs/CreateSuppressionRequestHardBounceInner.md +18 -0
  16. data/docs/{SuppressionEmail.md → CreateSuppressionRequestManualInner.md} +3 -3
  17. data/docs/CreateSuppressionRequestSpamComplaintInner.md +18 -0
  18. data/docs/CreateSuppressionRequestUnsubscribeInner.md +18 -0
  19. data/docs/CreateWebhookRequest.md +46 -0
  20. data/docs/DeleteResponse.md +2 -2
  21. data/docs/DeleteSubAccountResponse.md +20 -0
  22. data/docs/DeleteSuppression200ResponseInner.md +20 -0
  23. data/docs/DeleteSuppressionRequest.md +18 -0
  24. data/docs/DeleteWebhookResponse.md +20 -0
  25. data/docs/Device.md +1 -1
  26. data/docs/Domain.md +56 -0
  27. data/docs/DomainApi.md +301 -0
  28. data/docs/DomainDkim.md +22 -0
  29. data/docs/DomainDmarc.md +22 -0
  30. data/docs/DomainGpt.md +22 -0
  31. data/docs/DomainReturnPath.md +22 -0
  32. data/docs/DomainTrack.md +22 -0
  33. data/docs/EIP.md +18 -0
  34. data/docs/{From.md → EmailAddress.md} +4 -4
  35. data/docs/EmailApi.md +38 -32
  36. data/docs/EmailMessage.md +30 -24
  37. data/docs/EmailMessageFrom.md +20 -0
  38. data/docs/EmailMessageObject.md +46 -0
  39. data/docs/{ReplyTo.md → EmailMessageReplyTo.md} +5 -5
  40. data/docs/EmailMessageToInner.md +26 -0
  41. data/docs/EmailMessageToInnerBccInner.md +22 -0
  42. data/docs/EmailMessageToInnerCcInner.md +22 -0
  43. data/docs/EmailMessageWithTemplate.md +52 -0
  44. data/docs/EmailResponse.md +8 -8
  45. data/docs/EmailStats.md +20 -0
  46. data/docs/EmailStatsStats.md +38 -0
  47. data/docs/Event.md +56 -0
  48. data/docs/EventMetadata.md +13 -13
  49. data/docs/{City.md → GeoLocation.md} +8 -8
  50. data/docs/IP.md +62 -0
  51. data/docs/IPAllocationRequest.md +20 -0
  52. data/docs/IPApi.md +375 -0
  53. data/docs/IPDeletionResponse.md +20 -0
  54. data/docs/IPPool.md +42 -0
  55. data/docs/IPPoolCreateRequest.md +28 -0
  56. data/docs/IPPoolDeleteResponse.md +20 -0
  57. data/docs/IPPoolUpdateRequest.md +24 -0
  58. data/docs/IPPoolsApi.md +361 -0
  59. data/docs/IPUpdateRequest.md +18 -0
  60. data/docs/Label.md +22 -0
  61. data/docs/Member.md +40 -0
  62. data/docs/Message.md +76 -0
  63. data/docs/MessageApi.md +79 -0
  64. data/docs/MessageHeaderTo.md +26 -0
  65. data/docs/MessageTo.md +26 -0
  66. data/docs/{Os.md → OperatingSystem.md} +7 -7
  67. data/docs/Person.md +20 -0
  68. data/docs/{To.md → Recipient.md} +7 -7
  69. data/docs/SMTPAuth.md +26 -0
  70. data/docs/Stat.md +20 -0
  71. data/docs/StatStats.md +38 -0
  72. data/docs/StatsAApi.md +307 -0
  73. data/docs/StatsApi.md +237 -0
  74. data/docs/SubAccount.md +48 -0
  75. data/docs/SubAccountApi.md +375 -0
  76. data/docs/Suppression.md +8 -8
  77. data/docs/SuppressionApi.md +76 -134
  78. data/docs/ThirdPartySendingProvider.md +38 -0
  79. data/docs/UpdateSubAccount.md +18 -0
  80. data/docs/UpdateWebhook.md +46 -0
  81. data/docs/UserAgent.md +4 -4
  82. data/docs/Webhook.md +54 -0
  83. data/docs/WebhookApi.md +375 -0
  84. data/git_push.sh +1 -1
  85. data/lib/sendpost_ruby_sdk/api/domain_api.rb +290 -0
  86. data/lib/sendpost_ruby_sdk/api/email_api.rb +33 -35
  87. data/lib/sendpost_ruby_sdk/api/ip_api.rb +356 -0
  88. data/lib/sendpost_ruby_sdk/api/ip_pools_api.rb +356 -0
  89. data/lib/sendpost_ruby_sdk/api/message_api.rb +85 -0
  90. data/lib/sendpost_ruby_sdk/api/stats_a_api.rb +320 -0
  91. data/lib/sendpost_ruby_sdk/api/stats_api.rb +260 -0
  92. data/lib/sendpost_ruby_sdk/api/sub_account_api.rb +356 -0
  93. data/lib/sendpost_ruby_sdk/api/suppression_api.rb +81 -141
  94. data/lib/sendpost_ruby_sdk/api/webhook_api.rb +356 -0
  95. data/lib/sendpost_ruby_sdk/api_client.rb +26 -24
  96. data/lib/sendpost_ruby_sdk/api_error.rb +3 -3
  97. data/lib/sendpost_ruby_sdk/configuration.rb +28 -3
  98. data/lib/sendpost_ruby_sdk/models/account_stats.rb +229 -0
  99. data/lib/sendpost_ruby_sdk/models/account_stats_stat.rb +310 -0
  100. data/lib/sendpost_ruby_sdk/models/aggregate_stat.rb +321 -0
  101. data/lib/sendpost_ruby_sdk/models/aggregate_stats.rb +310 -0
  102. data/lib/sendpost_ruby_sdk/models/aggregated_email_stats.rb +321 -0
  103. data/lib/sendpost_ruby_sdk/models/attachment.rb +15 -7
  104. data/lib/sendpost_ruby_sdk/models/auto_warmup_plan.rb +531 -0
  105. data/lib/sendpost_ruby_sdk/models/copy_to.rb +28 -19
  106. data/lib/sendpost_ruby_sdk/models/create_domain_request.rb +221 -0
  107. data/lib/sendpost_ruby_sdk/models/create_sub_account_request.rb +221 -0
  108. data/lib/sendpost_ruby_sdk/models/create_suppression_request.rb +259 -0
  109. data/lib/sendpost_ruby_sdk/models/create_suppression_request_hard_bounce_inner.rb +220 -0
  110. data/lib/sendpost_ruby_sdk/models/create_suppression_request_manual_inner.rb +220 -0
  111. data/lib/sendpost_ruby_sdk/models/create_suppression_request_spam_complaint_inner.rb +220 -0
  112. data/lib/sendpost_ruby_sdk/models/create_suppression_request_unsubscribe_inner.rb +220 -0
  113. data/lib/sendpost_ruby_sdk/models/create_webhook_request.rb +361 -0
  114. data/lib/sendpost_ruby_sdk/models/delete_response.rb +15 -7
  115. data/lib/sendpost_ruby_sdk/models/delete_sub_account_response.rb +231 -0
  116. data/lib/sendpost_ruby_sdk/models/delete_suppression200_response_inner.rb +231 -0
  117. data/lib/sendpost_ruby_sdk/models/delete_suppression_request.rb +222 -0
  118. data/lib/sendpost_ruby_sdk/models/delete_webhook_response.rb +231 -0
  119. data/lib/sendpost_ruby_sdk/models/device.rb +13 -7
  120. data/lib/sendpost_ruby_sdk/models/domain.rb +406 -0
  121. data/lib/sendpost_ruby_sdk/models/domain_dkim.rb +239 -0
  122. data/lib/sendpost_ruby_sdk/models/domain_dmarc.rb +239 -0
  123. data/lib/sendpost_ruby_sdk/models/domain_gpt.rb +239 -0
  124. data/lib/sendpost_ruby_sdk/models/domain_return_path.rb +239 -0
  125. data/lib/sendpost_ruby_sdk/models/domain_track.rb +239 -0
  126. data/lib/sendpost_ruby_sdk/models/eip.rb +238 -0
  127. data/lib/sendpost_ruby_sdk/models/email_address.rb +229 -0
  128. data/lib/sendpost_ruby_sdk/models/email_message.rb +121 -86
  129. data/lib/sendpost_ruby_sdk/models/email_message_from.rb +229 -0
  130. data/lib/sendpost_ruby_sdk/models/email_message_object.rb +354 -0
  131. data/lib/sendpost_ruby_sdk/models/email_message_reply_to.rb +229 -0
  132. data/lib/sendpost_ruby_sdk/models/email_message_to_inner.rb +262 -0
  133. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_bcc_inner.rb +240 -0
  134. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_cc_inner.rb +240 -0
  135. data/lib/sendpost_ruby_sdk/models/email_message_with_template.rb +392 -0
  136. data/lib/sendpost_ruby_sdk/models/email_response.rb +40 -32
  137. data/lib/sendpost_ruby_sdk/models/email_stats.rb +230 -0
  138. data/lib/sendpost_ruby_sdk/models/email_stats_stats.rb +321 -0
  139. data/lib/sendpost_ruby_sdk/models/event.rb +393 -0
  140. data/lib/sendpost_ruby_sdk/models/event_metadata.rb +59 -53
  141. data/lib/sendpost_ruby_sdk/models/geo_location.rb +256 -0
  142. data/lib/sendpost_ruby_sdk/models/ip.rb +491 -0
  143. data/lib/sendpost_ruby_sdk/models/ip_allocation_request.rb +266 -0
  144. data/lib/sendpost_ruby_sdk/models/ip_deletion_response.rb +265 -0
  145. data/lib/sendpost_ruby_sdk/models/ip_pool.rb +335 -0
  146. data/lib/sendpost_ruby_sdk/models/ip_pool_create_request.rb +269 -0
  147. data/lib/sendpost_ruby_sdk/models/ip_pool_delete_response.rb +229 -0
  148. data/lib/sendpost_ruby_sdk/models/ip_pool_update_request.rb +249 -0
  149. data/lib/sendpost_ruby_sdk/models/ip_update_request.rb +238 -0
  150. data/lib/sendpost_ruby_sdk/models/label.rb +241 -0
  151. data/lib/sendpost_ruby_sdk/models/member.rb +331 -0
  152. data/lib/sendpost_ruby_sdk/models/message.rb +523 -0
  153. data/lib/sendpost_ruby_sdk/models/message_header_to.rb +268 -0
  154. data/lib/sendpost_ruby_sdk/models/message_to.rb +268 -0
  155. data/lib/sendpost_ruby_sdk/models/operating_system.rb +256 -0
  156. data/lib/sendpost_ruby_sdk/models/person.rb +231 -0
  157. data/lib/sendpost_ruby_sdk/models/recipient.rb +263 -0
  158. data/lib/sendpost_ruby_sdk/models/smtp_auth.rb +261 -0
  159. data/lib/sendpost_ruby_sdk/models/stat.rb +230 -0
  160. data/lib/sendpost_ruby_sdk/models/stat_stats.rb +321 -0
  161. data/lib/sendpost_ruby_sdk/models/sub_account.rb +415 -0
  162. data/lib/sendpost_ruby_sdk/models/suppression.rb +40 -29
  163. data/lib/sendpost_ruby_sdk/models/third_party_sending_provider.rb +310 -0
  164. data/lib/sendpost_ruby_sdk/models/update_sub_account.rb +221 -0
  165. data/lib/sendpost_ruby_sdk/models/update_webhook.rb +368 -0
  166. data/lib/sendpost_ruby_sdk/models/user_agent.rb +13 -7
  167. data/lib/sendpost_ruby_sdk/models/webhook.rb +405 -0
  168. data/lib/sendpost_ruby_sdk/version.rb +4 -4
  169. data/lib/sendpost_ruby_sdk.rb +72 -15
  170. data/spec/api/domain_api_spec.rb +85 -0
  171. data/spec/api/email_api_spec.rb +9 -9
  172. data/spec/api/ip_api_spec.rb +98 -0
  173. data/spec/api/ip_pools_api_spec.rb +98 -0
  174. data/spec/api/message_api_spec.rb +47 -0
  175. data/spec/api/stats_a_api_spec.rb +89 -0
  176. data/spec/api/stats_api_spec.rb +78 -0
  177. data/spec/api/sub_account_api_spec.rb +98 -0
  178. data/spec/api/suppression_api_spec.rb +22 -34
  179. data/spec/api/webhook_api_spec.rb +98 -0
  180. data/spec/models/account_stats_spec.rb +42 -0
  181. data/spec/models/account_stats_stat_spec.rb +96 -0
  182. data/spec/models/aggregate_stat_spec.rb +96 -0
  183. data/spec/models/aggregate_stats_spec.rb +96 -0
  184. data/spec/models/aggregated_email_stats_spec.rb +96 -0
  185. data/spec/models/attachment_spec.rb +6 -4
  186. data/spec/models/auto_warmup_plan_spec.rb +222 -0
  187. data/spec/models/copy_to_spec.rb +8 -6
  188. data/spec/models/create_domain_request_spec.rb +36 -0
  189. data/spec/models/create_sub_account_request_spec.rb +36 -0
  190. data/spec/models/create_suppression_request_hard_bounce_inner_spec.rb +36 -0
  191. data/spec/models/create_suppression_request_manual_inner_spec.rb +36 -0
  192. data/spec/models/create_suppression_request_spam_complaint_inner_spec.rb +36 -0
  193. data/spec/models/create_suppression_request_spec.rb +54 -0
  194. data/spec/models/create_suppression_request_unsubscribe_inner_spec.rb +36 -0
  195. data/spec/models/create_webhook_request_spec.rb +120 -0
  196. data/spec/models/delete_response_spec.rb +6 -4
  197. data/spec/models/delete_sub_account_response_spec.rb +42 -0
  198. data/spec/models/delete_suppression200_response_inner_spec.rb +42 -0
  199. data/spec/models/delete_suppression_request_spec.rb +36 -0
  200. data/spec/models/delete_webhook_response_spec.rb +42 -0
  201. data/spec/models/device_spec.rb +6 -4
  202. data/spec/models/domain_dkim_spec.rb +48 -0
  203. data/spec/models/domain_dmarc_spec.rb +48 -0
  204. data/spec/models/domain_gpt_spec.rb +48 -0
  205. data/spec/models/domain_return_path_spec.rb +48 -0
  206. data/spec/models/domain_spec.rb +150 -0
  207. data/spec/models/domain_track_spec.rb +48 -0
  208. data/spec/models/eip_spec.rb +36 -0
  209. data/spec/models/email_address_spec.rb +42 -0
  210. data/spec/models/email_message_from_spec.rb +42 -0
  211. data/spec/models/email_message_object_spec.rb +120 -0
  212. data/spec/models/email_message_reply_to_spec.rb +42 -0
  213. data/spec/models/email_message_spec.rb +37 -17
  214. data/spec/models/email_message_to_inner_bcc_inner_spec.rb +48 -0
  215. data/spec/models/email_message_to_inner_cc_inner_spec.rb +48 -0
  216. data/spec/models/email_message_to_inner_spec.rb +60 -0
  217. data/spec/models/email_message_with_template_spec.rb +138 -0
  218. data/spec/models/email_response_spec.rb +10 -8
  219. data/spec/models/email_stats_spec.rb +42 -0
  220. data/spec/models/email_stats_stats_spec.rb +96 -0
  221. data/spec/models/event_metadata_spec.rb +24 -10
  222. data/spec/models/event_spec.rb +150 -0
  223. data/spec/models/geo_location_spec.rb +60 -0
  224. data/spec/models/ip_allocation_request_spec.rb +42 -0
  225. data/spec/models/ip_deletion_response_spec.rb +42 -0
  226. data/spec/models/ip_pool_create_request_spec.rb +66 -0
  227. data/spec/models/ip_pool_delete_response_spec.rb +42 -0
  228. data/spec/models/ip_pool_spec.rb +108 -0
  229. data/spec/models/ip_pool_update_request_spec.rb +54 -0
  230. data/spec/models/ip_spec.rb +168 -0
  231. data/spec/models/ip_update_request_spec.rb +36 -0
  232. data/spec/models/label_spec.rb +48 -0
  233. data/spec/models/member_spec.rb +102 -0
  234. data/spec/models/message_header_to_spec.rb +60 -0
  235. data/spec/models/message_spec.rb +210 -0
  236. data/spec/models/message_to_spec.rb +60 -0
  237. data/spec/models/operating_system_spec.rb +60 -0
  238. data/spec/models/person_spec.rb +42 -0
  239. data/spec/models/recipient_spec.rb +60 -0
  240. data/spec/models/smtp_auth_spec.rb +60 -0
  241. data/spec/models/stat_spec.rb +42 -0
  242. data/spec/models/stat_stats_spec.rb +96 -0
  243. data/spec/models/sub_account_spec.rb +130 -0
  244. data/spec/models/suppression_spec.rb +11 -9
  245. data/spec/models/third_party_sending_provider_spec.rb +96 -0
  246. data/spec/models/update_sub_account_spec.rb +36 -0
  247. data/spec/models/update_webhook_spec.rb +120 -0
  248. data/spec/models/user_agent_spec.rb +6 -4
  249. data/spec/models/webhook_spec.rb +144 -0
  250. data/spec/spec_helper.rb +3 -3
  251. metadata +288 -67
  252. data/config-ruby.json +0 -11
  253. data/docs/CountStat.md +0 -18
  254. data/docs/QEmailMessage.md +0 -70
  255. data/docs/QEvent.md +0 -42
  256. data/docs/RDSuppression.md +0 -18
  257. data/docs/RSuppression.md +0 -24
  258. data/docs/WebhookEvent.md +0 -20
  259. data/generate-libs.bash +0 -1
  260. data/lib/sendpost_ruby_sdk/models/city.rb +0 -250
  261. data/lib/sendpost_ruby_sdk/models/count_stat.rb +0 -214
  262. data/lib/sendpost_ruby_sdk/models/from.rb +0 -223
  263. data/lib/sendpost_ruby_sdk/models/os.rb +0 -250
  264. data/lib/sendpost_ruby_sdk/models/q_email_message.rb +0 -456
  265. data/lib/sendpost_ruby_sdk/models/q_event.rb +0 -324
  266. data/lib/sendpost_ruby_sdk/models/r_suppression.rb +0 -249
  267. data/lib/sendpost_ruby_sdk/models/rd_suppression.rb +0 -216
  268. data/lib/sendpost_ruby_sdk/models/reply_to.rb +0 -223
  269. data/lib/sendpost_ruby_sdk/models/suppression_email.rb +0 -214
  270. data/lib/sendpost_ruby_sdk/models/to.rb +0 -254
  271. data/lib/sendpost_ruby_sdk/models/webhook_event.rb +0 -223
  272. data/sendpost.yaml +0 -666
  273. data/sendpost_ruby_sdk.gemspec +0 -38
  274. data/spec/api_client_spec.rb +0 -228
  275. data/spec/configuration_spec.rb +0 -42
  276. data/spec/models/city_spec.rb +0 -58
  277. data/spec/models/count_stat_spec.rb +0 -34
  278. data/spec/models/from_spec.rb +0 -40
  279. data/spec/models/os_spec.rb +0 -58
  280. data/spec/models/q_email_message_spec.rb +0 -190
  281. data/spec/models/q_event_spec.rb +0 -106
  282. data/spec/models/r_suppression_spec.rb +0 -52
  283. data/spec/models/rd_suppression_spec.rb +0 -34
  284. data/spec/models/reply_to_spec.rb +0 -40
  285. data/spec/models/suppression_email_spec.rb +0 -34
  286. data/spec/models/to_spec.rb +0 -58
  287. data/spec/models/webhook_event_spec.rb +0 -40
@@ -1,228 +0,0 @@
1
- =begin
2
- #SendPost API
3
-
4
- #Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: hello@sendpost.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
-
15
- describe Sendpost::ApiClient do
16
- context 'initialization' do
17
- context 'URL stuff' do
18
- context 'host' do
19
- it 'removes http from host' do
20
- Sendpost.configure { |c| c.host = 'http://example.com' }
21
- expect(Sendpost::Configuration.default.host).to eq('example.com')
22
- end
23
-
24
- it 'removes https from host' do
25
- Sendpost.configure { |c| c.host = 'https://wookiee.com' }
26
- expect(Sendpost::ApiClient.default.config.host).to eq('wookiee.com')
27
- end
28
-
29
- it 'removes trailing path from host' do
30
- Sendpost.configure { |c| c.host = 'hobo.com/v4' }
31
- expect(Sendpost::Configuration.default.host).to eq('hobo.com')
32
- end
33
- end
34
-
35
- context 'base_path' do
36
- it "prepends a slash to base_path" do
37
- Sendpost.configure { |c| c.base_path = 'v4/dog' }
38
- expect(Sendpost::Configuration.default.base_path).to eq('/v4/dog')
39
- end
40
-
41
- it "doesn't prepend a slash if one is already there" do
42
- Sendpost.configure { |c| c.base_path = '/v4/dog' }
43
- expect(Sendpost::Configuration.default.base_path).to eq('/v4/dog')
44
- end
45
-
46
- it "ends up as a blank string if nil" do
47
- Sendpost.configure { |c| c.base_path = nil }
48
- expect(Sendpost::Configuration.default.base_path).to eq('')
49
- end
50
- end
51
- end
52
- end
53
-
54
- describe 'params_encoding in #build_request' do
55
- let(:config) { Sendpost::Configuration.new }
56
- let(:api_client) { Sendpost::ApiClient.new(config) }
57
-
58
- it 'defaults to nil' do
59
- expect(Sendpost::Configuration.default.params_encoding).to eq(nil)
60
- expect(config.params_encoding).to eq(nil)
61
-
62
- request = api_client.build_request(:get, '/test')
63
- expect(request.options[:params_encoding]).to eq(nil)
64
- end
65
-
66
- it 'can be customized' do
67
- config.params_encoding = :multi
68
- request = api_client.build_request(:get, '/test')
69
- expect(request.options[:params_encoding]).to eq(:multi)
70
- end
71
- end
72
-
73
- describe 'timeout in #build_request' do
74
- let(:config) { Sendpost::Configuration.new }
75
- let(:api_client) { Sendpost::ApiClient.new(config) }
76
-
77
- it 'defaults to 0' do
78
- expect(Sendpost::Configuration.default.timeout).to eq(0)
79
- expect(config.timeout).to eq(0)
80
-
81
- request = api_client.build_request(:get, '/test')
82
- expect(request.options[:timeout]).to eq(0)
83
- end
84
-
85
- it 'can be customized' do
86
- config.timeout = 100
87
- request = api_client.build_request(:get, '/test')
88
- expect(request.options[:timeout]).to eq(100)
89
- end
90
- end
91
-
92
-
93
-
94
- describe '#deserialize' do
95
- it "handles Array<Integer>" do
96
- api_client = Sendpost::ApiClient.new
97
- headers = { 'Content-Type' => 'application/json' }
98
- response = double('response', headers: headers, body: '[12, 34]')
99
- data = api_client.deserialize(response, 'Array<Integer>')
100
- expect(data).to be_instance_of(Array)
101
- expect(data).to eq([12, 34])
102
- end
103
-
104
- it 'handles Array<Array<Integer>>' do
105
- api_client = Sendpost::ApiClient.new
106
- headers = { 'Content-Type' => 'application/json' }
107
- response = double('response', headers: headers, body: '[[12, 34], [56]]')
108
- data = api_client.deserialize(response, 'Array<Array<Integer>>')
109
- expect(data).to be_instance_of(Array)
110
- expect(data).to eq([[12, 34], [56]])
111
- end
112
-
113
- it 'handles Hash<String, String>' do
114
- api_client = Sendpost::ApiClient.new
115
- headers = { 'Content-Type' => 'application/json' }
116
- response = double('response', headers: headers, body: '{"message": "Hello"}')
117
- data = api_client.deserialize(response, 'Hash<String, String>')
118
- expect(data).to be_instance_of(Hash)
119
- expect(data).to eq(:message => 'Hello')
120
- end
121
- end
122
-
123
- describe "#object_to_hash" do
124
- it 'ignores nils and includes empty arrays' do
125
- # uncomment below to test object_to_hash for model
126
- # api_client = Sendpost::ApiClient.new
127
- # _model = Sendpost::ModelName.new
128
- # update the model attribute below
129
- # _model.id = 1
130
- # update the expected value (hash) below
131
- # expected = {id: 1, name: '', tags: []}
132
- # expect(api_client.object_to_hash(_model)).to eq(expected)
133
- end
134
- end
135
-
136
- describe '#build_collection_param' do
137
- let(:param) { ['aa', 'bb', 'cc'] }
138
- let(:api_client) { Sendpost::ApiClient.new }
139
-
140
- it 'works for csv' do
141
- expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
142
- end
143
-
144
- it 'works for ssv' do
145
- expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
146
- end
147
-
148
- it 'works for tsv' do
149
- expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
150
- end
151
-
152
- it 'works for pipes' do
153
- expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
154
- end
155
-
156
- it 'works for multi' do
157
- expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
158
- end
159
-
160
- it 'fails for invalid collection format' do
161
- expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
162
- end
163
- end
164
-
165
- describe '#json_mime?' do
166
- let(:api_client) { Sendpost::ApiClient.new }
167
-
168
- it 'works' do
169
- expect(api_client.json_mime?(nil)).to eq false
170
- expect(api_client.json_mime?('')).to eq false
171
-
172
- expect(api_client.json_mime?('application/json')).to eq true
173
- expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
174
- expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
175
-
176
- expect(api_client.json_mime?('application/xml')).to eq false
177
- expect(api_client.json_mime?('text/plain')).to eq false
178
- expect(api_client.json_mime?('application/jsonp')).to eq false
179
- end
180
- end
181
-
182
- describe '#select_header_accept' do
183
- let(:api_client) { Sendpost::ApiClient.new }
184
-
185
- it 'works' do
186
- expect(api_client.select_header_accept(nil)).to be_nil
187
- expect(api_client.select_header_accept([])).to be_nil
188
-
189
- expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
190
- expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
191
- expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
192
-
193
- expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
194
- expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
195
- end
196
- end
197
-
198
- describe '#select_header_content_type' do
199
- let(:api_client) { Sendpost::ApiClient.new }
200
-
201
- it 'works' do
202
- expect(api_client.select_header_content_type(nil)).to be_nil
203
- expect(api_client.select_header_content_type([])).to be_nil
204
-
205
- expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
206
- expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
207
- expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
208
- expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
209
- expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
210
- end
211
- end
212
-
213
- describe '#sanitize_filename' do
214
- let(:api_client) { Sendpost::ApiClient.new }
215
-
216
- it 'works' do
217
- expect(api_client.sanitize_filename('sun')).to eq('sun')
218
- expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
219
- expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
220
- expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
221
- expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
222
- expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
223
- expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
224
- expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
225
- expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
226
- end
227
- end
228
- end
@@ -1,42 +0,0 @@
1
- =begin
2
- #SendPost API
3
-
4
- #Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: hello@sendpost.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
-
15
- describe Sendpost::Configuration do
16
- let(:config) { Sendpost::Configuration.default }
17
-
18
- before(:each) do
19
- # uncomment below to setup host and base_path
20
- # require 'URI'
21
- # uri = URI.parse("https://api.sendpost.io/api/v1")
22
- # Sendpost.configure do |c|
23
- # c.host = uri.host
24
- # c.base_path = uri.path
25
- # end
26
- end
27
-
28
- describe '#base_url' do
29
- it 'should have the default value' do
30
- # uncomment below to test default value of the base path
31
- # expect(config.base_url).to eq("https://api.sendpost.io/api/v1")
32
- end
33
-
34
- it 'should remove trailing slashes' do
35
- [nil, '', '/', '//'].each do |base_path|
36
- config.base_path = base_path
37
- # uncomment below to test trailing slashes
38
- # expect(config.base_url).to eq("https://api.sendpost.io/api/v1")
39
- end
40
- end
41
- end
42
- end
@@ -1,58 +0,0 @@
1
- =begin
2
- #SendPost API
3
-
4
- #Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: hello@sendpost.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Sendpost::City
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe Sendpost::City do
21
- let(:instance) { Sendpost::City.new }
22
-
23
- describe 'test an instance of City' do
24
- it 'should create an instance of City' do
25
- expect(instance).to be_instance_of(Sendpost::City)
26
- end
27
- end
28
- describe 'test attribute "city_id"' do
29
- it 'should work' do
30
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
31
- end
32
- end
33
-
34
- describe 'test attribute "continent_code"' do
35
- it 'should work' do
36
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
37
- end
38
- end
39
-
40
- describe 'test attribute "country_code"' do
41
- it 'should work' do
42
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
- end
44
- end
45
-
46
- describe 'test attribute "postal_code"' do
47
- it 'should work' do
48
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
- end
50
- end
51
-
52
- describe 'test attribute "time_zone"' do
53
- it 'should work' do
54
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
55
- end
56
- end
57
-
58
- end
@@ -1,34 +0,0 @@
1
- =begin
2
- #SendPost API
3
-
4
- #Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: hello@sendpost.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Sendpost::CountStat
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe Sendpost::CountStat do
21
- let(:instance) { Sendpost::CountStat.new }
22
-
23
- describe 'test an instance of CountStat' do
24
- it 'should create an instance of CountStat' do
25
- expect(instance).to be_instance_of(Sendpost::CountStat)
26
- end
27
- end
28
- describe 'test attribute "count"' do
29
- it 'should work' do
30
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
31
- end
32
- end
33
-
34
- end
@@ -1,40 +0,0 @@
1
- =begin
2
- #SendPost API
3
-
4
- #Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: hello@sendpost.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Sendpost::From
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe Sendpost::From do
21
- let(:instance) { Sendpost::From.new }
22
-
23
- describe 'test an instance of From' do
24
- it 'should create an instance of From' do
25
- expect(instance).to be_instance_of(Sendpost::From)
26
- end
27
- end
28
- describe 'test attribute "email"' do
29
- it 'should work' do
30
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
31
- end
32
- end
33
-
34
- describe 'test attribute "name"' do
35
- it 'should work' do
36
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
37
- end
38
- end
39
-
40
- end
@@ -1,58 +0,0 @@
1
- =begin
2
- #SendPost API
3
-
4
- #Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: hello@sendpost.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Sendpost::Os
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe Sendpost::Os do
21
- let(:instance) { Sendpost::Os.new }
22
-
23
- describe 'test an instance of Os' do
24
- it 'should create an instance of Os' do
25
- expect(instance).to be_instance_of(Sendpost::Os)
26
- end
27
- end
28
- describe 'test attribute "family"' do
29
- it 'should work' do
30
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
31
- end
32
- end
33
-
34
- describe 'test attribute "major"' do
35
- it 'should work' do
36
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
37
- end
38
- end
39
-
40
- describe 'test attribute "minor"' do
41
- it 'should work' do
42
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
- end
44
- end
45
-
46
- describe 'test attribute "patch"' do
47
- it 'should work' do
48
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
- end
50
- end
51
-
52
- describe 'test attribute "patch_minor"' do
53
- it 'should work' do
54
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
55
- end
56
- end
57
-
58
- end
@@ -1,190 +0,0 @@
1
- =begin
2
- #SendPost API
3
-
4
- #Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: hello@sendpost.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Sendpost::QEmailMessage
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe Sendpost::QEmailMessage do
21
- let(:instance) { Sendpost::QEmailMessage.new }
22
-
23
- describe 'test an instance of QEmailMessage' do
24
- it 'should create an instance of QEmailMessage' do
25
- expect(instance).to be_instance_of(Sendpost::QEmailMessage)
26
- end
27
- end
28
- describe 'test attribute "account_id"' do
29
- it 'should work' do
30
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
31
- end
32
- end
33
-
34
- describe 'test attribute "amp_body"' do
35
- it 'should work' do
36
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
37
- end
38
- end
39
-
40
- describe 'test attribute "attachments"' do
41
- it 'should work' do
42
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
- end
44
- end
45
-
46
- describe 'test attribute "attempt"' do
47
- it 'should work' do
48
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
- end
50
- end
51
-
52
- describe 'test attribute "custom_fields"' do
53
- it 'should work' do
54
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
55
- end
56
- end
57
-
58
- describe 'test attribute "email_type"' do
59
- it 'should work' do
60
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
61
- end
62
- end
63
-
64
- describe 'test attribute "from"' do
65
- it 'should work' do
66
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
67
- end
68
- end
69
-
70
- describe 'test attribute "groups"' do
71
- it 'should work' do
72
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
73
- end
74
- end
75
-
76
- describe 'test attribute "header_bcc"' do
77
- it 'should work' do
78
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
79
- end
80
- end
81
-
82
- describe 'test attribute "header_cc"' do
83
- it 'should work' do
84
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
85
- end
86
- end
87
-
88
- describe 'test attribute "header_to"' do
89
- it 'should work' do
90
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
91
- end
92
- end
93
-
94
- describe 'test attribute "headers"' do
95
- it 'should work' do
96
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
97
- end
98
- end
99
-
100
- describe 'test attribute "html_body"' do
101
- it 'should work' do
102
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
103
- end
104
- end
105
-
106
- describe 'test attribute "ip_id"' do
107
- it 'should work' do
108
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
109
- end
110
- end
111
-
112
- describe 'test attribute "ip_pool"' do
113
- it 'should work' do
114
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
115
- end
116
- end
117
-
118
- describe 'test attribute "local_ip"' do
119
- it 'should work' do
120
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
121
- end
122
- end
123
-
124
- describe 'test attribute "message_id"' do
125
- it 'should work' do
126
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
127
- end
128
- end
129
-
130
- describe 'test attribute "pre_text"' do
131
- it 'should work' do
132
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
133
- end
134
- end
135
-
136
- describe 'test attribute "public_ip"' do
137
- it 'should work' do
138
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
139
- end
140
- end
141
-
142
- describe 'test attribute "reply_to"' do
143
- it 'should work' do
144
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
145
- end
146
- end
147
-
148
- describe 'test attribute "sub_account_id"' do
149
- it 'should work' do
150
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
151
- end
152
- end
153
-
154
- describe 'test attribute "subject"' do
155
- it 'should work' do
156
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
157
- end
158
- end
159
-
160
- describe 'test attribute "submitted_at"' do
161
- it 'should work' do
162
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
163
- end
164
- end
165
-
166
- describe 'test attribute "text_body"' do
167
- it 'should work' do
168
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
169
- end
170
- end
171
-
172
- describe 'test attribute "to"' do
173
- it 'should work' do
174
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
175
- end
176
- end
177
-
178
- describe 'test attribute "track_clicks"' do
179
- it 'should work' do
180
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
181
- end
182
- end
183
-
184
- describe 'test attribute "track_opens"' do
185
- it 'should work' do
186
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
187
- end
188
- end
189
-
190
- end