ElasticEmail 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +7 -0
  2. data/DIFF +0 -0
  3. data/ElasticEmail.gemspec +38 -0
  4. data/Gemfile +9 -0
  5. data/README.md +286 -0
  6. data/Rakefile +10 -0
  7. data/VERSION +1 -0
  8. data/docs/AccessLevel.md +15 -0
  9. data/docs/AccountStatusEnum.md +15 -0
  10. data/docs/ApiKey.md +28 -0
  11. data/docs/ApiKeyPayload.md +26 -0
  12. data/docs/BodyContentType.md +15 -0
  13. data/docs/BodyPart.md +22 -0
  14. data/docs/Campaign.md +26 -0
  15. data/docs/CampaignOptions.md +26 -0
  16. data/docs/CampaignRecipient.md +20 -0
  17. data/docs/CampaignStatus.md +15 -0
  18. data/docs/CampaignTemplate.md +30 -0
  19. data/docs/CampaignsApi.md +374 -0
  20. data/docs/ChannelLogStatusSummary.md +44 -0
  21. data/docs/CompressionFormat.md +15 -0
  22. data/docs/ConsentData.md +22 -0
  23. data/docs/ConsentTracking.md +15 -0
  24. data/docs/Contact.md +38 -0
  25. data/docs/ContactActivity.md +38 -0
  26. data/docs/ContactHistEventType.md +15 -0
  27. data/docs/ContactHistory.md +30 -0
  28. data/docs/ContactPayload.md +28 -0
  29. data/docs/ContactSource.md +15 -0
  30. data/docs/ContactStatus.md +15 -0
  31. data/docs/ContactUpdatePayload.md +22 -0
  32. data/docs/ContactsApi.md +756 -0
  33. data/docs/ContactsList.md +24 -0
  34. data/docs/DeliveryOptimizationType.md +15 -0
  35. data/docs/EmailContent.md +38 -0
  36. data/docs/EmailData.md +22 -0
  37. data/docs/EmailMessageData.md +22 -0
  38. data/docs/EmailRecipient.md +20 -0
  39. data/docs/EmailSend.md +20 -0
  40. data/docs/EmailStatus.md +40 -0
  41. data/docs/EmailTransactionalMessageData.md +22 -0
  42. data/docs/EmailValidationResult.md +34 -0
  43. data/docs/EmailValidationStatus.md +15 -0
  44. data/docs/EmailView.md +22 -0
  45. data/docs/EmailsApi.md +295 -0
  46. data/docs/EmailsPayload.md +20 -0
  47. data/docs/EncodingType.md +15 -0
  48. data/docs/EventType.md +15 -0
  49. data/docs/EventsApi.md +575 -0
  50. data/docs/EventsOrderBy.md +15 -0
  51. data/docs/ExportFileFormats.md +15 -0
  52. data/docs/ExportLink.md +20 -0
  53. data/docs/ExportStatus.md +15 -0
  54. data/docs/FileInfo.md +26 -0
  55. data/docs/FilePayload.md +22 -0
  56. data/docs/FileUploadResult.md +20 -0
  57. data/docs/FilesApi.md +374 -0
  58. data/docs/InboundPayload.md +28 -0
  59. data/docs/InboundRoute.md +30 -0
  60. data/docs/InboundRouteActionType.md +15 -0
  61. data/docs/InboundRouteApi.md +437 -0
  62. data/docs/InboundRouteFilterType.md +15 -0
  63. data/docs/ListPayload.md +22 -0
  64. data/docs/ListUpdatePayload.md +20 -0
  65. data/docs/ListsApi.md +519 -0
  66. data/docs/LogJobStatus.md +15 -0
  67. data/docs/LogStatusSummary.md +42 -0
  68. data/docs/MergeEmailPayload.md +22 -0
  69. data/docs/MessageAttachment.md +22 -0
  70. data/docs/MessageCategory.md +15 -0
  71. data/docs/NewApiKey.md +30 -0
  72. data/docs/NewSmtpCredentials.md +30 -0
  73. data/docs/Options.md +28 -0
  74. data/docs/RecipientEvent.md +42 -0
  75. data/docs/SecurityApi.md +749 -0
  76. data/docs/Segment.md +20 -0
  77. data/docs/SegmentPayload.md +20 -0
  78. data/docs/SegmentsApi.md +372 -0
  79. data/docs/SmtpCredentials.md +28 -0
  80. data/docs/SmtpCredentialsPayload.md +24 -0
  81. data/docs/SortOrderItem.md +20 -0
  82. data/docs/SplitOptimizationType.md +15 -0
  83. data/docs/SplitOptions.md +20 -0
  84. data/docs/StatisticsApi.md +379 -0
  85. data/docs/SubAccountInfo.md +34 -0
  86. data/docs/SubAccountsApi.md +445 -0
  87. data/docs/SubaccountEmailCreditsPayload.md +20 -0
  88. data/docs/SubaccountEmailSettings.md +30 -0
  89. data/docs/SubaccountEmailSettingsPayload.md +28 -0
  90. data/docs/SubaccountPayload.md +24 -0
  91. data/docs/SubaccountSettingsInfo.md +18 -0
  92. data/docs/SubaccountSettingsInfoPayload.md +18 -0
  93. data/docs/Suppression.md +24 -0
  94. data/docs/SuppressionsApi.md +895 -0
  95. data/docs/Template.md +28 -0
  96. data/docs/TemplatePayload.md +24 -0
  97. data/docs/TemplateScopeType.md +15 -0
  98. data/docs/TemplateType.md +15 -0
  99. data/docs/TemplatesApi.md +376 -0
  100. data/docs/TransactionalRecipient.md +22 -0
  101. data/docs/Utm.md +24 -0
  102. data/docs/VerificationFileResult.md +28 -0
  103. data/docs/VerificationFileResultDetails.md +30 -0
  104. data/docs/VerificationStatus.md +15 -0
  105. data/docs/VerificationsApi.md +662 -0
  106. data/lib/ElasticEmail.rb +137 -0
  107. data/lib/ElasticEmail/api/campaigns_api.rb +348 -0
  108. data/lib/ElasticEmail/api/contacts_api.rb +681 -0
  109. data/lib/ElasticEmail/api/emails_api.rb +280 -0
  110. data/lib/ElasticEmail/api/events_api.rb +538 -0
  111. data/lib/ElasticEmail/api/files_api.rb +340 -0
  112. data/lib/ElasticEmail/api/inbound_route_api.rb +404 -0
  113. data/lib/ElasticEmail/api/lists_api.rb +485 -0
  114. data/lib/ElasticEmail/api/security_api.rb +674 -0
  115. data/lib/ElasticEmail/api/segments_api.rb +345 -0
  116. data/lib/ElasticEmail/api/statistics_api.rb +341 -0
  117. data/lib/ElasticEmail/api/sub_accounts_api.rb +414 -0
  118. data/lib/ElasticEmail/api/suppressions_api.rb +782 -0
  119. data/lib/ElasticEmail/api/templates_api.rb +355 -0
  120. data/lib/ElasticEmail/api/verifications_api.rb +584 -0
  121. data/lib/ElasticEmail/api_client.rb +390 -0
  122. data/lib/ElasticEmail/api_error.rb +57 -0
  123. data/lib/ElasticEmail/configuration.rb +277 -0
  124. data/lib/ElasticEmail/models/access_level.rb +79 -0
  125. data/lib/ElasticEmail/models/account_status_enum.rb +40 -0
  126. data/lib/ElasticEmail/models/api_key.rb +276 -0
  127. data/lib/ElasticEmail/models/api_key_payload.rb +265 -0
  128. data/lib/ElasticEmail/models/body_content_type.rb +39 -0
  129. data/lib/ElasticEmail/models/body_part.rb +240 -0
  130. data/lib/ElasticEmail/models/campaign.rb +261 -0
  131. data/lib/ElasticEmail/models/campaign_options.rb +263 -0
  132. data/lib/ElasticEmail/models/campaign_recipient.rb +234 -0
  133. data/lib/ElasticEmail/models/campaign_status.rb +43 -0
  134. data/lib/ElasticEmail/models/campaign_template.rb +282 -0
  135. data/lib/ElasticEmail/models/channel_log_status_summary.rb +350 -0
  136. data/lib/ElasticEmail/models/compression_format.rb +37 -0
  137. data/lib/ElasticEmail/models/consent_data.rb +240 -0
  138. data/lib/ElasticEmail/models/consent_tracking.rb +38 -0
  139. data/lib/ElasticEmail/models/contact.rb +323 -0
  140. data/lib/ElasticEmail/models/contact_activity.rb +324 -0
  141. data/lib/ElasticEmail/models/contact_hist_event_type.rb +49 -0
  142. data/lib/ElasticEmail/models/contact_history.rb +279 -0
  143. data/lib/ElasticEmail/models/contact_payload.rb +270 -0
  144. data/lib/ElasticEmail/models/contact_source.rb +42 -0
  145. data/lib/ElasticEmail/models/contact_status.rb +44 -0
  146. data/lib/ElasticEmail/models/contact_update_payload.rb +241 -0
  147. data/lib/ElasticEmail/models/contacts_list.rb +251 -0
  148. data/lib/ElasticEmail/models/delivery_optimization_type.rb +38 -0
  149. data/lib/ElasticEmail/models/email_content.rb +330 -0
  150. data/lib/ElasticEmail/models/email_data.rb +241 -0
  151. data/lib/ElasticEmail/models/email_message_data.rb +242 -0
  152. data/lib/ElasticEmail/models/email_recipient.rb +232 -0
  153. data/lib/ElasticEmail/models/email_send.rb +229 -0
  154. data/lib/ElasticEmail/models/email_status.rb +332 -0
  155. data/lib/ElasticEmail/models/email_transactional_message_data.rb +240 -0
  156. data/lib/ElasticEmail/models/email_validation_result.rb +300 -0
  157. data/lib/ElasticEmail/models/email_validation_status.rb +40 -0
  158. data/lib/ElasticEmail/models/email_view.rb +240 -0
  159. data/lib/ElasticEmail/models/emails_payload.rb +232 -0
  160. data/lib/ElasticEmail/models/encoding_type.rb +42 -0
  161. data/lib/ElasticEmail/models/event_type.rb +43 -0
  162. data/lib/ElasticEmail/models/events_order_by.rb +37 -0
  163. data/lib/ElasticEmail/models/export_file_formats.rb +38 -0
  164. data/lib/ElasticEmail/models/export_link.rb +229 -0
  165. data/lib/ElasticEmail/models/export_status.rb +39 -0
  166. data/lib/ElasticEmail/models/file_info.rb +262 -0
  167. data/lib/ElasticEmail/models/file_payload.rb +239 -0
  168. data/lib/ElasticEmail/models/file_upload_result.rb +229 -0
  169. data/lib/ElasticEmail/models/inbound_payload.rb +269 -0
  170. data/lib/ElasticEmail/models/inbound_route.rb +278 -0
  171. data/lib/ElasticEmail/models/inbound_route_action_type.rb +38 -0
  172. data/lib/ElasticEmail/models/inbound_route_filter_type.rb +37 -0
  173. data/lib/ElasticEmail/models/list_payload.rb +241 -0
  174. data/lib/ElasticEmail/models/list_update_payload.rb +229 -0
  175. data/lib/ElasticEmail/models/log_job_status.rb +45 -0
  176. data/lib/ElasticEmail/models/log_status_summary.rb +340 -0
  177. data/lib/ElasticEmail/models/merge_email_payload.rb +239 -0
  178. data/lib/ElasticEmail/models/message_attachment.rb +237 -0
  179. data/lib/ElasticEmail/models/message_category.rb +52 -0
  180. data/lib/ElasticEmail/models/new_api_key.rb +286 -0
  181. data/lib/ElasticEmail/models/new_smtp_credentials.rb +284 -0
  182. data/lib/ElasticEmail/models/options.rb +271 -0
  183. data/lib/ElasticEmail/models/recipient_event.rb +341 -0
  184. data/lib/ElasticEmail/models/segment.rb +230 -0
  185. data/lib/ElasticEmail/models/segment_payload.rb +229 -0
  186. data/lib/ElasticEmail/models/smtp_credentials.rb +274 -0
  187. data/lib/ElasticEmail/models/smtp_credentials_payload.rb +253 -0
  188. data/lib/ElasticEmail/models/sort_order_item.rb +229 -0
  189. data/lib/ElasticEmail/models/split_optimization_type.rb +37 -0
  190. data/lib/ElasticEmail/models/split_options.rb +230 -0
  191. data/lib/ElasticEmail/models/sub_account_info.rb +300 -0
  192. data/lib/ElasticEmail/models/subaccount_email_credits_payload.rb +230 -0
  193. data/lib/ElasticEmail/models/subaccount_email_settings.rb +280 -0
  194. data/lib/ElasticEmail/models/subaccount_email_settings_payload.rb +270 -0
  195. data/lib/ElasticEmail/models/subaccount_payload.rb +250 -0
  196. data/lib/ElasticEmail/models/subaccount_settings_info.rb +220 -0
  197. data/lib/ElasticEmail/models/subaccount_settings_info_payload.rb +220 -0
  198. data/lib/ElasticEmail/models/suppression.rb +252 -0
  199. data/lib/ElasticEmail/models/template.rb +272 -0
  200. data/lib/ElasticEmail/models/template_payload.rb +252 -0
  201. data/lib/ElasticEmail/models/template_scope_type.rb +38 -0
  202. data/lib/ElasticEmail/models/template_type.rb +38 -0
  203. data/lib/ElasticEmail/models/transactional_recipient.rb +246 -0
  204. data/lib/ElasticEmail/models/utm.rb +250 -0
  205. data/lib/ElasticEmail/models/verification_file_result.rb +270 -0
  206. data/lib/ElasticEmail/models/verification_file_result_details.rb +282 -0
  207. data/lib/ElasticEmail/models/verification_status.rb +40 -0
  208. data/lib/ElasticEmail/version.rb +15 -0
  209. data/spec/api/campaigns_api_spec.rb +98 -0
  210. data/spec/api/contacts_api_spec.rb +166 -0
  211. data/spec/api/emails_api_spec.rb +83 -0
  212. data/spec/api/events_api_spec.rb +146 -0
  213. data/spec/api/files_api_spec.rb +97 -0
  214. data/spec/api/inbound_route_api_spec.rb +107 -0
  215. data/spec/api/lists_api_spec.rb +123 -0
  216. data/spec/api/security_api_spec.rb +161 -0
  217. data/spec/api/segments_api_spec.rb +97 -0
  218. data/spec/api/statistics_api_spec.rb +98 -0
  219. data/spec/api/sub_accounts_api_spec.rb +110 -0
  220. data/spec/api/suppressions_api_spec.rb +186 -0
  221. data/spec/api/templates_api_spec.rb +99 -0
  222. data/spec/api/verifications_api_spec.rb +145 -0
  223. data/spec/api_client_spec.rb +226 -0
  224. data/spec/configuration_spec.rb +42 -0
  225. data/spec/models/access_level_spec.rb +28 -0
  226. data/spec/models/account_status_enum_spec.rb +28 -0
  227. data/spec/models/api_key_payload_spec.rb +58 -0
  228. data/spec/models/api_key_spec.rb +64 -0
  229. data/spec/models/body_content_type_spec.rb +28 -0
  230. data/spec/models/body_part_spec.rb +46 -0
  231. data/spec/models/campaign_options_spec.rb +58 -0
  232. data/spec/models/campaign_recipient_spec.rb +40 -0
  233. data/spec/models/campaign_spec.rb +58 -0
  234. data/spec/models/campaign_status_spec.rb +28 -0
  235. data/spec/models/campaign_template_spec.rb +70 -0
  236. data/spec/models/channel_log_status_summary_spec.rb +112 -0
  237. data/spec/models/compression_format_spec.rb +28 -0
  238. data/spec/models/consent_data_spec.rb +46 -0
  239. data/spec/models/consent_tracking_spec.rb +28 -0
  240. data/spec/models/contact_activity_spec.rb +94 -0
  241. data/spec/models/contact_hist_event_type_spec.rb +28 -0
  242. data/spec/models/contact_history_spec.rb +70 -0
  243. data/spec/models/contact_payload_spec.rb +64 -0
  244. data/spec/models/contact_source_spec.rb +28 -0
  245. data/spec/models/contact_spec.rb +94 -0
  246. data/spec/models/contact_status_spec.rb +28 -0
  247. data/spec/models/contact_update_payload_spec.rb +46 -0
  248. data/spec/models/contacts_list_spec.rb +52 -0
  249. data/spec/models/delivery_optimization_type_spec.rb +28 -0
  250. data/spec/models/email_content_spec.rb +94 -0
  251. data/spec/models/email_data_spec.rb +46 -0
  252. data/spec/models/email_message_data_spec.rb +46 -0
  253. data/spec/models/email_recipient_spec.rb +40 -0
  254. data/spec/models/email_send_spec.rb +40 -0
  255. data/spec/models/email_status_spec.rb +100 -0
  256. data/spec/models/email_transactional_message_data_spec.rb +46 -0
  257. data/spec/models/email_validation_result_spec.rb +82 -0
  258. data/spec/models/email_validation_status_spec.rb +28 -0
  259. data/spec/models/email_view_spec.rb +46 -0
  260. data/spec/models/emails_payload_spec.rb +40 -0
  261. data/spec/models/encoding_type_spec.rb +28 -0
  262. data/spec/models/event_type_spec.rb +28 -0
  263. data/spec/models/events_order_by_spec.rb +28 -0
  264. data/spec/models/export_file_formats_spec.rb +28 -0
  265. data/spec/models/export_link_spec.rb +40 -0
  266. data/spec/models/export_status_spec.rb +28 -0
  267. data/spec/models/file_info_spec.rb +58 -0
  268. data/spec/models/file_payload_spec.rb +46 -0
  269. data/spec/models/file_upload_result_spec.rb +40 -0
  270. data/spec/models/inbound_payload_spec.rb +64 -0
  271. data/spec/models/inbound_route_action_type_spec.rb +28 -0
  272. data/spec/models/inbound_route_filter_type_spec.rb +28 -0
  273. data/spec/models/inbound_route_spec.rb +70 -0
  274. data/spec/models/list_payload_spec.rb +46 -0
  275. data/spec/models/list_update_payload_spec.rb +40 -0
  276. data/spec/models/log_job_status_spec.rb +28 -0
  277. data/spec/models/log_status_summary_spec.rb +106 -0
  278. data/spec/models/merge_email_payload_spec.rb +46 -0
  279. data/spec/models/message_attachment_spec.rb +46 -0
  280. data/spec/models/message_category_spec.rb +28 -0
  281. data/spec/models/new_api_key_spec.rb +70 -0
  282. data/spec/models/new_smtp_credentials_spec.rb +70 -0
  283. data/spec/models/options_spec.rb +64 -0
  284. data/spec/models/recipient_event_spec.rb +106 -0
  285. data/spec/models/segment_payload_spec.rb +40 -0
  286. data/spec/models/segment_spec.rb +40 -0
  287. data/spec/models/smtp_credentials_payload_spec.rb +52 -0
  288. data/spec/models/smtp_credentials_spec.rb +64 -0
  289. data/spec/models/sort_order_item_spec.rb +40 -0
  290. data/spec/models/split_optimization_type_spec.rb +28 -0
  291. data/spec/models/split_options_spec.rb +40 -0
  292. data/spec/models/sub_account_info_spec.rb +82 -0
  293. data/spec/models/subaccount_email_credits_payload_spec.rb +40 -0
  294. data/spec/models/subaccount_email_settings_payload_spec.rb +64 -0
  295. data/spec/models/subaccount_email_settings_spec.rb +70 -0
  296. data/spec/models/subaccount_payload_spec.rb +52 -0
  297. data/spec/models/subaccount_settings_info_payload_spec.rb +34 -0
  298. data/spec/models/subaccount_settings_info_spec.rb +34 -0
  299. data/spec/models/suppression_spec.rb +52 -0
  300. data/spec/models/template_payload_spec.rb +52 -0
  301. data/spec/models/template_scope_type_spec.rb +28 -0
  302. data/spec/models/template_spec.rb +64 -0
  303. data/spec/models/template_type_spec.rb +28 -0
  304. data/spec/models/transactional_recipient_spec.rb +46 -0
  305. data/spec/models/utm_spec.rb +52 -0
  306. data/spec/models/verification_file_result_details_spec.rb +70 -0
  307. data/spec/models/verification_file_result_spec.rb +64 -0
  308. data/spec/models/verification_status_spec.rb +28 -0
  309. data/spec/spec_helper.rb +111 -0
  310. metadata +498 -0
