ElasticEmail 4.0.26 → 4.0.28

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 (263) hide show
  1. checksums.yaml +4 -4
  2. data/ElasticEmail.gemspec +2 -2
  3. data/README.md +24 -9
  4. data/VERSION +1 -1
  5. data/docs/Campaign.md +2 -0
  6. data/docs/CampaignOptions.md +3 -1
  7. data/docs/CampaignTemplate.md +2 -2
  8. data/docs/CampaignsApi.md +12 -12
  9. data/docs/Contact.md +2 -0
  10. data/docs/ContactsApi.md +18 -18
  11. data/docs/DomainsApi.md +16 -16
  12. data/docs/EmailContent.md +2 -2
  13. data/docs/EmailsApi.md +10 -10
  14. data/docs/EventsApi.md +14 -14
  15. data/docs/FilesApi.md +10 -10
  16. data/docs/InboundRouteApi.md +12 -12
  17. data/docs/ListsApi.md +16 -16
  18. data/docs/MessageAttachment.md +2 -2
  19. data/docs/RecipientEvent.md +2 -2
  20. data/docs/SecurityApi.md +30 -30
  21. data/docs/SegmentsApi.md +10 -10
  22. data/docs/StatisticsApi.md +10 -10
  23. data/docs/SubAccountsApi.md +12 -12
  24. data/docs/SuppressionsApi.md +24 -24
  25. data/docs/TemplatesApi.md +10 -10
  26. data/docs/VerificationsApi.md +25 -25
  27. data/docs/Webhook.md +42 -0
  28. data/docs/WebhookApi.md +372 -0
  29. data/docs/WebhookCreatePayload.md +34 -0
  30. data/docs/WebhookUpdatePayload.md +36 -0
  31. data/lib/ElasticEmail/api/campaigns_api.rb +6 -6
  32. data/lib/ElasticEmail/api/contacts_api.rb +8 -8
  33. data/lib/ElasticEmail/api/domains_api.rb +9 -9
  34. data/lib/ElasticEmail/api/emails_api.rb +7 -7
  35. data/lib/ElasticEmail/api/events_api.rb +9 -9
  36. data/lib/ElasticEmail/api/files_api.rb +6 -6
  37. data/lib/ElasticEmail/api/inbound_route_api.rb +7 -7
  38. data/lib/ElasticEmail/api/lists_api.rb +8 -8
  39. data/lib/ElasticEmail/api/security_api.rb +30 -30
  40. data/lib/ElasticEmail/api/segments_api.rb +6 -6
  41. data/lib/ElasticEmail/api/statistics_api.rb +7 -7
  42. data/lib/ElasticEmail/api/sub_accounts_api.rb +6 -6
  43. data/lib/ElasticEmail/api/suppressions_api.rb +10 -10
  44. data/lib/ElasticEmail/api/templates_api.rb +6 -6
  45. data/lib/ElasticEmail/api/verifications_api.rb +19 -19
  46. data/lib/ElasticEmail/api/webhook_api.rb +351 -0
  47. data/lib/ElasticEmail/api_client.rb +4 -4
  48. data/lib/ElasticEmail/api_error.rb +2 -2
  49. data/lib/ElasticEmail/configuration.rb +20 -3
  50. data/lib/ElasticEmail/models/access_level.rb +12 -3
  51. data/lib/ElasticEmail/models/account_status_enum.rb +2 -2
  52. data/lib/ElasticEmail/models/api_key.rb +2 -2
  53. data/lib/ElasticEmail/models/api_key_payload.rb +2 -2
  54. data/lib/ElasticEmail/models/body_content_type.rb +2 -2
  55. data/lib/ElasticEmail/models/body_part.rb +2 -2
  56. data/lib/ElasticEmail/models/campaign.rb +12 -3
  57. data/lib/ElasticEmail/models/campaign_options.rb +17 -6
  58. data/lib/ElasticEmail/models/campaign_recipient.rb +2 -2
  59. data/lib/ElasticEmail/models/campaign_status.rb +2 -2
  60. data/lib/ElasticEmail/models/campaign_template.rb +3 -3
  61. data/lib/ElasticEmail/models/certificate_validation_status.rb +2 -2
  62. data/lib/ElasticEmail/models/channel_log_status_summary.rb +2 -2
  63. data/lib/ElasticEmail/models/compression_format.rb +2 -2
  64. data/lib/ElasticEmail/models/consent_data.rb +2 -2
  65. data/lib/ElasticEmail/models/consent_tracking.rb +2 -2
  66. data/lib/ElasticEmail/models/contact.rb +12 -3
  67. data/lib/ElasticEmail/models/contact_activity.rb +2 -2
  68. data/lib/ElasticEmail/models/contact_payload.rb +2 -2
  69. data/lib/ElasticEmail/models/contact_source.rb +5 -3
  70. data/lib/ElasticEmail/models/contact_status.rb +2 -2
  71. data/lib/ElasticEmail/models/contact_update_payload.rb +2 -2
  72. data/lib/ElasticEmail/models/contacts_list.rb +2 -2
  73. data/lib/ElasticEmail/models/delivery_optimization_type.rb +2 -2
  74. data/lib/ElasticEmail/models/domain_data.rb +2 -2
  75. data/lib/ElasticEmail/models/domain_detail.rb +2 -2
  76. data/lib/ElasticEmail/models/domain_owner.rb +2 -2
  77. data/lib/ElasticEmail/models/domain_payload.rb +2 -2
  78. data/lib/ElasticEmail/models/domain_update_payload.rb +2 -2
  79. data/lib/ElasticEmail/models/email_content.rb +3 -3
  80. data/lib/ElasticEmail/models/email_data.rb +2 -2
  81. data/lib/ElasticEmail/models/email_job_failed_status.rb +2 -2
  82. data/lib/ElasticEmail/models/email_job_status.rb +2 -2
  83. data/lib/ElasticEmail/models/email_message_data.rb +2 -2
  84. data/lib/ElasticEmail/models/email_predicted_validation_status.rb +2 -2
  85. data/lib/ElasticEmail/models/email_recipient.rb +2 -2
  86. data/lib/ElasticEmail/models/email_send.rb +2 -2
  87. data/lib/ElasticEmail/models/email_status.rb +2 -2
  88. data/lib/ElasticEmail/models/email_transactional_message_data.rb +2 -2
  89. data/lib/ElasticEmail/models/email_validation_result.rb +2 -2
  90. data/lib/ElasticEmail/models/email_validation_status.rb +2 -2
  91. data/lib/ElasticEmail/models/email_view.rb +2 -2
  92. data/lib/ElasticEmail/models/emails_payload.rb +2 -2
  93. data/lib/ElasticEmail/models/encoding_type.rb +2 -2
  94. data/lib/ElasticEmail/models/event_type.rb +2 -2
  95. data/lib/ElasticEmail/models/events_order_by.rb +2 -2
  96. data/lib/ElasticEmail/models/export_file_formats.rb +2 -2
  97. data/lib/ElasticEmail/models/export_link.rb +2 -2
  98. data/lib/ElasticEmail/models/export_status.rb +2 -2
  99. data/lib/ElasticEmail/models/file_info.rb +2 -2
  100. data/lib/ElasticEmail/models/file_payload.rb +2 -2
  101. data/lib/ElasticEmail/models/file_upload_result.rb +2 -2
  102. data/lib/ElasticEmail/models/inbound_payload.rb +2 -2
  103. data/lib/ElasticEmail/models/inbound_route.rb +2 -2
  104. data/lib/ElasticEmail/models/inbound_route_action_type.rb +2 -2
  105. data/lib/ElasticEmail/models/inbound_route_filter_type.rb +2 -2
  106. data/lib/ElasticEmail/models/list_payload.rb +2 -2
  107. data/lib/ElasticEmail/models/list_update_payload.rb +2 -2
  108. data/lib/ElasticEmail/models/log_job_status.rb +2 -2
  109. data/lib/ElasticEmail/models/log_status_summary.rb +2 -2
  110. data/lib/ElasticEmail/models/merge_email_payload.rb +2 -2
  111. data/lib/ElasticEmail/models/message_attachment.rb +3 -3
  112. data/lib/ElasticEmail/models/message_category.rb +2 -2
  113. data/lib/ElasticEmail/models/message_category_enum.rb +2 -2
  114. data/lib/ElasticEmail/models/new_api_key.rb +2 -2
  115. data/lib/ElasticEmail/models/new_smtp_credentials.rb +2 -2
  116. data/lib/ElasticEmail/models/options.rb +2 -2
  117. data/lib/ElasticEmail/models/recipient_event.rb +3 -3
  118. data/lib/ElasticEmail/models/segment.rb +2 -2
  119. data/lib/ElasticEmail/models/segment_payload.rb +2 -2
  120. data/lib/ElasticEmail/models/smtp_credentials.rb +2 -2
  121. data/lib/ElasticEmail/models/smtp_credentials_payload.rb +2 -2
  122. data/lib/ElasticEmail/models/sort_order_item.rb +2 -2
  123. data/lib/ElasticEmail/models/split_optimization_type.rb +2 -2
  124. data/lib/ElasticEmail/models/split_options.rb +2 -2
  125. data/lib/ElasticEmail/models/sub_account_info.rb +2 -2
  126. data/lib/ElasticEmail/models/subaccount_email_credits_payload.rb +2 -2
  127. data/lib/ElasticEmail/models/subaccount_email_settings.rb +2 -2
  128. data/lib/ElasticEmail/models/subaccount_email_settings_payload.rb +2 -2
  129. data/lib/ElasticEmail/models/subaccount_payload.rb +2 -2
  130. data/lib/ElasticEmail/models/subaccount_settings_info.rb +2 -2
  131. data/lib/ElasticEmail/models/subaccount_settings_info_payload.rb +2 -2
  132. data/lib/ElasticEmail/models/suppression.rb +2 -2
  133. data/lib/ElasticEmail/models/template.rb +2 -2
  134. data/lib/ElasticEmail/models/template_payload.rb +2 -2
  135. data/lib/ElasticEmail/models/template_scope.rb +2 -2
  136. data/lib/ElasticEmail/models/template_type.rb +10 -3
  137. data/lib/ElasticEmail/models/tracking_type.rb +2 -2
  138. data/lib/ElasticEmail/models/tracking_validation_status.rb +2 -2
  139. data/lib/ElasticEmail/models/transactional_recipient.rb +2 -2
  140. data/lib/ElasticEmail/models/utm.rb +2 -2
  141. data/lib/ElasticEmail/models/verification_file_result.rb +2 -2
  142. data/lib/ElasticEmail/models/verification_file_result_details.rb +2 -2
  143. data/lib/ElasticEmail/models/verification_status.rb +2 -2
  144. data/lib/ElasticEmail/models/webhook.rb +330 -0
  145. data/lib/ElasticEmail/models/webhook_create_payload.rb +303 -0
  146. data/lib/ElasticEmail/models/webhook_update_payload.rb +306 -0
  147. data/lib/ElasticEmail/version.rb +3 -3
  148. data/lib/ElasticEmail.rb +6 -2
  149. data/spec/api/campaigns_api_spec.rb +2 -2
  150. data/spec/api/contacts_api_spec.rb +2 -2
  151. data/spec/api/domains_api_spec.rb +2 -2
  152. data/spec/api/emails_api_spec.rb +2 -2
  153. data/spec/api/events_api_spec.rb +2 -2
  154. data/spec/api/files_api_spec.rb +2 -2
  155. data/spec/api/inbound_route_api_spec.rb +2 -2
  156. data/spec/api/lists_api_spec.rb +2 -2
  157. data/spec/api/security_api_spec.rb +12 -12
  158. data/spec/api/segments_api_spec.rb +2 -2
  159. data/spec/api/statistics_api_spec.rb +2 -2
  160. data/spec/api/sub_accounts_api_spec.rb +2 -2
  161. data/spec/api/suppressions_api_spec.rb +2 -2
  162. data/spec/api/templates_api_spec.rb +2 -2
  163. data/spec/api/verifications_api_spec.rb +7 -7
  164. data/spec/api/webhook_api_spec.rb +97 -0
  165. data/spec/models/access_level_spec.rb +2 -2
  166. data/spec/models/account_status_enum_spec.rb +2 -2
  167. data/spec/models/api_key_payload_spec.rb +2 -2
  168. data/spec/models/api_key_spec.rb +2 -2
  169. data/spec/models/body_content_type_spec.rb +2 -2
  170. data/spec/models/body_part_spec.rb +2 -2
  171. data/spec/models/campaign_options_spec.rb +8 -2
  172. data/spec/models/campaign_recipient_spec.rb +2 -2
  173. data/spec/models/campaign_spec.rb +8 -2
  174. data/spec/models/campaign_status_spec.rb +2 -2
  175. data/spec/models/campaign_template_spec.rb +2 -2
  176. data/spec/models/certificate_validation_status_spec.rb +2 -2
  177. data/spec/models/channel_log_status_summary_spec.rb +2 -2
  178. data/spec/models/compression_format_spec.rb +2 -2
  179. data/spec/models/consent_data_spec.rb +2 -2
  180. data/spec/models/consent_tracking_spec.rb +2 -2
  181. data/spec/models/contact_activity_spec.rb +2 -2
  182. data/spec/models/contact_payload_spec.rb +2 -2
  183. data/spec/models/contact_source_spec.rb +2 -2
  184. data/spec/models/contact_spec.rb +8 -2
  185. data/spec/models/contact_status_spec.rb +2 -2
  186. data/spec/models/contact_update_payload_spec.rb +2 -2
  187. data/spec/models/contacts_list_spec.rb +2 -2
  188. data/spec/models/delivery_optimization_type_spec.rb +2 -2
  189. data/spec/models/domain_data_spec.rb +2 -2
  190. data/spec/models/domain_detail_spec.rb +2 -2
  191. data/spec/models/domain_owner_spec.rb +2 -2
  192. data/spec/models/domain_payload_spec.rb +2 -2
  193. data/spec/models/domain_update_payload_spec.rb +2 -2
  194. data/spec/models/email_content_spec.rb +2 -2
  195. data/spec/models/email_data_spec.rb +2 -2
  196. data/spec/models/email_job_failed_status_spec.rb +2 -2
  197. data/spec/models/email_job_status_spec.rb +2 -2
  198. data/spec/models/email_message_data_spec.rb +2 -2
  199. data/spec/models/email_predicted_validation_status_spec.rb +2 -2
  200. data/spec/models/email_recipient_spec.rb +2 -2
  201. data/spec/models/email_send_spec.rb +2 -2
  202. data/spec/models/email_status_spec.rb +2 -2
  203. data/spec/models/email_transactional_message_data_spec.rb +2 -2
  204. data/spec/models/email_validation_result_spec.rb +2 -2
  205. data/spec/models/email_validation_status_spec.rb +2 -2
  206. data/spec/models/email_view_spec.rb +2 -2
  207. data/spec/models/emails_payload_spec.rb +2 -2
  208. data/spec/models/encoding_type_spec.rb +2 -2
  209. data/spec/models/event_type_spec.rb +2 -2
  210. data/spec/models/events_order_by_spec.rb +2 -2
  211. data/spec/models/export_file_formats_spec.rb +2 -2
  212. data/spec/models/export_link_spec.rb +2 -2
  213. data/spec/models/export_status_spec.rb +2 -2
  214. data/spec/models/file_info_spec.rb +2 -2
  215. data/spec/models/file_payload_spec.rb +2 -2
  216. data/spec/models/file_upload_result_spec.rb +2 -2
  217. data/spec/models/inbound_payload_spec.rb +2 -2
  218. data/spec/models/inbound_route_action_type_spec.rb +2 -2
  219. data/spec/models/inbound_route_filter_type_spec.rb +2 -2
  220. data/spec/models/inbound_route_spec.rb +2 -2
  221. data/spec/models/list_payload_spec.rb +2 -2
  222. data/spec/models/list_update_payload_spec.rb +2 -2
  223. data/spec/models/log_job_status_spec.rb +2 -2
  224. data/spec/models/log_status_summary_spec.rb +2 -2
  225. data/spec/models/merge_email_payload_spec.rb +2 -2
  226. data/spec/models/message_attachment_spec.rb +2 -2
  227. data/spec/models/message_category_enum_spec.rb +2 -2
  228. data/spec/models/message_category_spec.rb +2 -2
  229. data/spec/models/new_api_key_spec.rb +2 -2
  230. data/spec/models/new_smtp_credentials_spec.rb +2 -2
  231. data/spec/models/options_spec.rb +2 -2
  232. data/spec/models/recipient_event_spec.rb +2 -2
  233. data/spec/models/segment_payload_spec.rb +2 -2
  234. data/spec/models/segment_spec.rb +2 -2
  235. data/spec/models/smtp_credentials_payload_spec.rb +2 -2
  236. data/spec/models/smtp_credentials_spec.rb +2 -2
  237. data/spec/models/sort_order_item_spec.rb +2 -2
  238. data/spec/models/split_optimization_type_spec.rb +2 -2
  239. data/spec/models/split_options_spec.rb +2 -2
  240. data/spec/models/sub_account_info_spec.rb +2 -2
  241. data/spec/models/subaccount_email_credits_payload_spec.rb +2 -2
  242. data/spec/models/subaccount_email_settings_payload_spec.rb +2 -2
  243. data/spec/models/subaccount_email_settings_spec.rb +2 -2
  244. data/spec/models/subaccount_payload_spec.rb +2 -2
  245. data/spec/models/subaccount_settings_info_payload_spec.rb +2 -2
  246. data/spec/models/subaccount_settings_info_spec.rb +2 -2
  247. data/spec/models/suppression_spec.rb +2 -2
  248. data/spec/models/template_payload_spec.rb +2 -2
  249. data/spec/models/template_scope_spec.rb +2 -2
  250. data/spec/models/template_spec.rb +2 -2
  251. data/spec/models/template_type_spec.rb +2 -2
  252. data/spec/models/tracking_type_spec.rb +2 -2
  253. data/spec/models/tracking_validation_status_spec.rb +2 -2
  254. data/spec/models/transactional_recipient_spec.rb +2 -2
  255. data/spec/models/utm_spec.rb +2 -2
  256. data/spec/models/verification_file_result_details_spec.rb +2 -2
  257. data/spec/models/verification_file_result_spec.rb +2 -2
  258. data/spec/models/verification_status_spec.rb +2 -2
  259. data/spec/models/webhook_create_payload_spec.rb +84 -0
  260. data/spec/models/webhook_spec.rb +108 -0
  261. data/spec/models/webhook_update_payload_spec.rb +90 -0
  262. data/spec/spec_helper.rb +2 -2
  263. metadata +110 -94
