sendpost_ruby_sdk 1.2.2 → 2.0.2

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 (293) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -0
  3. data/README.md +583 -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/DomainSpf.md +22 -0
  33. data/docs/DomainTrack.md +22 -0
  34. data/docs/EIP.md +18 -0
  35. data/docs/{From.md → EmailAddress.md} +4 -4
  36. data/docs/EmailApi.md +38 -32
  37. data/docs/EmailMessage.md +30 -24
  38. data/docs/EmailMessageFrom.md +20 -0
  39. data/docs/EmailMessageObject.md +46 -0
  40. data/docs/{ReplyTo.md → EmailMessageReplyTo.md} +5 -5
  41. data/docs/EmailMessageToInner.md +26 -0
  42. data/docs/EmailMessageToInnerBccInner.md +22 -0
  43. data/docs/EmailMessageToInnerCcInner.md +22 -0
  44. data/docs/EmailMessageWithTemplate.md +52 -0
  45. data/docs/EmailResponse.md +8 -8
  46. data/docs/EmailStats.md +20 -0
  47. data/docs/EmailStatsStats.md +38 -0
  48. data/docs/Event.md +56 -0
  49. data/docs/EventMetadata.md +13 -13
  50. data/docs/{City.md → GeoLocation.md} +8 -8
  51. data/docs/IP.md +62 -0
  52. data/docs/IPAllocationRequest.md +20 -0
  53. data/docs/IPApi.md +375 -0
  54. data/docs/IPDeletionResponse.md +20 -0
  55. data/docs/IPPool.md +42 -0
  56. data/docs/IPPoolCreateRequest.md +28 -0
  57. data/docs/IPPoolDeleteResponse.md +20 -0
  58. data/docs/IPPoolUpdateRequest.md +24 -0
  59. data/docs/IPPoolsApi.md +361 -0
  60. data/docs/IPUpdateRequest.md +18 -0
  61. data/docs/Label.md +22 -0
  62. data/docs/Member.md +40 -0
  63. data/docs/Message.md +76 -0
  64. data/docs/MessageApi.md +79 -0
  65. data/docs/MessageHeaderTo.md +26 -0
  66. data/docs/MessageTo.md +26 -0
  67. data/docs/{Os.md → OperatingSystem.md} +7 -7
  68. data/docs/Person.md +20 -0
  69. data/docs/{To.md → Recipient.md} +7 -7
  70. data/docs/SMTPAuth.md +26 -0
  71. data/docs/Stat.md +20 -0
  72. data/docs/StatStat.md +38 -0
  73. data/docs/StatStats.md +38 -0
  74. data/docs/StatsAApi.md +307 -0
  75. data/docs/StatsApi.md +237 -0
  76. data/docs/SubAccount.md +48 -0
  77. data/docs/SubAccountApi.md +375 -0
  78. data/docs/Suppression.md +8 -8
  79. data/docs/SuppressionApi.md +76 -134
  80. data/docs/ThirdPartySendingProvider.md +38 -0
  81. data/docs/UpdateSubAccount.md +18 -0
  82. data/docs/UpdateWebhook.md +46 -0
  83. data/docs/UserAgent.md +4 -4
  84. data/docs/Webhook.md +54 -0
  85. data/docs/WebhookApi.md +375 -0
  86. data/git_push.sh +1 -1
  87. data/lib/sendpost_ruby_sdk/api/domain_api.rb +290 -0
  88. data/lib/sendpost_ruby_sdk/api/email_api.rb +33 -35
  89. data/lib/sendpost_ruby_sdk/api/ip_api.rb +356 -0
  90. data/lib/sendpost_ruby_sdk/api/ip_pools_api.rb +356 -0
  91. data/lib/sendpost_ruby_sdk/api/message_api.rb +85 -0
  92. data/lib/sendpost_ruby_sdk/api/stats_a_api.rb +320 -0
  93. data/lib/sendpost_ruby_sdk/api/stats_api.rb +260 -0
  94. data/lib/sendpost_ruby_sdk/api/sub_account_api.rb +356 -0
  95. data/lib/sendpost_ruby_sdk/api/suppression_api.rb +81 -141
  96. data/lib/sendpost_ruby_sdk/api/webhook_api.rb +356 -0
  97. data/lib/sendpost_ruby_sdk/api_client.rb +26 -24
  98. data/lib/sendpost_ruby_sdk/api_error.rb +3 -3
  99. data/lib/sendpost_ruby_sdk/configuration.rb +28 -3
  100. data/lib/sendpost_ruby_sdk/models/account_stats.rb +229 -0
  101. data/lib/sendpost_ruby_sdk/models/account_stats_stat.rb +311 -0
  102. data/lib/sendpost_ruby_sdk/models/aggregate_stat.rb +321 -0
  103. data/lib/sendpost_ruby_sdk/models/aggregate_stats.rb +310 -0
  104. data/lib/sendpost_ruby_sdk/models/aggregated_email_stats.rb +321 -0
  105. data/lib/sendpost_ruby_sdk/models/attachment.rb +15 -7
  106. data/lib/sendpost_ruby_sdk/models/auto_warmup_plan.rb +531 -0
  107. data/lib/sendpost_ruby_sdk/models/copy_to.rb +28 -19
  108. data/lib/sendpost_ruby_sdk/models/create_domain_request.rb +221 -0
  109. data/lib/sendpost_ruby_sdk/models/create_sub_account_request.rb +221 -0
  110. data/lib/sendpost_ruby_sdk/models/create_suppression_request.rb +259 -0
  111. data/lib/sendpost_ruby_sdk/models/create_suppression_request_hard_bounce_inner.rb +220 -0
  112. data/lib/sendpost_ruby_sdk/models/create_suppression_request_manual_inner.rb +220 -0
  113. data/lib/sendpost_ruby_sdk/models/create_suppression_request_spam_complaint_inner.rb +220 -0
  114. data/lib/sendpost_ruby_sdk/models/create_suppression_request_unsubscribe_inner.rb +220 -0
  115. data/lib/sendpost_ruby_sdk/models/create_webhook_request.rb +361 -0
  116. data/lib/sendpost_ruby_sdk/models/delete_response.rb +15 -7
  117. data/lib/sendpost_ruby_sdk/models/delete_sub_account_response.rb +231 -0
  118. data/lib/sendpost_ruby_sdk/models/delete_suppression200_response_inner.rb +231 -0
  119. data/lib/sendpost_ruby_sdk/models/delete_suppression_request.rb +222 -0
  120. data/lib/sendpost_ruby_sdk/models/delete_webhook_response.rb +231 -0
  121. data/lib/sendpost_ruby_sdk/models/device.rb +13 -7
  122. data/lib/sendpost_ruby_sdk/models/domain.rb +435 -0
  123. data/lib/sendpost_ruby_sdk/models/domain_dkim.rb +239 -0
  124. data/lib/sendpost_ruby_sdk/models/domain_dmarc.rb +239 -0
  125. data/lib/sendpost_ruby_sdk/models/domain_gpt.rb +239 -0
  126. data/lib/sendpost_ruby_sdk/models/domain_return_path.rb +239 -0
  127. data/lib/sendpost_ruby_sdk/models/domain_spf.rb +239 -0
  128. data/lib/sendpost_ruby_sdk/models/domain_track.rb +239 -0
  129. data/lib/sendpost_ruby_sdk/models/eip.rb +238 -0
  130. data/lib/sendpost_ruby_sdk/models/email_address.rb +229 -0
  131. data/lib/sendpost_ruby_sdk/models/email_message.rb +121 -86
  132. data/lib/sendpost_ruby_sdk/models/email_message_from.rb +229 -0
  133. data/lib/sendpost_ruby_sdk/models/email_message_object.rb +354 -0
  134. data/lib/sendpost_ruby_sdk/models/email_message_reply_to.rb +229 -0
  135. data/lib/sendpost_ruby_sdk/models/email_message_to_inner.rb +262 -0
  136. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_bcc_inner.rb +240 -0
  137. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_cc_inner.rb +240 -0
  138. data/lib/sendpost_ruby_sdk/models/email_message_with_template.rb +392 -0
  139. data/lib/sendpost_ruby_sdk/models/email_response.rb +40 -32
  140. data/lib/sendpost_ruby_sdk/models/email_stats.rb +230 -0
  141. data/lib/sendpost_ruby_sdk/models/email_stats_stats.rb +321 -0
  142. data/lib/sendpost_ruby_sdk/models/event.rb +393 -0
  143. data/lib/sendpost_ruby_sdk/models/event_metadata.rb +59 -53
  144. data/lib/sendpost_ruby_sdk/models/geo_location.rb +256 -0
  145. data/lib/sendpost_ruby_sdk/models/ip.rb +643 -0
  146. data/lib/sendpost_ruby_sdk/models/ip_allocation_request.rb +266 -0
  147. data/lib/sendpost_ruby_sdk/models/ip_deletion_response.rb +265 -0
  148. data/lib/sendpost_ruby_sdk/models/ip_pool.rb +357 -0
  149. data/lib/sendpost_ruby_sdk/models/ip_pool_create_request.rb +299 -0
  150. data/lib/sendpost_ruby_sdk/models/ip_pool_delete_response.rb +229 -0
  151. data/lib/sendpost_ruby_sdk/models/ip_pool_update_request.rb +249 -0
  152. data/lib/sendpost_ruby_sdk/models/ip_update_request.rb +238 -0
  153. data/lib/sendpost_ruby_sdk/models/label.rb +241 -0
  154. data/lib/sendpost_ruby_sdk/models/member.rb +331 -0
  155. data/lib/sendpost_ruby_sdk/models/message.rb +523 -0
  156. data/lib/sendpost_ruby_sdk/models/message_header_to.rb +268 -0
  157. data/lib/sendpost_ruby_sdk/models/message_to.rb +268 -0
  158. data/lib/sendpost_ruby_sdk/models/operating_system.rb +256 -0
  159. data/lib/sendpost_ruby_sdk/models/person.rb +231 -0
  160. data/lib/sendpost_ruby_sdk/models/recipient.rb +263 -0
  161. data/lib/sendpost_ruby_sdk/models/smtp_auth.rb +261 -0
  162. data/lib/sendpost_ruby_sdk/models/stat.rb +230 -0
  163. data/lib/sendpost_ruby_sdk/models/stat_stat.rb +322 -0
  164. data/lib/sendpost_ruby_sdk/models/stat_stats.rb +321 -0
  165. data/lib/sendpost_ruby_sdk/models/sub_account.rb +415 -0
  166. data/lib/sendpost_ruby_sdk/models/suppression.rb +40 -29
  167. data/lib/sendpost_ruby_sdk/models/third_party_sending_provider.rb +310 -0
  168. data/lib/sendpost_ruby_sdk/models/update_sub_account.rb +221 -0
  169. data/lib/sendpost_ruby_sdk/models/update_webhook.rb +368 -0
  170. data/lib/sendpost_ruby_sdk/models/user_agent.rb +13 -7
  171. data/lib/sendpost_ruby_sdk/models/webhook.rb +405 -0
  172. data/lib/sendpost_ruby_sdk/version.rb +4 -4
  173. data/lib/sendpost_ruby_sdk.rb +73 -15
  174. data/spec/api/domain_api_spec.rb +85 -0
  175. data/spec/api/email_api_spec.rb +9 -9
  176. data/spec/api/ip_api_spec.rb +98 -0
  177. data/spec/api/ip_pools_api_spec.rb +98 -0
  178. data/spec/api/message_api_spec.rb +47 -0
  179. data/spec/api/stats_a_api_spec.rb +89 -0
  180. data/spec/api/stats_api_spec.rb +78 -0
  181. data/spec/api/sub_account_api_spec.rb +98 -0
  182. data/spec/api/suppression_api_spec.rb +22 -34
  183. data/spec/api/webhook_api_spec.rb +98 -0
  184. data/spec/models/account_stats_spec.rb +42 -0
  185. data/spec/models/account_stats_stat_spec.rb +96 -0
  186. data/spec/models/aggregate_stat_spec.rb +96 -0
  187. data/spec/models/aggregate_stats_spec.rb +96 -0
  188. data/spec/models/aggregated_email_stats_spec.rb +96 -0
  189. data/spec/models/attachment_spec.rb +6 -4
  190. data/spec/models/auto_warmup_plan_spec.rb +222 -0
  191. data/spec/models/copy_to_spec.rb +8 -6
  192. data/spec/models/create_domain_request_spec.rb +36 -0
  193. data/spec/models/create_sub_account_request_spec.rb +36 -0
  194. data/spec/models/create_suppression_request_hard_bounce_inner_spec.rb +36 -0
  195. data/spec/models/create_suppression_request_manual_inner_spec.rb +36 -0
  196. data/spec/models/create_suppression_request_spam_complaint_inner_spec.rb +36 -0
  197. data/spec/models/create_suppression_request_spec.rb +54 -0
  198. data/spec/models/create_suppression_request_unsubscribe_inner_spec.rb +36 -0
  199. data/spec/models/create_webhook_request_spec.rb +120 -0
  200. data/spec/models/delete_response_spec.rb +6 -4
  201. data/spec/models/delete_sub_account_response_spec.rb +42 -0
  202. data/spec/models/delete_suppression200_response_inner_spec.rb +42 -0
  203. data/spec/models/delete_suppression_request_spec.rb +36 -0
  204. data/spec/models/delete_webhook_response_spec.rb +42 -0
  205. data/spec/models/device_spec.rb +6 -4
  206. data/spec/models/domain_dkim_spec.rb +48 -0
  207. data/spec/models/domain_dmarc_spec.rb +48 -0
  208. data/spec/models/domain_gpt_spec.rb +48 -0
  209. data/spec/models/domain_return_path_spec.rb +48 -0
  210. data/spec/models/domain_spec.rb +150 -0
  211. data/spec/models/domain_spf_spec.rb +48 -0
  212. data/spec/models/domain_track_spec.rb +48 -0
  213. data/spec/models/eip_spec.rb +36 -0
  214. data/spec/models/email_address_spec.rb +42 -0
  215. data/spec/models/email_message_from_spec.rb +42 -0
  216. data/spec/models/email_message_object_spec.rb +120 -0
  217. data/spec/models/email_message_reply_to_spec.rb +42 -0
  218. data/spec/models/email_message_spec.rb +37 -17
  219. data/spec/models/email_message_to_inner_bcc_inner_spec.rb +48 -0
  220. data/spec/models/email_message_to_inner_cc_inner_spec.rb +48 -0
  221. data/spec/models/email_message_to_inner_spec.rb +60 -0
  222. data/spec/models/email_message_with_template_spec.rb +138 -0
  223. data/spec/models/email_response_spec.rb +10 -8
  224. data/spec/models/email_stats_spec.rb +42 -0
  225. data/spec/models/email_stats_stats_spec.rb +96 -0
  226. data/spec/models/event_metadata_spec.rb +24 -10
  227. data/spec/models/event_spec.rb +150 -0
  228. data/spec/models/geo_location_spec.rb +60 -0
  229. data/spec/models/ip_allocation_request_spec.rb +42 -0
  230. data/spec/models/ip_deletion_response_spec.rb +42 -0
  231. data/spec/models/ip_pool_create_request_spec.rb +66 -0
  232. data/spec/models/ip_pool_delete_response_spec.rb +42 -0
  233. data/spec/models/ip_pool_spec.rb +108 -0
  234. data/spec/models/ip_pool_update_request_spec.rb +54 -0
  235. data/spec/models/ip_spec.rb +168 -0
  236. data/spec/models/ip_update_request_spec.rb +36 -0
  237. data/spec/models/label_spec.rb +48 -0
  238. data/spec/models/member_spec.rb +102 -0
  239. data/spec/models/message_header_to_spec.rb +60 -0
  240. data/spec/models/message_spec.rb +210 -0
  241. data/spec/models/message_to_spec.rb +60 -0
  242. data/spec/models/operating_system_spec.rb +60 -0
  243. data/spec/models/person_spec.rb +42 -0
  244. data/spec/models/recipient_spec.rb +60 -0
  245. data/spec/models/smtp_auth_spec.rb +60 -0
  246. data/spec/models/stat_spec.rb +42 -0
  247. data/spec/models/stat_stat_spec.rb +96 -0
  248. data/spec/models/stat_stats_spec.rb +96 -0
  249. data/spec/models/sub_account_spec.rb +130 -0
  250. data/spec/models/suppression_spec.rb +11 -9
  251. data/spec/models/third_party_sending_provider_spec.rb +96 -0
  252. data/spec/models/update_sub_account_spec.rb +36 -0
  253. data/spec/models/update_webhook_spec.rb +120 -0
  254. data/spec/models/user_agent_spec.rb +6 -4
  255. data/spec/models/webhook_spec.rb +144 -0
  256. data/spec/spec_helper.rb +3 -3
  257. metadata +295 -66
  258. data/config-ruby.json +0 -11
  259. data/docs/CountStat.md +0 -18
  260. data/docs/QEmailMessage.md +0 -70
  261. data/docs/QEvent.md +0 -42
  262. data/docs/RDSuppression.md +0 -18
  263. data/docs/RSuppression.md +0 -24
  264. data/docs/WebhookEvent.md +0 -20
  265. data/generate-libs.bash +0 -1
  266. data/lib/sendpost_ruby_sdk/models/city.rb +0 -250
  267. data/lib/sendpost_ruby_sdk/models/count_stat.rb +0 -214
  268. data/lib/sendpost_ruby_sdk/models/from.rb +0 -223
  269. data/lib/sendpost_ruby_sdk/models/os.rb +0 -250
  270. data/lib/sendpost_ruby_sdk/models/q_email_message.rb +0 -456
  271. data/lib/sendpost_ruby_sdk/models/q_event.rb +0 -324
  272. data/lib/sendpost_ruby_sdk/models/r_suppression.rb +0 -249
  273. data/lib/sendpost_ruby_sdk/models/rd_suppression.rb +0 -216
  274. data/lib/sendpost_ruby_sdk/models/reply_to.rb +0 -223
  275. data/lib/sendpost_ruby_sdk/models/suppression_email.rb +0 -214
  276. data/lib/sendpost_ruby_sdk/models/to.rb +0 -254
  277. data/lib/sendpost_ruby_sdk/models/webhook_event.rb +0 -223
  278. data/sendpost.yaml +0 -666
  279. data/sendpost_ruby_sdk.gemspec +0 -38
  280. data/spec/api_client_spec.rb +0 -228
  281. data/spec/configuration_spec.rb +0 -42
  282. data/spec/models/city_spec.rb +0 -58
  283. data/spec/models/count_stat_spec.rb +0 -34
  284. data/spec/models/from_spec.rb +0 -40
  285. data/spec/models/os_spec.rb +0 -58
  286. data/spec/models/q_email_message_spec.rb +0 -190
  287. data/spec/models/q_event_spec.rb +0 -106
  288. data/spec/models/r_suppression_spec.rb +0 -52
  289. data/spec/models/rd_suppression_spec.rb +0 -34
  290. data/spec/models/reply_to_spec.rb +0 -40
  291. data/spec/models/suppression_email_spec.rb +0 -34
  292. data/spec/models/to_spec.rb +0 -58
  293. data/spec/models/webhook_event_spec.rb +0 -40