@@ -0,0 +1,39 @@
1
+ =begin
2
+ #Elastic Email REST API
3
+
4
+ #This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. To start using this API, you will need your Access Token (available <a href=\"https://elasticemail.com/account#/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. This is the documentation for REST API. If you’d like to read our legacy documentation regarding Web API v2 click <a href=\"https://api.elasticemail.com/public/help\">here</a>.
5
+
6
+ The version of the OpenAPI document: 4.0.0
7
+ Contact: support@elasticemail.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ElasticEmail
17
+ class ExportStatus
18
+ ERROR = "Error".freeze
19
+ LOADING = "Loading".freeze
20
+ READY = "Ready".freeze
21
+ EXPIRED = "Expired".freeze
22
+
23
+ # Builds the enum from string
24
+ # @param [String] The enum value in the form of the string
25
+ # @return [String] The enum value
26
+ def self.build_from_hash(value)
27
+ new.build_from_hash(value)
28
+ end
29
+
30
+ # Builds the enum from string
31
+ # @param [String] The enum value in the form of the string
32
+ # @return [String] The enum value
33
+ def build_from_hash(value)
34
+ constantValues = ExportStatus.constants.select { |c| ExportStatus::const_get(c) == value }
35
+ raise "Invalid ENUM value #{value} for class #ExportStatus" if constantValues.empty?
36
+ value
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #Elastic Email REST API
3
+
4
+ #This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. To start using this API, you will need your Access Token (available <a href=\"https://elasticemail.com/account#/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. This is the documentation for REST API. If you’d like to read our legacy documentation regarding Web API v2 click <a href=\"https://api.elasticemail.com/public/help\">here</a>.
5
+
6
+ The version of the OpenAPI document: 4.0.0
7
+ Contact: support@elasticemail.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ElasticEmail
17
+ # File information
18
+ class FileInfo
19
+ # Name of your file including extension.
20
+ attr_accessor :file_name
21
+
22
+ # Size of your attachment (in bytes).
23
+ attr_accessor :size
24
+
25
+ # Date of creation in YYYY-MM-DDThh:ii:ss format
26
+ attr_accessor :date_added
27
+
28
+ # Date when the file will be deleted from your Account.
29
+ attr_accessor :expiration_date
30
+
31
+ # Content type of the file.
32
+ attr_accessor :content_type
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'file_name' => :'FileName',
38
+ :'size' => :'Size',
39
+ :'date_added' => :'DateAdded',
40
+ :'expiration_date' => :'ExpirationDate',
41
+ :'content_type' => :'ContentType'
42
+ }
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'file_name' => :'String',
54
+ :'size' => :'Integer',
55
+ :'date_added' => :'Time',
56
+ :'expiration_date' => :'Time',
57
+ :'content_type' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'size',
65
+ :'expiration_date',
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ElasticEmail::FileInfo` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!self.class.attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ElasticEmail::FileInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'file_name')
85
+ self.file_name = attributes[:'file_name']
86
+ end
87
+
88
+ if attributes.key?(:'size')
89
+ self.size = attributes[:'size']
90
+ end
91
+
92
+ if attributes.key?(:'date_added')
93
+ self.date_added = attributes[:'date_added']
94
+ end
95
+
96
+ if attributes.key?(:'expiration_date')
97
+ self.expiration_date = attributes[:'expiration_date']
98
+ end
99
+
100
+ if attributes.key?(:'content_type')
101
+ self.content_type = attributes[:'content_type']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ file_name == o.file_name &&
124
+ size == o.size &&
125
+ date_added == o.date_added &&
126
+ expiration_date == o.expiration_date &&
127
+ content_type == o.content_type
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [file_name, size, date_added, expiration_date, content_type].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ new.build_from_hash(attributes)
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
156
+ self.send("#{key}=", nil)
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :Time
178
+ Time.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet) or oneOf
209
+ klass = ElasticEmail.const_get(type)
210
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #Elastic Email REST API
3
+
4
+ #This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. To start using this API, you will need your Access Token (available <a href=\"https://elasticemail.com/account#/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. This is the documentation for REST API. If you’d like to read our legacy documentation regarding Web API v2 click <a href=\"https://api.elasticemail.com/public/help\">here</a>.
5
+
6
+ The version of the OpenAPI document: 4.0.0
7
+ Contact: support@elasticemail.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ElasticEmail
17
+ class FilePayload
18
+ # Content of the file sent as binary data
19
+ attr_accessor :binary_content
20
+
21
+ # Filename
22
+ attr_accessor :name
23
+
24
+ # Type of file's content (e.g. image/jpeg)
25
+ attr_accessor :content_type
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'binary_content' => :'BinaryContent',
31
+ :'name' => :'Name',
32
+ :'content_type' => :'ContentType'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'binary_content' => :'String',
45
+ :'name' => :'String',
46
+ :'content_type' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ElasticEmail::FilePayload` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ElasticEmail::FilePayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'binary_content')
72
+ self.binary_content = attributes[:'binary_content']
73
+ end
74
+
75
+ if attributes.key?(:'name')
76
+ self.name = attributes[:'name']
77
+ end
78
+
79
+ if attributes.key?(:'content_type')
80
+ self.content_type = attributes[:'content_type']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ binary_content == o.binary_content &&
103
+ name == o.name &&
104
+ content_type == o.content_type
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [binary_content, name, content_type].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = ElasticEmail.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end