@@ -0,0 +1,303 @@
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target='_blank' href='https://app.elasticemail.com/marketing/settings/new/manage-api'>here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target='_blank' href='https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme'>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
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ElasticEmail
17
+ # Create webhook payload
18
+ class WebhookCreatePayload
19
+ # Filename
20
+ attr_accessor :name
21
+
22
+ # URL of notification.
23
+ attr_accessor :url
24
+
25
+ attr_accessor :notify_once_per_email
26
+
27
+ attr_accessor :notification_for_sent
28
+
29
+ attr_accessor :notification_for_opened
30
+
31
+ attr_accessor :notification_for_clicked
32
+
33
+ attr_accessor :notification_for_unsubscribed
34
+
35
+ attr_accessor :notification_for_abuse_report
36
+
37
+ attr_accessor :notification_for_error
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'name' => :'Name',
43
+ :'url' => :'URL',
44
+ :'notify_once_per_email' => :'NotifyOncePerEmail',
45
+ :'notification_for_sent' => :'NotificationForSent',
46
+ :'notification_for_opened' => :'NotificationForOpened',
47
+ :'notification_for_clicked' => :'NotificationForClicked',
48
+ :'notification_for_unsubscribed' => :'NotificationForUnsubscribed',
49
+ :'notification_for_abuse_report' => :'NotificationForAbuseReport',
50
+ :'notification_for_error' => :'NotificationForError'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'name' => :'String',
63
+ :'url' => :'String',
64
+ :'notify_once_per_email' => :'Boolean',
65
+ :'notification_for_sent' => :'Boolean',
66
+ :'notification_for_opened' => :'Boolean',
67
+ :'notification_for_clicked' => :'Boolean',
68
+ :'notification_for_unsubscribed' => :'Boolean',
69
+ :'notification_for_abuse_report' => :'Boolean',
70
+ :'notification_for_error' => :'Boolean'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ElasticEmail::WebhookCreatePayload` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ElasticEmail::WebhookCreatePayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'name')
96
+ self.name = attributes[:'name']
97
+ else
98
+ self.name = nil
99
+ end
100
+
101
+ if attributes.key?(:'url')
102
+ self.url = attributes[:'url']
103
+ else
104
+ self.url = nil
105
+ end
106
+
107
+ if attributes.key?(:'notify_once_per_email')
108
+ self.notify_once_per_email = attributes[:'notify_once_per_email']
109
+ end
110
+
111
+ if attributes.key?(:'notification_for_sent')
112
+ self.notification_for_sent = attributes[:'notification_for_sent']
113
+ end
114
+
115
+ if attributes.key?(:'notification_for_opened')
116
+ self.notification_for_opened = attributes[:'notification_for_opened']
117
+ end
118
+
119
+ if attributes.key?(:'notification_for_clicked')
120
+ self.notification_for_clicked = attributes[:'notification_for_clicked']
121
+ end
122
+
123
+ if attributes.key?(:'notification_for_unsubscribed')
124
+ self.notification_for_unsubscribed = attributes[:'notification_for_unsubscribed']
125
+ end
126
+
127
+ if attributes.key?(:'notification_for_abuse_report')
128
+ self.notification_for_abuse_report = attributes[:'notification_for_abuse_report']
129
+ end
130
+
131
+ if attributes.key?(:'notification_for_error')
132
+ self.notification_for_error = attributes[:'notification_for_error']
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
140
+ invalid_properties = Array.new
141
+ if @name.nil?
142
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
143
+ end
144
+
145
+ if @url.nil?
146
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ warn '[DEPRECATED] the `valid?` method is obsolete'
156
+ return false if @name.nil?
157
+ return false if @url.nil?
158
+ true
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ name == o.name &&
167
+ url == o.url &&
168
+ notify_once_per_email == o.notify_once_per_email &&
169
+ notification_for_sent == o.notification_for_sent &&
170
+ notification_for_opened == o.notification_for_opened &&
171
+ notification_for_clicked == o.notification_for_clicked &&
172
+ notification_for_unsubscribed == o.notification_for_unsubscribed &&
173
+ notification_for_abuse_report == o.notification_for_abuse_report &&
174
+ notification_for_error == o.notification_for_error
175
+ end
176
+
177
+ # @see the `==` method
178
+ # @param [Object] Object to be compared
179
+ def eql?(o)
180
+ self == o
181
+ end
182
+
183
+ # Calculates hash code according to all attributes.
184
+ # @return [Integer] Hash code
185
+ def hash
186
+ [name, url, notify_once_per_email, notification_for_sent, notification_for_opened, notification_for_clicked, notification_for_unsubscribed, notification_for_abuse_report, notification_for_error].hash
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def self.build_from_hash(attributes)
193
+ return nil unless attributes.is_a?(Hash)
194
+ attributes = attributes.transform_keys(&:to_sym)
195
+ transformed_hash = {}
196
+ openapi_types.each_pair do |key, type|
197
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = nil
199
+ elsif type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[attribute_map[key]].is_a?(Array)
203
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
204
+ end
205
+ elsif !attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
207
+ end
208
+ end
209
+ new(transformed_hash)
210
+ end
211
+
212
+ # Deserializes the data based on type
213
+ # @param string type Data type
214
+ # @param string value Value to be deserialized
215
+ # @return [Object] Deserialized data
216
+ def self._deserialize(type, value)
217
+ case type.to_sym
218
+ when :Time
219
+ Time.parse(value)
220
+ when :Date
221
+ Date.parse(value)
222
+ when :String
223
+ value.to_s
224
+ when :Integer
225
+ value.to_i
226
+ when :Float
227
+ value.to_f
228
+ when :Boolean
229
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
+ true
231
+ else
232
+ false
233
+ end
234
+ when :Object
235
+ # generic object (usually a Hash), return directly
236
+ value
237
+ when /\AArray<(?<inner_type>.+)>\z/
238
+ inner_type = Regexp.last_match[:inner_type]
239
+ value.map { |v| _deserialize(inner_type, v) }
240
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
+ k_type = Regexp.last_match[:k_type]
242
+ v_type = Regexp.last_match[:v_type]
243
+ {}.tap do |hash|
244
+ value.each do |k, v|
245
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
+ end
247
+ end
248
+ else # model
249
+ # models (e.g. Pet) or oneOf
250
+ klass = ElasticEmail.const_get(type)
251
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
252
+ end
253
+ end
254
+
255
+ # Returns the string representation of the object
256
+ # @return [String] String presentation of the object
257
+ def to_s
258
+ to_hash.to_s
259
+ end
260
+
261
+ # to_body is an alias to to_hash (backward compatibility)
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_body
264
+ to_hash
265
+ end
266
+
267
+ # Returns the object in the form of hash
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_hash
270
+ hash = {}
271
+ self.class.attribute_map.each_pair do |attr, param|
272
+ value = self.send(attr)
273
+ if value.nil?
274
+ is_nullable = self.class.openapi_nullable.include?(attr)
275
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
276
+ end
277
+
278
+ hash[param] = _to_hash(value)
279
+ end
280
+ hash
281
+ end
282
+
283
+ # Outputs non-array value in the form of hash
284
+ # For object, use to_hash. Otherwise, just return the value
285
+ # @param [Object] value Any valid value
286
+ # @return [Hash] Returns the value in the form of hash
287
+ def _to_hash(value)
288
+ if value.is_a?(Array)
289
+ value.compact.map { |v| _to_hash(v) }
290
+ elsif value.is_a?(Hash)
291
+ {}.tap do |hash|
292
+ value.each { |k, v| hash[k] = _to_hash(v) }
293
+ end
294
+ elsif value.respond_to? :to_hash
295
+ value.to_hash
296
+ else
297
+ value
298
+ end
299
+ end
300
+
301
+ end
302
+
303
+ end
@@ -0,0 +1,306 @@
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target='_blank' href='https://app.elasticemail.com/marketing/settings/new/manage-api'>here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target='_blank' href='https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme'>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
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ElasticEmail
17
+ # Update webhook payload
18
+ class WebhookUpdatePayload
19
+ # Filename
20
+ attr_accessor :name
21
+
22
+ # URL of notification.
23
+ attr_accessor :url
24
+
25
+ attr_accessor :notify_once_per_email
26
+
27
+ attr_accessor :notification_for_sent
28
+
29
+ attr_accessor :notification_for_opened
30
+
31
+ attr_accessor :notification_for_clicked
32
+
33
+ attr_accessor :notification_for_unsubscribed
34
+
35
+ attr_accessor :notification_for_abuse_report
36
+
37
+ attr_accessor :notification_for_error
38
+
39
+ attr_accessor :is_enabled
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'name' => :'Name',
45
+ :'url' => :'URL',
46
+ :'notify_once_per_email' => :'NotifyOncePerEmail',
47
+ :'notification_for_sent' => :'NotificationForSent',
48
+ :'notification_for_opened' => :'NotificationForOpened',
49
+ :'notification_for_clicked' => :'NotificationForClicked',
50
+ :'notification_for_unsubscribed' => :'NotificationForUnsubscribed',
51
+ :'notification_for_abuse_report' => :'NotificationForAbuseReport',
52
+ :'notification_for_error' => :'NotificationForError',
53
+ :'is_enabled' => :'IsEnabled'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'name' => :'String',
66
+ :'url' => :'String',
67
+ :'notify_once_per_email' => :'Boolean',
68
+ :'notification_for_sent' => :'Boolean',
69
+ :'notification_for_opened' => :'Boolean',
70
+ :'notification_for_clicked' => :'Boolean',
71
+ :'notification_for_unsubscribed' => :'Boolean',
72
+ :'notification_for_abuse_report' => :'Boolean',
73
+ :'notification_for_error' => :'Boolean',
74
+ :'is_enabled' => :'Boolean'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ :'notify_once_per_email',
82
+ :'notification_for_sent',
83
+ :'notification_for_opened',
84
+ :'notification_for_clicked',
85
+ :'notification_for_unsubscribed',
86
+ :'notification_for_abuse_report',
87
+ :'notification_for_error',
88
+ :'is_enabled'
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ElasticEmail::WebhookUpdatePayload` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ElasticEmail::WebhookUpdatePayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'name')
108
+ self.name = attributes[:'name']
109
+ end
110
+
111
+ if attributes.key?(:'url')
112
+ self.url = attributes[:'url']
113
+ end
114
+
115
+ if attributes.key?(:'notify_once_per_email')
116
+ self.notify_once_per_email = attributes[:'notify_once_per_email']
117
+ end
118
+
119
+ if attributes.key?(:'notification_for_sent')
120
+ self.notification_for_sent = attributes[:'notification_for_sent']
121
+ end
122
+
123
+ if attributes.key?(:'notification_for_opened')
124
+ self.notification_for_opened = attributes[:'notification_for_opened']
125
+ end
126
+
127
+ if attributes.key?(:'notification_for_clicked')
128
+ self.notification_for_clicked = attributes[:'notification_for_clicked']
129
+ end
130
+
131
+ if attributes.key?(:'notification_for_unsubscribed')
132
+ self.notification_for_unsubscribed = attributes[:'notification_for_unsubscribed']
133
+ end
134
+
135
+ if attributes.key?(:'notification_for_abuse_report')
136
+ self.notification_for_abuse_report = attributes[:'notification_for_abuse_report']
137
+ end
138
+
139
+ if attributes.key?(:'notification_for_error')
140
+ self.notification_for_error = attributes[:'notification_for_error']
141
+ end
142
+
143
+ if attributes.key?(:'is_enabled')
144
+ self.is_enabled = attributes[:'is_enabled']
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
152
+ invalid_properties = Array.new
153
+ invalid_properties
154
+ end
155
+
156
+ # Check to see if the all the properties in the model are valid
157
+ # @return true if the model is valid
158
+ def valid?
159
+ warn '[DEPRECATED] the `valid?` method is obsolete'
160
+ true
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ name == o.name &&
169
+ url == o.url &&
170
+ notify_once_per_email == o.notify_once_per_email &&
171
+ notification_for_sent == o.notification_for_sent &&
172
+ notification_for_opened == o.notification_for_opened &&
173
+ notification_for_clicked == o.notification_for_clicked &&
174
+ notification_for_unsubscribed == o.notification_for_unsubscribed &&
175
+ notification_for_abuse_report == o.notification_for_abuse_report &&
176
+ notification_for_error == o.notification_for_error &&
177
+ is_enabled == o.is_enabled
178
+ end
179
+
180
+ # @see the `==` method
181
+ # @param [Object] Object to be compared
182
+ def eql?(o)
183
+ self == o
184
+ end
185
+
186
+ # Calculates hash code according to all attributes.
187
+ # @return [Integer] Hash code
188
+ def hash
189
+ [name, url, notify_once_per_email, notification_for_sent, notification_for_opened, notification_for_clicked, notification_for_unsubscribed, notification_for_abuse_report, notification_for_error, is_enabled].hash
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def self.build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ attributes = attributes.transform_keys(&:to_sym)
198
+ transformed_hash = {}
199
+ openapi_types.each_pair do |key, type|
200
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = nil
202
+ elsif type =~ /\AArray<(.*)>/i
203
+ # check to ensure the input is an array given that the attribute
204
+ # is documented as an array but the input is not
205
+ if attributes[attribute_map[key]].is_a?(Array)
206
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
207
+ end
208
+ elsif !attributes[attribute_map[key]].nil?
209
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
210
+ end
211
+ end
212
+ new(transformed_hash)
213
+ end
214
+
215
+ # Deserializes the data based on type
216
+ # @param string type Data type
217
+ # @param string value Value to be deserialized
218
+ # @return [Object] Deserialized data
219
+ def self._deserialize(type, value)
220
+ case type.to_sym
221
+ when :Time
222
+ Time.parse(value)
223
+ when :Date
224
+ Date.parse(value)
225
+ when :String
226
+ value.to_s
227
+ when :Integer
228
+ value.to_i
229
+ when :Float
230
+ value.to_f
231
+ when :Boolean
232
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
233
+ true
234
+ else
235
+ false
236
+ end
237
+ when :Object
238
+ # generic object (usually a Hash), return directly
239
+ value
240
+ when /\AArray<(?<inner_type>.+)>\z/
241
+ inner_type = Regexp.last_match[:inner_type]
242
+ value.map { |v| _deserialize(inner_type, v) }
243
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
244
+ k_type = Regexp.last_match[:k_type]
245
+ v_type = Regexp.last_match[:v_type]
246
+ {}.tap do |hash|
247
+ value.each do |k, v|
248
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
249
+ end
250
+ end
251
+ else # model
252
+ # models (e.g. Pet) or oneOf
253
+ klass = ElasticEmail.const_get(type)
254
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
255
+ end
256
+ end
257
+
258
+ # Returns the string representation of the object
259
+ # @return [String] String presentation of the object
260
+ def to_s
261
+ to_hash.to_s
262
+ end
263
+
264
+ # to_body is an alias to to_hash (backward compatibility)
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_body
267
+ to_hash
268
+ end
269
+
270
+ # Returns the object in the form of hash
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_hash
273
+ hash = {}
274
+ self.class.attribute_map.each_pair do |attr, param|
275
+ value = self.send(attr)
276
+ if value.nil?
277
+ is_nullable = self.class.openapi_nullable.include?(attr)
278
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
279
+ end
280
+
281
+ hash[param] = _to_hash(value)
282
+ end
283
+ hash
284
+ end
285
+
286
+ # Outputs non-array value in the form of hash
287
+ # For object, use to_hash. Otherwise, just return the value
288
+ # @param [Object] value Any valid value
289
+ # @return [Hash] Returns the value in the form of hash
290
+ def _to_hash(value)
291
+ if value.is_a?(Array)
292
+ value.compact.map { |v| _to_hash(v) }
293
+ elsif value.is_a?(Hash)
294
+ {}.tap do |hash|
295
+ value.each { |k, v| hash[k] = _to_hash(v) }
296
+ end
297
+ elsif value.respond_to? :to_hash
298
+ value.to_hash
299
+ else
300
+ value
301
+ end
302
+ end
303
+
304
+ end
305
+
306
+ end
@@ -1,15 +1,15 @@
1
1
  =begin
