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,250 +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 Os
18
- attr_accessor :family
19
-
20
- attr_accessor :major
21
-
22
- attr_accessor :minor
23
-
24
- attr_accessor :patch
25
-
26
- attr_accessor :patch_minor
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'family' => :'Family',
32
- :'major' => :'Major',
33
- :'minor' => :'Minor',
34
- :'patch' => :'Patch',
35
- :'patch_minor' => :'PatchMinor'
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
- :'family' => :'String',
48
- :'major' => :'String',
49
- :'minor' => :'String',
50
- :'patch' => :'String',
51
- :'patch_minor' => :'String'
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::Os` 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::Os`. 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?(:'family')
77
- self.family = attributes[:'family']
78
- end
79
-
80
- if attributes.key?(:'major')
81
- self.major = attributes[:'major']
82
- end
83
-
84
- if attributes.key?(:'minor')
85
- self.minor = attributes[:'minor']
86
- end
87
-
88
- if attributes.key?(:'patch')
89
- self.patch = attributes[:'patch']
90
- end
91
-
92
- if attributes.key?(:'patch_minor')
93
- self.patch_minor = attributes[:'patch_minor']
94
- end
95
- end
96
-
97
- # Show invalid properties with the reasons. Usually used together with valid?
98
- # @return Array for valid properties with the reasons
99
- def list_invalid_properties
100
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
- invalid_properties = Array.new
102
- invalid_properties
103
- end
104
-
105
- # Check to see if the all the properties in the model are valid
106
- # @return true if the model is valid
107
- def valid?
108
- warn '[DEPRECATED] the `valid?` method is obsolete'
109
- true
110
- end
111
-
112
- # Checks equality by comparing each attribute.
113
- # @param [Object] Object to be compared
114
- def ==(o)
115
- return true if self.equal?(o)
116
- self.class == o.class &&
117
- family == o.family &&
118
- major == o.major &&
119
- minor == o.minor &&
120
- patch == o.patch &&
121
- patch_minor == o.patch_minor
122
- end
123
-
124
- # @see the `==` method
125
- # @param [Object] Object to be compared
126
- def eql?(o)
127
- self == o
128
- end
129
-
130
- # Calculates hash code according to all attributes.
131
- # @return [Integer] Hash code
132
- def hash
133
- [family, major, minor, patch, patch_minor].hash
134
- end
135
-
136
- # Builds the object from hash
137
- # @param [Hash] attributes Model attributes in the form of hash
138
- # @return [Object] Returns the model itself
139
- def self.build_from_hash(attributes)
140
- return nil unless attributes.is_a?(Hash)
141
- attributes = attributes.transform_keys(&:to_sym)
142
- transformed_hash = {}
143
- openapi_types.each_pair do |key, type|
144
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
- transformed_hash["#{key}"] = nil
146
- elsif type =~ /\AArray<(.*)>/i
147
- # check to ensure the input is an array given that the attribute
148
- # is documented as an array but the input is not
149
- if attributes[attribute_map[key]].is_a?(Array)
150
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
- end
152
- elsif !attributes[attribute_map[key]].nil?
153
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
- end
155
- end
156
- new(transformed_hash)
157
- end
158
-
159
- # Deserializes the data based on type
160
- # @param string type Data type
161
- # @param string value Value to be deserialized
162
- # @return [Object] Deserialized data
163
- def self._deserialize(type, value)
164
- case type.to_sym
165
- when :Time
166
- Time.parse(value)
167
- when :Date
168
- Date.parse(value)
169
- when :String
170
- value.to_s
171
- when :Integer
172
- value.to_i
173
- when :Float
174
- value.to_f
175
- when :Boolean
176
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
- true
178
- else
179
- false
180
- end
181
- when :Object
182
- # generic object (usually a Hash), return directly
183
- value
184
- when /\AArray<(?<inner_type>.+)>\z/
185
- inner_type = Regexp.last_match[:inner_type]
186
- value.map { |v| _deserialize(inner_type, v) }
187
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
- k_type = Regexp.last_match[:k_type]
189
- v_type = Regexp.last_match[:v_type]
190
- {}.tap do |hash|
191
- value.each do |k, v|
192
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
- end
194
- end
195
- else # model
196
- # models (e.g. Pet) or oneOf
197
- klass = Sendpost.const_get(type)
198
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
- end
200
- end
201
-
202
- # Returns the string representation of the object
203
- # @return [String] String presentation of the object
204
- def to_s
205
- to_hash.to_s
206
- end
207
-
208
- # to_body is an alias to to_hash (backward compatibility)
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_body
211
- to_hash
212
- end
213
-
214
- # Returns the object in the form of hash
215
- # @return [Hash] Returns the object in the form of hash
216
- def to_hash
217
- hash = {}
218
- self.class.attribute_map.each_pair do |attr, param|
219
- value = self.send(attr)
220
- if value.nil?
221
- is_nullable = self.class.openapi_nullable.include?(attr)
222
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
- end
224
-
225
- hash[param] = _to_hash(value)
226
- end
227
- hash
228
- end
229
-
230
- # Outputs non-array value in the form of hash
231
- # For object, use to_hash. Otherwise, just return the value
232
- # @param [Object] value Any valid value
233
- # @return [Hash] Returns the value in the form of hash
234
- def _to_hash(value)
235
- if value.is_a?(Array)
236
- value.compact.map { |v| _to_hash(v) }
237
- elsif value.is_a?(Hash)
238
- {}.tap do |hash|
239
- value.each { |k, v| hash[k] = _to_hash(v) }
240
- end
241
- elsif value.respond_to? :to_hash
242
- value.to_hash
243
- else
244
- value
245
- end
246
- end
247
-
248
- end
249
-
250
- end
@@ -1,456 +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 QEmailMessage
18
- attr_accessor :account_id
19
-
20
- attr_accessor :amp_body
21
-
22
- attr_accessor :attachments
23
-
24
- attr_accessor :attempt
25
-
26
- attr_accessor :custom_fields
27
-
28
- attr_accessor :email_type
29
-
30
- attr_accessor :from
31
-
32
- attr_accessor :groups
33
-
34
- attr_accessor :header_bcc
35
-
36
- attr_accessor :header_cc
37
-
38
- attr_accessor :header_to
39
-
40
- attr_accessor :headers
41
-
42
- attr_accessor :html_body
43
-
44
- attr_accessor :ip_id
45
-
46
- attr_accessor :ip_pool
47
-
48
- attr_accessor :local_ip
49
-
50
- attr_accessor :message_id
51
-
52
- attr_accessor :pre_text
53
-
54
- attr_accessor :public_ip
55
-
56
- attr_accessor :reply_to
57
-
58
- attr_accessor :sub_account_id
59
-
60
- attr_accessor :subject
61
-
62
- attr_accessor :submitted_at
63
-
64
- attr_accessor :text_body
65
-
66
- attr_accessor :to
67
-
68
- attr_accessor :track_clicks
69
-
70
- attr_accessor :track_opens
71
-
72
- # Attribute mapping from ruby-style variable name to JSON key.
73
- def self.attribute_map
74
- {
75
- :'account_id' => :'accountID',
76
- :'amp_body' => :'ampBody',
77
- :'attachments' => :'attachments',
78
- :'attempt' => :'attempt',
79
- :'custom_fields' => :'customFields',
80
- :'email_type' => :'emailType',
81
- :'from' => :'from',
82
- :'groups' => :'groups',
83
- :'header_bcc' => :'headerBcc',
84
- :'header_cc' => :'headerCc',
85
- :'header_to' => :'headerTo',
86
- :'headers' => :'headers',
87
- :'html_body' => :'htmlBody',
88
- :'ip_id' => :'ipID',
89
- :'ip_pool' => :'ipPool',
90
- :'local_ip' => :'localIP',
91
- :'message_id' => :'messageID',
92
- :'pre_text' => :'preText',
93
- :'public_ip' => :'publicIP',
94
- :'reply_to' => :'replyTo',
95
- :'sub_account_id' => :'subAccountID',
96
- :'subject' => :'subject',
97
- :'submitted_at' => :'submittedAt',
98
- :'text_body' => :'textBody',
99
- :'to' => :'to',
100
- :'track_clicks' => :'trackClicks',
101
- :'track_opens' => :'trackOpens'
102
- }
103
- end
104
-
105
- # Returns all the JSON keys this model knows about
106
- def self.acceptable_attributes
107
- attribute_map.values
108
- end
109
-
110
- # Attribute type mapping.
111
- def self.openapi_types
112
- {
113
- :'account_id' => :'Integer',
114
- :'amp_body' => :'String',
115
- :'attachments' => :'Array<Attachment>',
116
- :'attempt' => :'Integer',
117
- :'custom_fields' => :'Object',
118
- :'email_type' => :'String',
119
- :'from' => :'From',
120
- :'groups' => :'Array<String>',
121
- :'header_bcc' => :'Array<CopyTo>',
122
- :'header_cc' => :'Array<CopyTo>',
123
- :'header_to' => :'To',
124
- :'headers' => :'Object',
125
- :'html_body' => :'String',
126
- :'ip_id' => :'Integer',
127
- :'ip_pool' => :'String',
128
- :'local_ip' => :'String',
129
- :'message_id' => :'String',
130
- :'pre_text' => :'String',
131
- :'public_ip' => :'String',
132
- :'reply_to' => :'ReplyTo',
133
- :'sub_account_id' => :'Integer',
134
- :'subject' => :'String',
135
- :'submitted_at' => :'Integer',
136
- :'text_body' => :'String',
137
- :'to' => :'To',
138
- :'track_clicks' => :'Boolean',
139
- :'track_opens' => :'Boolean'
140
- }
141
- end
142
-
143
- # List of attributes with nullable: true
144
- def self.openapi_nullable
145
- Set.new([
146
- ])
147
- end
148
-
149
- # Initializes the object
150
- # @param [Hash] attributes Model attributes in the form of hash
151
- def initialize(attributes = {})
152
- if (!attributes.is_a?(Hash))
153
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendpost::QEmailMessage` initialize method"
154
- end
155
-
156
- # check to see if the attribute exists and convert string to symbol for hash key
157
- attributes = attributes.each_with_object({}) { |(k, v), h|
158
- if (!self.class.attribute_map.key?(k.to_sym))
159
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendpost::QEmailMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
160
- end
161
- h[k.to_sym] = v
162
- }
163
-
164
- if attributes.key?(:'account_id')
165
- self.account_id = attributes[:'account_id']
166
- end
167
-
168
- if attributes.key?(:'amp_body')
169
- self.amp_body = attributes[:'amp_body']
170
- end
171
-
172
- if attributes.key?(:'attachments')
173
- if (value = attributes[:'attachments']).is_a?(Array)
174
- self.attachments = value
175
- end
176
- end
177
-
178
- if attributes.key?(:'attempt')
179
- self.attempt = attributes[:'attempt']
180
- end
181
-
182
- if attributes.key?(:'custom_fields')
183
- self.custom_fields = attributes[:'custom_fields']
184
- end
185
-
186
- if attributes.key?(:'email_type')
187
- self.email_type = attributes[:'email_type']
188
- end
189
-
190
- if attributes.key?(:'from')
191
- self.from = attributes[:'from']
192
- end
193
-
194
- if attributes.key?(:'groups')
195
- if (value = attributes[:'groups']).is_a?(Array)
196
- self.groups = value
197
- end
198
- end
199
-
200
- if attributes.key?(:'header_bcc')
201
- if (value = attributes[:'header_bcc']).is_a?(Array)
202
- self.header_bcc = value
203
- end
204
- end
205
-
206
- if attributes.key?(:'header_cc')
207
- if (value = attributes[:'header_cc']).is_a?(Array)
208
- self.header_cc = value
209
- end
210
- end
211
-
212
- if attributes.key?(:'header_to')
213
- self.header_to = attributes[:'header_to']
214
- end
215
-
216
- if attributes.key?(:'headers')
217
- self.headers = attributes[:'headers']
218
- end
219
-
220
- if attributes.key?(:'html_body')
221
- self.html_body = attributes[:'html_body']
222
- end
223
-
224
- if attributes.key?(:'ip_id')
225
- self.ip_id = attributes[:'ip_id']
226
- end
227
-
228
- if attributes.key?(:'ip_pool')
229
- self.ip_pool = attributes[:'ip_pool']
230
- end
231
-
232
- if attributes.key?(:'local_ip')
233
- self.local_ip = attributes[:'local_ip']
234
- end
235
-
236
- if attributes.key?(:'message_id')
237
- self.message_id = attributes[:'message_id']
238
- end
239
-
240
- if attributes.key?(:'pre_text')
241
- self.pre_text = attributes[:'pre_text']
242
- end
243
-
244
- if attributes.key?(:'public_ip')
245
- self.public_ip = attributes[:'public_ip']
246
- end
247
-
248
- if attributes.key?(:'reply_to')
249
- self.reply_to = attributes[:'reply_to']
250
- end
251
-
252
- if attributes.key?(:'sub_account_id')
253
- self.sub_account_id = attributes[:'sub_account_id']
254
- end
255
-
256
- if attributes.key?(:'subject')
257
- self.subject = attributes[:'subject']
258
- end
259
-
260
- if attributes.key?(:'submitted_at')
261
- self.submitted_at = attributes[:'submitted_at']
262
- end
263
-
264
- if attributes.key?(:'text_body')
265
- self.text_body = attributes[:'text_body']
266
- end
267
-
268
- if attributes.key?(:'to')
269
- self.to = attributes[:'to']
270
- end
271
-
272
- if attributes.key?(:'track_clicks')
273
- self.track_clicks = attributes[:'track_clicks']
274
- end
275
-
276
- if attributes.key?(:'track_opens')
277
- self.track_opens = attributes[:'track_opens']
278
- end
279
- end
280
-
281
- # Show invalid properties with the reasons. Usually used together with valid?
282
- # @return Array for valid properties with the reasons
283
- def list_invalid_properties
284
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
285
- invalid_properties = Array.new
286
- invalid_properties
287
- end
288
-
289
- # Check to see if the all the properties in the model are valid
290
- # @return true if the model is valid
291
- def valid?
292
- warn '[DEPRECATED] the `valid?` method is obsolete'
293
- true
294
- end
295
-
296
- # Checks equality by comparing each attribute.
297
- # @param [Object] Object to be compared
298
- def ==(o)
299
- return true if self.equal?(o)
300
- self.class == o.class &&
301
- account_id == o.account_id &&
302
- amp_body == o.amp_body &&
303
- attachments == o.attachments &&
304
- attempt == o.attempt &&
305
- custom_fields == o.custom_fields &&
306
- email_type == o.email_type &&
307
- from == o.from &&
308
- groups == o.groups &&
309
- header_bcc == o.header_bcc &&
310
- header_cc == o.header_cc &&
311
- header_to == o.header_to &&
312
- headers == o.headers &&
313
- html_body == o.html_body &&
314
- ip_id == o.ip_id &&
315
- ip_pool == o.ip_pool &&
316
- local_ip == o.local_ip &&
317
- message_id == o.message_id &&
318
- pre_text == o.pre_text &&
319
- public_ip == o.public_ip &&
320
- reply_to == o.reply_to &&
321
- sub_account_id == o.sub_account_id &&
322
- subject == o.subject &&
323
- submitted_at == o.submitted_at &&
324
- text_body == o.text_body &&
325
- to == o.to &&
326
- track_clicks == o.track_clicks &&
327
- track_opens == o.track_opens
328
- end
329
-
330
- # @see the `==` method
331
- # @param [Object] Object to be compared
332
- def eql?(o)
333
- self == o
334
- end
335
-
336
- # Calculates hash code according to all attributes.
337
- # @return [Integer] Hash code
338
- def hash
339
- [account_id, amp_body, attachments, attempt, custom_fields, email_type, from, groups, header_bcc, header_cc, header_to, headers, html_body, ip_id, ip_pool, local_ip, message_id, pre_text, public_ip, reply_to, sub_account_id, subject, submitted_at, text_body, to, track_clicks, track_opens].hash
340
- end
341
-
342
- # Builds the object from hash
343
- # @param [Hash] attributes Model attributes in the form of hash
344
- # @return [Object] Returns the model itself
345
- def self.build_from_hash(attributes)
346
- return nil unless attributes.is_a?(Hash)
347
- attributes = attributes.transform_keys(&:to_sym)
348
- transformed_hash = {}
349
- openapi_types.each_pair do |key, type|
350
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
351
- transformed_hash["#{key}"] = nil
352
- elsif type =~ /\AArray<(.*)>/i
353
- # check to ensure the input is an array given that the attribute
354
- # is documented as an array but the input is not
355
- if attributes[attribute_map[key]].is_a?(Array)
356
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
357
- end
358
- elsif !attributes[attribute_map[key]].nil?
359
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
360
- end
361
- end
362
- new(transformed_hash)
363
- end
364
-
365
- # Deserializes the data based on type
366
- # @param string type Data type
367
- # @param string value Value to be deserialized
368
- # @return [Object] Deserialized data
369
- def self._deserialize(type, value)
370
- case type.to_sym
371
- when :Time
372
- Time.parse(value)
373
- when :Date
374
- Date.parse(value)
375
- when :String
376
- value.to_s
377
- when :Integer
378
- value.to_i
379
- when :Float
380
- value.to_f
381
- when :Boolean
382
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
383
- true
384
- else
385
- false
386
- end
387
- when :Object
388
- # generic object (usually a Hash), return directly
389
- value
390
- when /\AArray<(?<inner_type>.+)>\z/
391
- inner_type = Regexp.last_match[:inner_type]
392
- value.map { |v| _deserialize(inner_type, v) }
393
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
394
- k_type = Regexp.last_match[:k_type]
395
- v_type = Regexp.last_match[:v_type]
396
- {}.tap do |hash|
397
- value.each do |k, v|
398
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
399
- end
400
- end
401
- else # model
402
- # models (e.g. Pet) or oneOf
403
- klass = Sendpost.const_get(type)
404
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
405
- end
406
- end
407
-
408
- # Returns the string representation of the object
409
- # @return [String] String presentation of the object
410
- def to_s
411
- to_hash.to_s
412
- end
413
-
414
- # to_body is an alias to to_hash (backward compatibility)
415
- # @return [Hash] Returns the object in the form of hash
416
- def to_body
417
- to_hash
418
- end
419
-
420
- # Returns the object in the form of hash
421
- # @return [Hash] Returns the object in the form of hash
422
- def to_hash
423
- hash = {}
424
- self.class.attribute_map.each_pair do |attr, param|
425
- value = self.send(attr)
426
- if value.nil?
427
- is_nullable = self.class.openapi_nullable.include?(attr)
428
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
429
- end
430
-
431
- hash[param] = _to_hash(value)
432
- end
433
- hash
434
- end
435
-
436
- # Outputs non-array value in the form of hash
437
- # For object, use to_hash. Otherwise, just return the value
438
- # @param [Object] value Any valid value
439
- # @return [Hash] Returns the value in the form of hash
440
- def _to_hash(value)
441
- if value.is_a?(Array)
442
- value.compact.map { |v| _to_hash(v) }
443
- elsif value.is_a?(Hash)
444
- {}.tap do |hash|
445
- value.each { |k, v| hash[k] = _to_hash(v) }
446
- end
447
- elsif value.respond_to? :to_hash
448
- value.to_hash
449
- else
450
- value
451
- end
452
- end
453
-
454
- end
455
-
456
- end