@@ -1,254 +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 'date'
14
- require 'time'
15
-
16
- module Sendpost
17
- class To
18
- attr_accessor :name
19
-
20
- attr_accessor :email
21
-
22
- attr_accessor :cc
23
-
24
- attr_accessor :bcc
25
-
26
- attr_accessor :custom_fields
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'name' => :'name',
32
- :'email' => :'email',
33
- :'cc' => :'cc',
34
- :'bcc' => :'bcc',
35
- :'custom_fields' => :'customFields'
36
- }
37
- end
38
-
39
- # Returns all the JSON keys this model knows about
40
- def self.acceptable_attributes
41
- attribute_map.values
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.openapi_types
46
- {
47
- :'name' => :'String',
48
- :'email' => :'String',
49
- :'cc' => :'Array<CopyTo>',
50
- :'bcc' => :'Array<CopyTo>',
51
- :'custom_fields' => :'Object'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
58
- ])
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendpost::To` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendpost::To`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
- end
73
- h[k.to_sym] = v
74
- }
75
-
76
- if attributes.key?(:'name')
77
- self.name = attributes[:'name']
78
- end
79
-
80
- if attributes.key?(:'email')
81
- self.email = attributes[:'email']
82
- end
83
-
84
- if attributes.key?(:'cc')
85
- if (value = attributes[:'cc']).is_a?(Array)
86
- self.cc = value
87
- end
88
- end
89
-
90
- if attributes.key?(:'bcc')
91
- if (value = attributes[:'bcc']).is_a?(Array)
92
- self.bcc = value
93
- end
94
- end
95
-
96
- if attributes.key?(:'custom_fields')
97
- self.custom_fields = attributes[:'custom_fields']
98
- end
99
- end
100
-
101
- # Show invalid properties with the reasons. Usually used together with valid?
102
- # @return Array for valid properties with the reasons
103
- def list_invalid_properties
104
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
- invalid_properties = Array.new
106
- invalid_properties
107
- end
108
-
109
- # Check to see if the all the properties in the model are valid
110
- # @return true if the model is valid
111
- def valid?
112
- warn '[DEPRECATED] the `valid?` method is obsolete'
113
- true
114
- end
115
-
116
- # Checks equality by comparing each attribute.
117
- # @param [Object] Object to be compared
118
- def ==(o)
119
- return true if self.equal?(o)
120
- self.class == o.class &&
121
- name == o.name &&
122
- email == o.email &&
123
- cc == o.cc &&
124
- bcc == o.bcc &&
125
- custom_fields == o.custom_fields
126
- end
127
-
128
- # @see the `==` method
129
- # @param [Object] Object to be compared
130
- def eql?(o)
131
- self == o
132
- end
133
-
134
- # Calculates hash code according to all attributes.
135
- # @return [Integer] Hash code
136
- def hash
137
- [name, email, cc, bcc, custom_fields].hash
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def self.build_from_hash(attributes)
144
- return nil unless attributes.is_a?(Hash)
145
- attributes = attributes.transform_keys(&:to_sym)
146
- transformed_hash = {}
147
- openapi_types.each_pair do |key, type|
148
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
149
- transformed_hash["#{key}"] = nil
150
- elsif type =~ /\AArray<(.*)>/i
151
- # check to ensure the input is an array given that the attribute
152
- # is documented as an array but the input is not
153
- if attributes[attribute_map[key]].is_a?(Array)
154
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
- end
156
- elsif !attributes[attribute_map[key]].nil?
157
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
- end
159
- end
160
- new(transformed_hash)
161
- end
162
-
163
- # Deserializes the data based on type
164
- # @param string type Data type
165
- # @param string value Value to be deserialized
166
- # @return [Object] Deserialized data
167
- def self._deserialize(type, value)
168
- case type.to_sym
169
- when :Time
170
- Time.parse(value)
171
- when :Date
172
- Date.parse(value)
173
- when :String
174
- value.to_s
175
- when :Integer
176
- value.to_i
177
- when :Float
178
- value.to_f
179
- when :Boolean
180
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
- true
182
- else
183
- false
184
- end
185
- when :Object
186
- # generic object (usually a Hash), return directly
187
- value
188
- when /\AArray<(?<inner_type>.+)>\z/
189
- inner_type = Regexp.last_match[:inner_type]
190
- value.map { |v| _deserialize(inner_type, v) }
191
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
- k_type = Regexp.last_match[:k_type]
193
- v_type = Regexp.last_match[:v_type]
194
- {}.tap do |hash|
195
- value.each do |k, v|
196
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
- end
198
- end
199
- else # model
200
- # models (e.g. Pet) or oneOf
201
- klass = Sendpost.const_get(type)
202
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
- end
204
- end
205
-
206
- # Returns the string representation of the object
207
- # @return [String] String presentation of the object
208
- def to_s
209
- to_hash.to_s
210
- end
211
-
212
- # to_body is an alias to to_hash (backward compatibility)
213
- # @return [Hash] Returns the object in the form of hash
214
- def to_body
215
- to_hash
216
- end
217
-
218
- # Returns the object in the form of hash
219
- # @return [Hash] Returns the object in the form of hash
220
- def to_hash
221
- hash = {}
222
- self.class.attribute_map.each_pair do |attr, param|
223
- value = self.send(attr)
224
- if value.nil?
225
- is_nullable = self.class.openapi_nullable.include?(attr)
226
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
- end
228
-
229
- hash[param] = _to_hash(value)
230
- end
231
- hash
232
- end
233
-
234
- # Outputs non-array value in the form of hash
235
- # For object, use to_hash. Otherwise, just return the value
236
- # @param [Object] value Any valid value
237
- # @return [Hash] Returns the value in the form of hash
238
- def _to_hash(value)
239
- if value.is_a?(Array)
240
- value.compact.map { |v| _to_hash(v) }
241
- elsif value.is_a?(Hash)
242
- {}.tap do |hash|
243
- value.each { |k, v| hash[k] = _to_hash(v) }
244
- end
245
- elsif value.respond_to? :to_hash
246
- value.to_hash
247
- else
248
- value
249
- end
250
- end
251
-
252
- end
253
-
254
- end
@@ -1,223 +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 'date'
14
- require 'time'
15
-
16
- module Sendpost
17
- class WebhookEvent
18
- attr_accessor :event
19
-
20
- attr_accessor :email_message
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'event' => :'event',
26
- :'email_message' => :'emailMessage'
27
- }
28
- end
29
-
30
- # Returns all the JSON keys this model knows about
31
- def self.acceptable_attributes
32
- attribute_map.values
33
- end
34
-
35
- # Attribute type mapping.
36
- def self.openapi_types
37
- {
38
- :'event' => :'QEvent',
39
- :'email_message' => :'QEmailMessage'
40
- }
41
- end
42
-
43
- # List of attributes with nullable: true
44
- def self.openapi_nullable
45
- Set.new([
46
- ])
47
- end
48
-
49
- # Initializes the object
50
- # @param [Hash] attributes Model attributes in the form of hash
51
- def initialize(attributes = {})
52
- if (!attributes.is_a?(Hash))
53
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendpost::WebhookEvent` initialize method"
54
- end
55
-
56
- # check to see if the attribute exists and convert string to symbol for hash key
57
- attributes = attributes.each_with_object({}) { |(k, v), h|
58
- if (!self.class.attribute_map.key?(k.to_sym))
59
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendpost::WebhookEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
- end
61
- h[k.to_sym] = v
62
- }
63
-
64
- if attributes.key?(:'event')
65
- self.event = attributes[:'event']
66
- end
67
-
68
- if attributes.key?(:'email_message')
69
- self.email_message = attributes[:'email_message']
70
- end
71
- end
72
-
73
- # Show invalid properties with the reasons. Usually used together with valid?
74
- # @return Array for valid properties with the reasons
75
- def list_invalid_properties
76
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
- invalid_properties = Array.new
78
- invalid_properties
79
- end
80
-
81
- # Check to see if the all the properties in the model are valid
82
- # @return true if the model is valid
83
- def valid?
84
- warn '[DEPRECATED] the `valid?` method is obsolete'
85
- true
86
- end
87
-
88
- # Checks equality by comparing each attribute.
89
- # @param [Object] Object to be compared
90
- def ==(o)
91
- return true if self.equal?(o)
92
- self.class == o.class &&
93
- event == o.event &&
94
- email_message == o.email_message
95
- end
96
-
97
- # @see the `==` method
98
- # @param [Object] Object to be compared
99
- def eql?(o)
100
- self == o
101
- end
102
-
103
- # Calculates hash code according to all attributes.
104
- # @return [Integer] Hash code
105
- def hash
106
- [event, email_message].hash
107
- end
108
-
109
- # Builds the object from hash
110
- # @param [Hash] attributes Model attributes in the form of hash
111
- # @return [Object] Returns the model itself
112
- def self.build_from_hash(attributes)
113
- return nil unless attributes.is_a?(Hash)
114
- attributes = attributes.transform_keys(&:to_sym)
115
- transformed_hash = {}
116
- openapi_types.each_pair do |key, type|
117
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
- transformed_hash["#{key}"] = nil
119
- elsif type =~ /\AArray<(.*)>/i
120
- # check to ensure the input is an array given that the attribute
121
- # is documented as an array but the input is not
122
- if attributes[attribute_map[key]].is_a?(Array)
123
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
- end
125
- elsif !attributes[attribute_map[key]].nil?
126
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
- end
128
- end
129
- new(transformed_hash)
130
- end
131
-
132
- # Deserializes the data based on type
133
- # @param string type Data type
134
- # @param string value Value to be deserialized
135
- # @return [Object] Deserialized data
136
- def self._deserialize(type, value)
137
- case type.to_sym
138
- when :Time
139
- Time.parse(value)
140
- when :Date
141
- Date.parse(value)
142
- when :String
143
- value.to_s
144
- when :Integer
145
- value.to_i
146
- when :Float
147
- value.to_f
148
- when :Boolean
149
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
- true
151
- else
152
- false
153
- end
154
- when :Object
155
- # generic object (usually a Hash), return directly
156
- value
157
- when /\AArray<(?<inner_type>.+)>\z/
158
- inner_type = Regexp.last_match[:inner_type]
159
- value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
- k_type = Regexp.last_match[:k_type]
162
- v_type = Regexp.last_match[:v_type]
163
- {}.tap do |hash|
164
- value.each do |k, v|
165
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
- end
167
- end
168
- else # model
169
- # models (e.g. Pet) or oneOf
170
- klass = Sendpost.const_get(type)
171
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
- end
173
- end
174
-
175
- # Returns the string representation of the object
176
- # @return [String] String presentation of the object
177
- def to_s
178
- to_hash.to_s
179
- end
180
-
181
- # to_body is an alias to to_hash (backward compatibility)
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_body
184
- to_hash
185
- end
186
-
187
- # Returns the object in the form of hash
188
- # @return [Hash] Returns the object in the form of hash
189
- def to_hash
190
- hash = {}
191
- self.class.attribute_map.each_pair do |attr, param|
192
- value = self.send(attr)
193
- if value.nil?
194
- is_nullable = self.class.openapi_nullable.include?(attr)
195
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
- end
197
-
198
- hash[param] = _to_hash(value)
199
- end
200
- hash
201
- end
202
-
203
- # Outputs non-array value in the form of hash
204
- # For object, use to_hash. Otherwise, just return the value
205
- # @param [Object] value Any valid value
206
- # @return [Hash] Returns the value in the form of hash
207
- def _to_hash(value)
208
- if value.is_a?(Array)
209
- value.compact.map { |v| _to_hash(v) }
210
- elsif value.is_a?(Hash)
211
- {}.tap do |hash|
212
- value.each { |k, v| hash[k] = _to_hash(v) }
213
- end
214
- elsif value.respond_to? :to_hash
215
- value.to_hash
216
- else
217
- value
218
- end
219
- end
220
-
221
- end
222
-
223
- end