2
2
  #Elastic Email REST API
3
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target=\"_blank\" href=\"https://app.elasticemail.com/marketing/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target=\"_blank\" href=\"https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme\">here</a>
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target='_blank' href='https://app.elasticemail.com/marketing/settings/new/manage-api'>here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target='_blank' href='https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme'>here</a>
5
5
 
6
6
  The version of the OpenAPI document: 4.0.0
7
7
  Contact: support@elasticemail.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
13
13
  module ElasticEmail
14
- VERSION = '4.0.26'
14
+ VERSION = '4.0.28'
15
15
  end
data/lib/ElasticEmail.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Elastic Email REST API
3
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target=\"_blank\" href=\"https://app.elasticemail.com/marketing/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target=\"_blank\" href=\"https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme\">here</a>
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target='_blank' href='https://app.elasticemail.com/marketing/settings/new/manage-api'>here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target='_blank' href='https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme'>here</a>
5
5
 
6
6
  The version of the OpenAPI document: 4.0.0
7
7
  Contact: support@elasticemail.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -111,6 +111,9 @@ require 'ElasticEmail/models/utm'
111
111
  require 'ElasticEmail/models/verification_file_result'
112
112
  require 'ElasticEmail/models/verification_file_result_details'
113
113
  require 'ElasticEmail/models/verification_status'
114
+ require 'ElasticEmail/models/webhook'
115
+ require 'ElasticEmail/models/webhook_create_payload'
116
+ require 'ElasticEmail/models/webhook_update_payload'
114
117
 
115
118
  # APIs
116
119
  require 'ElasticEmail/api/campaigns_api'
@@ -128,6 +131,7 @@ require 'ElasticEmail/api/sub_accounts_api'
128
131
  require 'ElasticEmail/api/suppressions_api'
129
132
  require 'ElasticEmail/api/templates_api'
130
133
  require 'ElasticEmail/api/verifications_api'
134
+ require 'ElasticEmail/api/webhook_api'
131
135
 
132
136
  module ElasticEmail
133
137
  class << self
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Elastic Email REST API
3
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target=\"_blank\" href=\"https://app.elasticemail.com/marketing/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target=\"_blank\" href=\"https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme\">here</a>
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. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target='_blank' href='https://app.elasticemail.com/marketing/settings/new/manage-api'>here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target='_blank' href='https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme'>here</a>
5
5
 
6
6
  The version of the OpenAPI document: 4.0.0
7
7
  Contact: support@elasticemail.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12