ElasticEmail 4.0.23 → 4.0.25

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 (261) hide show
  1. checksums.yaml +4 -4
  2. data/ElasticEmail.gemspec +2 -1
  3. data/README.md +28 -4
  4. data/VERSION +1 -1
  5. data/docs/CampaignOptions.md +4 -0
  6. data/docs/CampaignTemplate.md +2 -2
  7. data/docs/CampaignsApi.md +71 -0
  8. data/docs/CertificateValidationStatus.md +15 -0
  9. data/docs/DomainData.md +54 -0
  10. data/docs/DomainDetail.md +52 -0
  11. data/docs/{TemplateScopeType.md → DomainOwner.md} +2 -2
  12. data/docs/DomainPayload.md +20 -0
  13. data/docs/DomainUpdatePayload.md +24 -0
  14. data/docs/DomainsApi.md +583 -0
  15. data/docs/EmailContent.md +2 -2
  16. data/docs/EmailJobFailedStatus.md +24 -0
  17. data/docs/EmailJobStatus.md +56 -0
  18. data/docs/EmailMessageData.md +1 -1
  19. data/docs/EmailStatus.md +3 -1
  20. data/docs/EmailTransactionalMessageData.md +1 -1
  21. data/docs/EmailValidationResult.md +2 -2
  22. data/docs/EmailsApi.md +98 -4
  23. data/docs/EmailsPayload.md +1 -1
  24. data/docs/ListPayload.md +1 -1
  25. data/docs/ListsApi.md +78 -0
  26. data/docs/MergeEmailPayload.md +1 -1
  27. data/docs/{ContactHistEventType.md → MessageCategoryEnum.md} +2 -2
  28. data/docs/TrackingType.md +15 -0
  29. data/docs/TrackingValidationStatus.md +15 -0
  30. data/lib/ElasticEmail/api/campaigns_api.rb +62 -1
  31. data/lib/ElasticEmail/api/contacts_api.rb +1 -1
  32. data/lib/ElasticEmail/api/domains_api.rb +545 -0
  33. data/lib/ElasticEmail/api/emails_api.rb +96 -3
  34. data/lib/ElasticEmail/api/events_api.rb +1 -1
  35. data/lib/ElasticEmail/api/files_api.rb +1 -1
  36. data/lib/ElasticEmail/api/inbound_route_api.rb +1 -1
  37. data/lib/ElasticEmail/api/lists_api.rb +70 -1
  38. data/lib/ElasticEmail/api/security_api.rb +1 -1
  39. data/lib/ElasticEmail/api/segments_api.rb +1 -1
  40. data/lib/ElasticEmail/api/statistics_api.rb +1 -1
  41. data/lib/ElasticEmail/api/sub_accounts_api.rb +1 -1
  42. data/lib/ElasticEmail/api/suppressions_api.rb +1 -1
  43. data/lib/ElasticEmail/api/templates_api.rb +1 -1
  44. data/lib/ElasticEmail/api/verifications_api.rb +1 -1
  45. data/lib/ElasticEmail/api_client.rb +23 -21
  46. data/lib/ElasticEmail/api_error.rb +1 -1
  47. data/lib/ElasticEmail/configuration.rb +18 -10
  48. data/lib/ElasticEmail/models/access_level.rb +4 -3
  49. data/lib/ElasticEmail/models/account_status_enum.rb +1 -1
  50. data/lib/ElasticEmail/models/api_key.rb +14 -19
  51. data/lib/ElasticEmail/models/api_key_payload.rb +18 -19
  52. data/lib/ElasticEmail/models/body_content_type.rb +1 -1
  53. data/lib/ElasticEmail/models/body_part.rb +14 -19
  54. data/lib/ElasticEmail/models/campaign.rb +18 -19
  55. data/lib/ElasticEmail/models/campaign_options.rb +35 -20
  56. data/lib/ElasticEmail/models/campaign_recipient.rb +14 -19
  57. data/lib/ElasticEmail/models/campaign_status.rb +1 -1
  58. data/lib/ElasticEmail/models/campaign_template.rb +21 -19
  59. data/lib/ElasticEmail/models/certificate_validation_status.rb +42 -0
  60. data/lib/ElasticEmail/models/channel_log_status_summary.rb +14 -19
  61. data/lib/ElasticEmail/models/compression_format.rb +1 -1
  62. data/lib/ElasticEmail/models/consent_data.rb +14 -19
  63. data/lib/ElasticEmail/models/consent_tracking.rb +1 -1
  64. data/lib/ElasticEmail/models/contact.rb +14 -19
  65. data/lib/ElasticEmail/models/contact_activity.rb +14 -19
  66. data/lib/ElasticEmail/models/contact_payload.rb +16 -19
  67. data/lib/ElasticEmail/models/contact_source.rb +1 -1
  68. data/lib/ElasticEmail/models/contact_status.rb +1 -1
  69. data/lib/ElasticEmail/models/contact_update_payload.rb +14 -19
  70. data/lib/ElasticEmail/models/contacts_list.rb +14 -19
  71. data/lib/ElasticEmail/models/delivery_optimization_type.rb +1 -1
  72. data/lib/ElasticEmail/models/domain_data.rb +417 -0
  73. data/lib/ElasticEmail/models/domain_detail.rb +407 -0
  74. data/lib/ElasticEmail/models/domain_owner.rb +40 -0
  75. data/lib/ElasticEmail/models/domain_payload.rb +224 -0
  76. data/lib/ElasticEmail/models/{contact_history.rb → domain_update_payload.rb} +63 -79
  77. data/lib/ElasticEmail/models/email_content.rb +21 -19
  78. data/lib/ElasticEmail/models/email_data.rb +14 -19
  79. data/lib/ElasticEmail/models/email_job_failed_status.rb +242 -0
  80. data/lib/ElasticEmail/models/email_job_status.rb +415 -0
  81. data/lib/ElasticEmail/models/email_message_data.rb +23 -19
  82. data/lib/ElasticEmail/models/email_predicted_validation_status.rb +1 -1
  83. data/lib/ElasticEmail/models/email_recipient.rb +16 -19
  84. data/lib/ElasticEmail/models/email_send.rb +14 -19
  85. data/lib/ElasticEmail/models/email_status.rb +29 -23
  86. data/lib/ElasticEmail/models/email_transactional_message_data.rb +23 -19
  87. data/lib/ElasticEmail/models/email_validation_result.rb +16 -20
  88. data/lib/ElasticEmail/models/email_validation_status.rb +1 -1
  89. data/lib/ElasticEmail/models/email_view.rb +14 -19
  90. data/lib/ElasticEmail/models/emails_payload.rb +14 -19
  91. data/lib/ElasticEmail/models/encoding_type.rb +1 -1
  92. data/lib/ElasticEmail/models/event_type.rb +1 -1
  93. data/lib/ElasticEmail/models/events_order_by.rb +1 -1
  94. data/lib/ElasticEmail/models/export_file_formats.rb +1 -1
  95. data/lib/ElasticEmail/models/export_link.rb +14 -19
  96. data/lib/ElasticEmail/models/export_status.rb +1 -1
  97. data/lib/ElasticEmail/models/file_info.rb +14 -19
  98. data/lib/ElasticEmail/models/file_payload.rb +16 -19
  99. data/lib/ElasticEmail/models/file_upload_result.rb +14 -19
  100. data/lib/ElasticEmail/models/inbound_payload.rb +18 -19
  101. data/lib/ElasticEmail/models/inbound_route.rb +14 -19
  102. data/lib/ElasticEmail/models/inbound_route_action_type.rb +1 -1
  103. data/lib/ElasticEmail/models/inbound_route_filter_type.rb +1 -1
  104. data/lib/ElasticEmail/models/list_payload.rb +16 -19
  105. data/lib/ElasticEmail/models/list_update_payload.rb +14 -19
  106. data/lib/ElasticEmail/models/log_job_status.rb +1 -1
  107. data/lib/ElasticEmail/models/log_status_summary.rb +14 -19
  108. data/lib/ElasticEmail/models/merge_email_payload.rb +23 -19
  109. data/lib/ElasticEmail/models/message_attachment.rb +18 -19
  110. data/lib/ElasticEmail/models/message_category.rb +1 -1
  111. data/lib/ElasticEmail/models/message_category_enum.rb +55 -0
  112. data/lib/ElasticEmail/models/new_api_key.rb +14 -19
  113. data/lib/ElasticEmail/models/new_smtp_credentials.rb +14 -19
  114. data/lib/ElasticEmail/models/options.rb +16 -19
  115. data/lib/ElasticEmail/models/recipient_event.rb +14 -19
  116. data/lib/ElasticEmail/models/segment.rb +14 -19
  117. data/lib/ElasticEmail/models/segment_payload.rb +18 -19
  118. data/lib/ElasticEmail/models/smtp_credentials.rb +14 -19
  119. data/lib/ElasticEmail/models/smtp_credentials_payload.rb +16 -19
  120. data/lib/ElasticEmail/models/sort_order_item.rb +18 -19
  121. data/lib/ElasticEmail/models/split_optimization_type.rb +1 -1
  122. data/lib/ElasticEmail/models/split_options.rb +14 -19
  123. data/lib/ElasticEmail/models/sub_account_info.rb +14 -19
  124. data/lib/ElasticEmail/models/subaccount_email_credits_payload.rb +16 -19
  125. data/lib/ElasticEmail/models/subaccount_email_settings.rb +14 -19
  126. data/lib/ElasticEmail/models/subaccount_email_settings_payload.rb +14 -19
  127. data/lib/ElasticEmail/models/subaccount_payload.rb +18 -19
  128. data/lib/ElasticEmail/models/subaccount_settings_info.rb +14 -19
  129. data/lib/ElasticEmail/models/subaccount_settings_info_payload.rb +14 -19
  130. data/lib/ElasticEmail/models/suppression.rb +14 -19
  131. data/lib/ElasticEmail/models/template.rb +14 -19
  132. data/lib/ElasticEmail/models/template_payload.rb +16 -19
  133. data/lib/ElasticEmail/models/template_scope.rb +1 -1
  134. data/lib/ElasticEmail/models/template_type.rb +4 -2
  135. data/lib/ElasticEmail/models/tracking_type.rb +44 -0
  136. data/lib/ElasticEmail/models/tracking_validation_status.rb +42 -0
  137. data/lib/ElasticEmail/models/transactional_recipient.rb +16 -19
  138. data/lib/ElasticEmail/models/utm.rb +14 -19
  139. data/lib/ElasticEmail/models/verification_file_result.rb +14 -19
  140. data/lib/ElasticEmail/models/verification_file_result_details.rb +14 -19
  141. data/lib/ElasticEmail/models/verification_status.rb +1 -1
  142. data/lib/ElasticEmail/version.rb +2 -2
  143. data/lib/ElasticEmail.rb +13 -1
  144. data/spec/api/campaigns_api_spec.rb +19 -7
  145. data/spec/api/contacts_api_spec.rb +12 -25
  146. data/spec/api/domains_api_spec.rb +132 -0
  147. data/spec/api/emails_api_spec.rb +29 -7
  148. data/spec/api/events_api_spec.rb +9 -9
  149. data/spec/api/files_api_spec.rb +7 -7
  150. data/spec/api/inbound_route_api_spec.rb +8 -8
  151. data/spec/api/lists_api_spec.rb +23 -9
  152. data/spec/api/security_api_spec.rb +12 -12
  153. data/spec/api/segments_api_spec.rb +7 -7
  154. data/spec/api/statistics_api_spec.rb +7 -7
  155. data/spec/api/sub_accounts_api_spec.rb +8 -8
  156. data/spec/api/suppressions_api_spec.rb +26 -26
  157. data/spec/api/templates_api_spec.rb +7 -7
  158. data/spec/api/verifications_api_spec.rb +30 -18
  159. data/spec/models/access_level_spec.rb +5 -3
  160. data/spec/models/account_status_enum_spec.rb +5 -3
  161. data/spec/models/api_key_payload_spec.rb +10 -8
  162. data/spec/models/api_key_spec.rb +11 -9
  163. data/spec/models/body_content_type_spec.rb +5 -3
  164. data/spec/models/body_part_spec.rb +8 -6
  165. data/spec/models/campaign_options_spec.rb +22 -8
  166. data/spec/models/campaign_recipient_spec.rb +7 -5
  167. data/spec/models/campaign_spec.rb +10 -8
  168. data/spec/models/campaign_status_spec.rb +5 -3
  169. data/spec/models/campaign_template_spec.rb +12 -10
  170. data/spec/{configuration_spec.rb → models/certificate_validation_status_spec.rb} +15 -27
  171. data/spec/models/channel_log_status_summary_spec.rb +19 -17
  172. data/spec/models/compression_format_spec.rb +5 -3
  173. data/spec/models/consent_data_spec.rb +8 -6
  174. data/spec/models/consent_tracking_spec.rb +5 -3
  175. data/spec/models/contact_activity_spec.rb +16 -14
  176. data/spec/models/contact_payload_spec.rb +11 -9
  177. data/spec/models/contact_source_spec.rb +5 -3
  178. data/spec/models/contact_spec.rb +16 -14
  179. data/spec/models/contact_status_spec.rb +5 -3
  180. data/spec/models/contact_update_payload_spec.rb +8 -6
  181. data/spec/models/contacts_list_spec.rb +9 -7
  182. data/spec/models/delivery_optimization_type_spec.rb +5 -3
  183. data/spec/models/domain_data_spec.rb +144 -0
  184. data/spec/models/domain_detail_spec.rb +138 -0
  185. data/spec/models/domain_owner_spec.rb +30 -0
  186. data/spec/models/domain_payload_spec.rb +42 -0
  187. data/spec/models/domain_update_payload_spec.rb +54 -0
  188. data/spec/models/email_content_spec.rb +22 -14
  189. data/spec/models/email_data_spec.rb +8 -6
  190. data/spec/models/email_job_failed_status_spec.rb +54 -0
  191. data/spec/models/email_job_status_spec.rb +150 -0
  192. data/spec/models/email_message_data_spec.rb +8 -6
  193. data/spec/models/email_predicted_validation_status_spec.rb +4 -2
  194. data/spec/models/email_recipient_spec.rb +7 -5
  195. data/spec/models/email_send_spec.rb +7 -5
  196. data/spec/models/email_status_spec.rb +23 -15
  197. data/spec/models/email_transactional_message_data_spec.rb +8 -6
  198. data/spec/models/email_validation_result_spec.rb +26 -12
  199. data/spec/models/email_validation_status_spec.rb +5 -3
  200. data/spec/models/email_view_spec.rb +8 -6
  201. data/spec/models/emails_payload_spec.rb +7 -5
  202. data/spec/models/encoding_type_spec.rb +5 -3
  203. data/spec/models/event_type_spec.rb +5 -3
  204. data/spec/models/events_order_by_spec.rb +5 -3
  205. data/spec/models/export_file_formats_spec.rb +5 -3
  206. data/spec/models/export_link_spec.rb +7 -5
  207. data/spec/models/export_status_spec.rb +5 -3
  208. data/spec/models/file_info_spec.rb +10 -8
  209. data/spec/models/file_payload_spec.rb +8 -6
  210. data/spec/models/file_upload_result_spec.rb +7 -5
  211. data/spec/models/inbound_payload_spec.rb +11 -9
  212. data/spec/models/inbound_route_action_type_spec.rb +5 -3
  213. data/spec/models/inbound_route_filter_type_spec.rb +5 -3
  214. data/spec/models/inbound_route_spec.rb +12 -10
  215. data/spec/models/list_payload_spec.rb +8 -6
  216. data/spec/models/list_update_payload_spec.rb +7 -5
  217. data/spec/models/log_job_status_spec.rb +5 -3
  218. data/spec/models/log_status_summary_spec.rb +18 -16
  219. data/spec/models/merge_email_payload_spec.rb +8 -6
  220. data/spec/models/message_attachment_spec.rb +14 -6
  221. data/spec/models/message_category_enum_spec.rb +30 -0
  222. data/spec/models/message_category_spec.rb +5 -3
  223. data/spec/models/new_api_key_spec.rb +12 -10
  224. data/spec/models/new_smtp_credentials_spec.rb +12 -10
  225. data/spec/models/options_spec.rb +11 -9
  226. data/spec/models/recipient_event_spec.rb +18 -16
  227. data/spec/models/segment_payload_spec.rb +7 -5
  228. data/spec/models/segment_spec.rb +7 -5
  229. data/spec/models/smtp_credentials_payload_spec.rb +9 -7
  230. data/spec/models/smtp_credentials_spec.rb +11 -9
  231. data/spec/models/sort_order_item_spec.rb +7 -5
  232. data/spec/models/split_optimization_type_spec.rb +5 -3
  233. data/spec/models/split_options_spec.rb +7 -5
  234. data/spec/models/sub_account_info_spec.rb +14 -12
  235. data/spec/models/subaccount_email_credits_payload_spec.rb +7 -5
  236. data/spec/models/subaccount_email_settings_payload_spec.rb +17 -9
  237. data/spec/models/subaccount_email_settings_spec.rb +18 -10
  238. data/spec/models/subaccount_payload_spec.rb +9 -7
  239. data/spec/models/subaccount_settings_info_payload_spec.rb +6 -4
  240. data/spec/models/subaccount_settings_info_spec.rb +6 -4
  241. data/spec/models/suppression_spec.rb +9 -7
  242. data/spec/models/template_payload_spec.rb +9 -7
  243. data/spec/models/template_scope_spec.rb +5 -3
  244. data/spec/models/template_spec.rb +11 -9
  245. data/spec/models/template_type_spec.rb +5 -3
  246. data/spec/models/tracking_type_spec.rb +30 -0
  247. data/spec/models/tracking_validation_status_spec.rb +30 -0
  248. data/spec/models/transactional_recipient_spec.rb +8 -6
  249. data/spec/models/utm_spec.rb +9 -7
  250. data/spec/models/verification_file_result_details_spec.rb +12 -10
  251. data/spec/models/verification_file_result_spec.rb +11 -9
  252. data/spec/models/verification_status_spec.rb +5 -3
  253. data/spec/spec_helper.rb +1 -1
  254. metadata +126 -94
  255. data/docs/ContactHistory.md +0 -30
  256. data/lib/ElasticEmail/models/contact_hist_event_type.rb +0 -49
  257. data/lib/ElasticEmail/models/template_scope_type.rb +0 -38
  258. data/spec/api_client_spec.rb +0 -226
  259. data/spec/models/contact_hist_event_type_spec.rb +0 -28
  260. data/spec/models/contact_history_spec.rb +0 -70
  261. data/spec/models/template_scope_type_spec.rb +0 -28
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -19,6 +19,75 @@ module ElasticEmail
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Load Contacts in List
23
+ # Returns a list of contacts. Required Access Level: ViewContacts
24
+ # @param listname [String] Name of your list.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Integer] :limit Maximum number of returned items.
27
+ # @option opts [Integer] :offset How many items should be returned ahead.
28
+ # @return [Array<Contact>]
29
+ def lists_by_listname_contacts_get(listname, opts = {})
30
+ data, _status_code, _headers = lists_by_listname_contacts_get_with_http_info(listname, opts)
31
+ data
32
+ end
33
+
34
+ # Load Contacts in List
35
+ # Returns a list of contacts. Required Access Level: ViewContacts
36
+ # @param listname [String] Name of your list.
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Integer] :limit Maximum number of returned items.
39
+ # @option opts [Integer] :offset How many items should be returned ahead.
40
+ # @return [Array<(Array<Contact>, Integer, Hash)>] Array<Contact> data, response status code and response headers
41
+ def lists_by_listname_contacts_get_with_http_info(listname, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: ListsApi.lists_by_listname_contacts_get ...'
44
+ end
45
+ # verify the required parameter 'listname' is set
46
+ if @api_client.config.client_side_validation && listname.nil?
47
+ fail ArgumentError, "Missing the required parameter 'listname' when calling ListsApi.lists_by_listname_contacts_get"
48
+ end
49
+ # resource path
50
+ local_var_path = '/lists/{listname}/contacts'.sub('{' + 'listname' + '}', CGI.escape(listname.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
55
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'Array<Contact>'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || ['apikey']
73
+
74
+ new_options = opts.merge(
75
+ :operation => :"ListsApi.lists_by_listname_contacts_get",
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type
82
+ )
83
+
84
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: ListsApi#lists_by_listname_contacts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
22
91
  # Add Contacts to List
23
92
  # Add existing Contacts to specified list. Required Access Level: ModifyContacts
24
93
  # @param name [String] Name of your list.
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -17,6 +17,7 @@ require 'tempfile'
17
17
  require 'time'
18
18
  require 'typhoeus'
19
19
 
20
+
20
21
  module ElasticEmail
21
22
  class ApiClient
22
23
  # The Configuration object holding settings to be used in the API client.
@@ -45,9 +46,10 @@ module ElasticEmail
45
46
  # Call an API with given options.
46
47
  #
47
48
  # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
48
- # the data deserialized from response body (could be nil), response status code and response headers.
49
+ # the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
49
50
  def call_api(http_method, path, opts = {})
50
51
  request = build_request(http_method, path, opts)
52
+ tempfile = download_file(request) if opts[:return_type] == 'File'
51
53
  response = request.run
52
54
 
53
55
  if @config.debugging
@@ -69,7 +71,9 @@ module ElasticEmail
69
71
  end
70
72
  end
71
73
 
72
- if opts[:return_type]
74
+ if opts[:return_type] == 'File'
75
+ data = tempfile
76
+ elsif opts[:return_type]
73
77
  data = deserialize(response, opts[:return_type])
74
78
  else
75
79
  data = nil
@@ -125,9 +129,7 @@ module ElasticEmail
125
129
  end
126
130
  end
127
131
 
128
- request = Typhoeus::Request.new(url, req_opts)
129
- download_file(request) if opts[:return_type] == 'File'
130
- request
132
+ Typhoeus::Request.new(url, req_opts)
131
133
  end
132
134
 
133
135
  # Builds the HTTP request body
@@ -165,6 +167,8 @@ module ElasticEmail
165
167
  # process can use.
166
168
  #
167
169
  # @see Configuration#temp_folder_path
170
+ #
171
+ # @return [Tempfile] the tempfile generated
168
172
  def download_file(request)
169
173
  tempfile = nil
170
174
  encoding = nil
@@ -179,21 +183,24 @@ module ElasticEmail
179
183
  prefix = prefix + '-' unless prefix.end_with?('-')
180
184
  encoding = response.body.encoding
181
185
  tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
182
- @tempfile = tempfile
183
186
  end
184
187
  request.on_body do |chunk|
185
188
  chunk.force_encoding(encoding)
186
189
  tempfile.write(chunk)
187
190
  end
188
- request.on_complete do |response|
189
- if tempfile
190
- tempfile.close
191
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
192
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
193
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
194
- "explicitly with `tempfile.delete`"
195
- end
191
+ # run the request to ensure the tempfile is created successfully before returning it
192
+ request.run
193
+ if tempfile
194
+ tempfile.close
195
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
196
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
197
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
198
+ "explicitly with `tempfile.delete`"
199
+ else
200
+ fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
196
201
  end
202
+
203
+ tempfile
197
204
  end
198
205
 
199
206
  # Check if the given MIME is a JSON MIME.
@@ -214,15 +221,10 @@ module ElasticEmail
214
221
  # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
215
222
  def deserialize(response, return_type)
216
223
  body = response.body
217
-
218
- # handle file downloading - return the File instance processed in request callbacks
219
- # note that response body is empty when the file is written in chunks in request on_body callback
220
- return @tempfile if return_type == 'File'
221
-
222
224
  return nil if body.nil? || body.empty?
223
225
 
224
226
  # return response body directly for String return type
225
- return body if return_type == 'String'
227
+ return body.to_s if return_type == 'String'
226
228
 
227
229
  # ensuring a default content type
228
230
  content_type = response.headers['Content-Type'] || 'application/json'
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -67,6 +67,11 @@ module ElasticEmail
67
67
  # @return [Proc]
68
68
  attr_accessor :access_token_getter
69
69
 
70
+ # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
71
+ # HTTP responses with return type `File` will be returned as a stream of binary data.
72
+ # Default to false.
73
+ attr_accessor :return_binary_data
74
+
70
75
  # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
71
76
  # details will be logged with `logger.debug` (see the `logger` attribute).
72
77
  # Default to false.
@@ -147,7 +152,7 @@ module ElasticEmail
147
152
  @scheme = 'https'
148
153
  @host = 'api.elasticemail.com'
149
154
  @base_path = '/v4'
150
- @server_index = 0
155
+ @server_index = nil
151
156
  @server_operation_index = {}
152
157
  @server_variables = {}
153
158
  @server_operation_variables = {}
@@ -195,10 +200,12 @@ module ElasticEmail
195
200
 
196
201
  # Returns base URL for specified operation based on server settings
197
202
  def base_url(operation = nil)
198
- index = server_operation_index.fetch(operation, server_index)
199
- return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
200
-
201
- server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
203
+ if operation_server_settings.key?(operation) then
204
+ index = server_operation_index.fetch(operation, server_index)
205
+ server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
206
+ else
207
+ server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
208
+ end
202
209
  end
203
210
 
204
211
  # Gets API key (with prefix if set).
@@ -215,8 +222,8 @@ module ElasticEmail
215
222
 
216
223
  # Gets access_token using access_token_getter or uses the static access_token
217
224
  def access_token_with_refresh
218
- return access_token if access_token_getter.nil?
219
- access_token_getter.call
225
+ return access_token if access_token_getter.nil?
226
+ access_token_getter.call
220
227
  end
221
228
 
222
229
  # Gets Basic Auth token string
@@ -260,8 +267,8 @@ module ElasticEmail
260
267
  servers = server_settings if servers == nil
261
268
 
262
269
  # check array index out of bound
263
- if (index < 0 || index >= servers.size)
264
- fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
270
+ if (index.nil? || index < 0 || index >= servers.size)
271
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
265
272
  end
266
273
 
267
274
  server = servers[index]
@@ -286,5 +293,6 @@ module ElasticEmail
286
293
  url
287
294
  end
288
295
 
296
+
289
297
  end
290
298
  end
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -59,16 +59,17 @@ module ElasticEmail
59
59
  EXTENDED_LOGS = "ExtendedLogs".freeze
60
60
  VERIFY_EMAILS = "VerifyEmails".freeze
61
61
  MODIFY2_FA_SMS = "Modify2FASms".freeze
62
- DISABLE_CONTACTS_STORE = "DisableContactsStore".freeze
63
62
  MODIFY_LANDING_PAGES = "ModifyLandingPages".freeze
64
63
  VIEW_LANDING_PAGES = "ViewLandingPages".freeze
65
64
  MODIFY_SUPPRESSIONS = "ModifySuppressions".freeze
66
65
  VIEW_SUPPRESSIONS = "ViewSuppressions".freeze
67
66
  VIEW_DRAG_DROP_EDITOR = "ViewDragDropEditor".freeze
68
67
  VIEW_TEMPLATE_EDITOR = "ViewTemplateEditor".freeze
68
+ VIEW_AI_TOOLS = "ViewAITools".freeze
69
+ MODIFY_SUBSCRIPTION_ANTI_SPAM = "ModifySubscriptionAntiSpam".freeze
69
70
 
70
71
  def self.all_vars
71
- @all_vars ||= [NONE, VIEW_ACCOUNT, VIEW_CONTACTS, VIEW_FORMS, VIEW_TEMPLATES, VIEW_CAMPAIGNS, VIEW_CHANNELS, VIEW_AUTOMATIONS, VIEW_SURVEYS, VIEW_SETTINGS, VIEW_BILLING, VIEW_SUB_ACCOUNTS, VIEW_USERS, VIEW_FILES, VIEW_REPORTS, MODIFY_ACCOUNT, MODIFY_CONTACTS, MODIFY_FORMS, MODIFY_TEMPLATES, MODIFY_CAMPAIGNS, MODIFY_CHANNELS, MODIFY_AUTOMATIONS, MODIFY_SURVEYS, MODIFY_FILES, EXPORT, SEND_SMTP, SEND_SMS, MODIFY_SETTINGS, MODIFY_BILLING, MODIFY_PROFILE, MODIFY_SUB_ACCOUNTS, MODIFY_USERS, SECURITY, MODIFY_LANGUAGE, VIEW_SUPPORT, SEND_HTTP, MODIFY2_FA_EMAIL, MODIFY_SUPPORT, VIEW_CUSTOM_FIELDS, MODIFY_CUSTOM_FIELDS, MODIFY_WEB_NOTIFICATIONS, EXTENDED_LOGS, VERIFY_EMAILS, MODIFY2_FA_SMS, DISABLE_CONTACTS_STORE, MODIFY_LANDING_PAGES, VIEW_LANDING_PAGES, MODIFY_SUPPRESSIONS, VIEW_SUPPRESSIONS, VIEW_DRAG_DROP_EDITOR, VIEW_TEMPLATE_EDITOR].freeze
72
+ @all_vars ||= [NONE, VIEW_ACCOUNT, VIEW_CONTACTS, VIEW_FORMS, VIEW_TEMPLATES, VIEW_CAMPAIGNS, VIEW_CHANNELS, VIEW_AUTOMATIONS, VIEW_SURVEYS, VIEW_SETTINGS, VIEW_BILLING, VIEW_SUB_ACCOUNTS, VIEW_USERS, VIEW_FILES, VIEW_REPORTS, MODIFY_ACCOUNT, MODIFY_CONTACTS, MODIFY_FORMS, MODIFY_TEMPLATES, MODIFY_CAMPAIGNS, MODIFY_CHANNELS, MODIFY_AUTOMATIONS, MODIFY_SURVEYS, MODIFY_FILES, EXPORT, SEND_SMTP, SEND_SMS, MODIFY_SETTINGS, MODIFY_BILLING, MODIFY_PROFILE, MODIFY_SUB_ACCOUNTS, MODIFY_USERS, SECURITY, MODIFY_LANGUAGE, VIEW_SUPPORT, SEND_HTTP, MODIFY2_FA_EMAIL, MODIFY_SUPPORT, VIEW_CUSTOM_FIELDS, MODIFY_CUSTOM_FIELDS, MODIFY_WEB_NOTIFICATIONS, EXTENDED_LOGS, VERIFY_EMAILS, MODIFY2_FA_SMS, MODIFY_LANDING_PAGES, VIEW_LANDING_PAGES, MODIFY_SUPPRESSIONS, VIEW_SUPPRESSIONS, VIEW_DRAG_DROP_EDITOR, VIEW_TEMPLATE_EDITOR, VIEW_AI_TOOLS, MODIFY_SUBSCRIPTION_ANTI_SPAM].freeze
72
73
  end
73
74
 
74
75
  # Builds the enum from string
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -118,6 +118,7 @@ module ElasticEmail
118
118
  # Show invalid properties with the reasons. Usually used together with valid?
119
119
  # @return Array for valid properties with the reasons
120
120
  def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
122
  invalid_properties = Array.new
122
123
  invalid_properties
123
124
  end
@@ -125,6 +126,7 @@ module ElasticEmail
125
126
  # Check to see if the all the properties in the model are valid
126
127
  # @return true if the model is valid
127
128
  def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
128
130
  true
129
131
  end
130
132
 
@@ -157,37 +159,30 @@ module ElasticEmail
157
159
  # @param [Hash] attributes Model attributes in the form of hash
158
160
  # @return [Object] Returns the model itself
159
161
  def self.build_from_hash(attributes)
160
- new.build_from_hash(attributes)
161
- end
162
-
163
- # Builds the object from hash
164
- # @param [Hash] attributes Model attributes in the form of hash
165
- # @return [Object] Returns the model itself
166
- def build_from_hash(attributes)
167
162
  return nil unless attributes.is_a?(Hash)
168
163
  attributes = attributes.transform_keys(&:to_sym)
169
- self.class.openapi_types.each_pair do |key, type|
170
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
171
- self.send("#{key}=", nil)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
172
168
  elsif type =~ /\AArray<(.*)>/i
173
169
  # check to ensure the input is an array given that the attribute
174
170
  # is documented as an array but the input is not
175
- if attributes[self.class.attribute_map[key]].is_a?(Array)
176
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
177
173
  end
178
- elsif !attributes[self.class.attribute_map[key]].nil?
179
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
180
176
  end
181
177
  end
182
-
183
- self
178
+ new(transformed_hash)
184
179
  end
185
180
 
186
181
  # Deserializes the data based on type
187
182
  # @param string type Data type
188
183
  # @param string value Value to be deserialized
189
184
  # @return [Object] Deserialized data
190
- def _deserialize(type, value)
185
+ def self._deserialize(type, value)
191
186
  case type.to_sym
192
187
  when :Time
193
188
  Time.parse(value)
@@ -222,7 +217,7 @@ module ElasticEmail
222
217
  else # model
223
218
  # models (e.g. Pet) or oneOf
224
219
  klass = ElasticEmail.const_get(type)
225
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
220
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
221
  end
227
222
  end
228
223
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -82,12 +82,16 @@ module ElasticEmail
82
82
 
83
83
  if attributes.key?(:'name')
84
84
  self.name = attributes[:'name']
85
+ else
86
+ self.name = nil
85
87
  end
86
88
 
87
89
  if attributes.key?(:'access_level')
88
90
  if (value = attributes[:'access_level']).is_a?(Array)
89
91
  self.access_level = value
90
92
  end
93
+ else
94
+ self.access_level = nil
91
95
  end
92
96
 
93
97
  if attributes.key?(:'expires')
@@ -108,6 +112,7 @@ module ElasticEmail
108
112
  # Show invalid properties with the reasons. Usually used together with valid?
109
113
  # @return Array for valid properties with the reasons
110
114
  def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
116
  invalid_properties = Array.new
112
117
  if @name.nil?
113
118
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -123,6 +128,7 @@ module ElasticEmail
123
128
  # Check to see if the all the properties in the model are valid
124
129
  # @return true if the model is valid
125
130
  def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
132
  return false if @name.nil?
127
133
  return false if @access_level.nil?
128
134
  true
@@ -156,37 +162,30 @@ module ElasticEmail
156
162
  # @param [Hash] attributes Model attributes in the form of hash
157
163
  # @return [Object] Returns the model itself
158
164
  def self.build_from_hash(attributes)
159
- new.build_from_hash(attributes)
160
- end
161
-
162
- # Builds the object from hash
163
- # @param [Hash] attributes Model attributes in the form of hash
164
- # @return [Object] Returns the model itself
165
- def build_from_hash(attributes)
166
165
  return nil unless attributes.is_a?(Hash)
167
166
  attributes = attributes.transform_keys(&:to_sym)
168
- self.class.openapi_types.each_pair do |key, type|
169
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
170
- self.send("#{key}=", nil)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
171
  elsif type =~ /\AArray<(.*)>/i
172
172
  # check to ensure the input is an array given that the attribute
173
173
  # is documented as an array but the input is not
174
- if attributes[self.class.attribute_map[key]].is_a?(Array)
175
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
176
  end
177
- elsif !attributes[self.class.attribute_map[key]].nil?
178
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
179
  end
180
180
  end
181
-
182
- self
181
+ new(transformed_hash)
183
182
  end
184
183
 
185
184
  # Deserializes the data based on type
186
185
  # @param string type Data type
187
186
  # @param string value Value to be deserialized
188
187
  # @return [Object] Deserialized data
189
- def _deserialize(type, value)
188
+ def self._deserialize(type, value)
190
189
  case type.to_sym
191
190
  when :Time
192
191
  Time.parse(value)
@@ -221,7 +220,7 @@ module ElasticEmail
221
220
  else # model
222
221
  # models (e.g. Pet) or oneOf
223
222
  klass = ElasticEmail.const_get(type)
224
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
223
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
225
224
  end
226
225
  end
227
226
 
@@ -6,7 +6,7 @@
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
- OpenAPI Generator version: 6.3.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12