ElasticEmail 4.0.23 → 4.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ElasticEmail.gemspec +2 -1
- data/README.md +10 -4
- data/VERSION +1 -1
- data/docs/CampaignOptions.md +4 -0
- data/docs/CampaignTemplate.md +2 -2
- data/docs/EmailContent.md +2 -2
- data/docs/EmailJobFailedStatus.md +24 -0
- data/docs/EmailJobStatus.md +56 -0
- data/docs/EmailMessageData.md +1 -1
- data/docs/EmailTransactionalMessageData.md +1 -1
- data/docs/EmailValidationResult.md +2 -2
- data/docs/EmailsApi.md +97 -3
- data/docs/EmailsPayload.md +1 -1
- data/docs/ListPayload.md +1 -1
- data/docs/ListsApi.md +78 -0
- data/docs/MergeEmailPayload.md +1 -1
- data/lib/ElasticEmail/api/campaigns_api.rb +1 -1
- data/lib/ElasticEmail/api/contacts_api.rb +1 -1
- data/lib/ElasticEmail/api/emails_api.rb +94 -1
- data/lib/ElasticEmail/api/events_api.rb +1 -1
- data/lib/ElasticEmail/api/files_api.rb +1 -1
- data/lib/ElasticEmail/api/inbound_route_api.rb +1 -1
- data/lib/ElasticEmail/api/lists_api.rb +70 -1
- data/lib/ElasticEmail/api/security_api.rb +1 -1
- data/lib/ElasticEmail/api/segments_api.rb +1 -1
- data/lib/ElasticEmail/api/statistics_api.rb +1 -1
- data/lib/ElasticEmail/api/sub_accounts_api.rb +1 -1
- data/lib/ElasticEmail/api/suppressions_api.rb +1 -1
- data/lib/ElasticEmail/api/templates_api.rb +1 -1
- data/lib/ElasticEmail/api/verifications_api.rb +1 -1
- data/lib/ElasticEmail/api_client.rb +25 -23
- data/lib/ElasticEmail/api_error.rb +1 -1
- data/lib/ElasticEmail/configuration.rb +28 -10
- data/lib/ElasticEmail/models/access_level.rb +3 -3
- data/lib/ElasticEmail/models/account_status_enum.rb +1 -1
- data/lib/ElasticEmail/models/api_key.rb +14 -19
- data/lib/ElasticEmail/models/api_key_payload.rb +18 -19
- data/lib/ElasticEmail/models/body_content_type.rb +1 -1
- data/lib/ElasticEmail/models/body_part.rb +14 -19
- data/lib/ElasticEmail/models/campaign.rb +18 -19
- data/lib/ElasticEmail/models/campaign_options.rb +35 -20
- data/lib/ElasticEmail/models/campaign_recipient.rb +14 -19
- data/lib/ElasticEmail/models/campaign_status.rb +1 -1
- data/lib/ElasticEmail/models/campaign_template.rb +21 -19
- data/lib/ElasticEmail/models/channel_log_status_summary.rb +14 -19
- data/lib/ElasticEmail/models/compression_format.rb +1 -1
- data/lib/ElasticEmail/models/consent_data.rb +14 -19
- data/lib/ElasticEmail/models/consent_tracking.rb +1 -1
- data/lib/ElasticEmail/models/contact.rb +14 -19
- data/lib/ElasticEmail/models/contact_activity.rb +14 -19
- data/lib/ElasticEmail/models/contact_payload.rb +16 -19
- data/lib/ElasticEmail/models/contact_source.rb +1 -1
- data/lib/ElasticEmail/models/contact_status.rb +1 -1
- data/lib/ElasticEmail/models/contact_update_payload.rb +14 -19
- data/lib/ElasticEmail/models/contacts_list.rb +14 -19
- data/lib/ElasticEmail/models/delivery_optimization_type.rb +1 -1
- data/lib/ElasticEmail/models/email_content.rb +21 -19
- data/lib/ElasticEmail/models/email_data.rb +14 -19
- data/lib/ElasticEmail/models/{contact_history.rb → email_job_failed_status.rb} +44 -83
- data/lib/ElasticEmail/models/email_job_status.rb +415 -0
- data/lib/ElasticEmail/models/email_message_data.rb +23 -19
- data/lib/ElasticEmail/models/email_predicted_validation_status.rb +1 -1
- data/lib/ElasticEmail/models/email_recipient.rb +16 -19
- data/lib/ElasticEmail/models/email_send.rb +14 -19
- data/lib/ElasticEmail/models/email_status.rb +14 -19
- data/lib/ElasticEmail/models/email_transactional_message_data.rb +23 -19
- data/lib/ElasticEmail/models/email_validation_result.rb +16 -20
- data/lib/ElasticEmail/models/email_validation_status.rb +1 -1
- data/lib/ElasticEmail/models/email_view.rb +14 -19
- data/lib/ElasticEmail/models/emails_payload.rb +14 -19
- data/lib/ElasticEmail/models/encoding_type.rb +1 -1
- data/lib/ElasticEmail/models/event_type.rb +1 -1
- data/lib/ElasticEmail/models/events_order_by.rb +1 -1
- data/lib/ElasticEmail/models/export_file_formats.rb +1 -1
- data/lib/ElasticEmail/models/export_link.rb +14 -19
- data/lib/ElasticEmail/models/export_status.rb +1 -1
- data/lib/ElasticEmail/models/file_info.rb +14 -19
- data/lib/ElasticEmail/models/file_payload.rb +16 -19
- data/lib/ElasticEmail/models/file_upload_result.rb +14 -19
- data/lib/ElasticEmail/models/inbound_payload.rb +18 -19
- data/lib/ElasticEmail/models/inbound_route.rb +14 -19
- data/lib/ElasticEmail/models/inbound_route_action_type.rb +1 -1
- data/lib/ElasticEmail/models/inbound_route_filter_type.rb +1 -1
- data/lib/ElasticEmail/models/list_payload.rb +16 -19
- data/lib/ElasticEmail/models/list_update_payload.rb +14 -19
- data/lib/ElasticEmail/models/log_job_status.rb +1 -1
- data/lib/ElasticEmail/models/log_status_summary.rb +14 -19
- data/lib/ElasticEmail/models/merge_email_payload.rb +23 -19
- data/lib/ElasticEmail/models/message_attachment.rb +18 -19
- data/lib/ElasticEmail/models/message_category.rb +1 -1
- data/lib/ElasticEmail/models/new_api_key.rb +14 -19
- data/lib/ElasticEmail/models/new_smtp_credentials.rb +14 -19
- data/lib/ElasticEmail/models/options.rb +16 -19
- data/lib/ElasticEmail/models/recipient_event.rb +14 -19
- data/lib/ElasticEmail/models/segment.rb +14 -19
- data/lib/ElasticEmail/models/segment_payload.rb +18 -19
- data/lib/ElasticEmail/models/smtp_credentials.rb +14 -19
- data/lib/ElasticEmail/models/smtp_credentials_payload.rb +16 -19
- data/lib/ElasticEmail/models/sort_order_item.rb +18 -19
- data/lib/ElasticEmail/models/split_optimization_type.rb +1 -1
- data/lib/ElasticEmail/models/split_options.rb +14 -19
- data/lib/ElasticEmail/models/sub_account_info.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_email_credits_payload.rb +16 -19
- data/lib/ElasticEmail/models/subaccount_email_settings.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_email_settings_payload.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_payload.rb +18 -19
- data/lib/ElasticEmail/models/subaccount_settings_info.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_settings_info_payload.rb +14 -19
- data/lib/ElasticEmail/models/suppression.rb +14 -19
- data/lib/ElasticEmail/models/template.rb +14 -19
- data/lib/ElasticEmail/models/template_payload.rb +16 -19
- data/lib/ElasticEmail/models/template_scope.rb +1 -1
- data/lib/ElasticEmail/models/template_type.rb +3 -2
- data/lib/ElasticEmail/models/transactional_recipient.rb +16 -19
- data/lib/ElasticEmail/models/utm.rb +14 -19
- data/lib/ElasticEmail/models/verification_file_result.rb +14 -19
- data/lib/ElasticEmail/models/verification_file_result_details.rb +14 -19
- data/lib/ElasticEmail/models/verification_status.rb +1 -1
- data/lib/ElasticEmail/version.rb +2 -2
- data/lib/ElasticEmail.rb +3 -1
- data/spec/api/campaigns_api_spec.rb +7 -7
- data/spec/api/contacts_api_spec.rb +12 -25
- data/spec/api/emails_api_spec.rb +28 -6
- data/spec/api/events_api_spec.rb +9 -9
- data/spec/api/files_api_spec.rb +7 -7
- data/spec/api/inbound_route_api_spec.rb +8 -8
- data/spec/api/lists_api_spec.rb +23 -9
- data/spec/api/security_api_spec.rb +12 -12
- data/spec/api/segments_api_spec.rb +7 -7
- data/spec/api/statistics_api_spec.rb +7 -7
- data/spec/api/sub_accounts_api_spec.rb +8 -8
- data/spec/api/suppressions_api_spec.rb +26 -26
- data/spec/api/templates_api_spec.rb +7 -7
- data/spec/api/verifications_api_spec.rb +30 -18
- data/spec/models/access_level_spec.rb +5 -3
- data/spec/models/account_status_enum_spec.rb +5 -3
- data/spec/models/api_key_payload_spec.rb +10 -8
- data/spec/models/api_key_spec.rb +11 -9
- data/spec/models/body_content_type_spec.rb +5 -3
- data/spec/models/body_part_spec.rb +8 -6
- data/spec/models/campaign_options_spec.rb +22 -8
- data/spec/models/campaign_recipient_spec.rb +7 -5
- data/spec/models/campaign_spec.rb +10 -8
- data/spec/models/campaign_status_spec.rb +5 -3
- data/spec/models/campaign_template_spec.rb +12 -10
- data/spec/models/channel_log_status_summary_spec.rb +19 -17
- data/spec/models/compression_format_spec.rb +5 -3
- data/spec/models/consent_data_spec.rb +8 -6
- data/spec/models/consent_tracking_spec.rb +5 -3
- data/spec/models/contact_activity_spec.rb +16 -14
- data/spec/models/contact_payload_spec.rb +11 -9
- data/spec/models/contact_source_spec.rb +5 -3
- data/spec/models/contact_spec.rb +16 -14
- data/spec/models/contact_status_spec.rb +5 -3
- data/spec/models/contact_update_payload_spec.rb +8 -6
- data/spec/models/contacts_list_spec.rb +9 -7
- data/spec/models/delivery_optimization_type_spec.rb +5 -3
- data/spec/models/email_content_spec.rb +22 -14
- data/spec/models/email_data_spec.rb +8 -6
- data/spec/models/email_job_failed_status_spec.rb +54 -0
- data/spec/models/email_job_status_spec.rb +150 -0
- data/spec/models/email_message_data_spec.rb +8 -6
- data/spec/models/email_predicted_validation_status_spec.rb +4 -2
- data/spec/models/email_recipient_spec.rb +7 -5
- data/spec/models/email_send_spec.rb +7 -5
- data/spec/models/email_status_spec.rb +17 -15
- data/spec/models/email_transactional_message_data_spec.rb +8 -6
- data/spec/models/email_validation_result_spec.rb +26 -12
- data/spec/models/email_validation_status_spec.rb +5 -3
- data/spec/models/email_view_spec.rb +8 -6
- data/spec/models/emails_payload_spec.rb +7 -5
- data/spec/models/encoding_type_spec.rb +5 -3
- data/spec/models/event_type_spec.rb +5 -3
- data/spec/models/events_order_by_spec.rb +5 -3
- data/spec/models/export_file_formats_spec.rb +5 -3
- data/spec/models/export_link_spec.rb +7 -5
- data/spec/models/export_status_spec.rb +5 -3
- data/spec/models/file_info_spec.rb +10 -8
- data/spec/models/file_payload_spec.rb +8 -6
- data/spec/models/file_upload_result_spec.rb +7 -5
- data/spec/models/inbound_payload_spec.rb +11 -9
- data/spec/models/inbound_route_action_type_spec.rb +5 -3
- data/spec/models/inbound_route_filter_type_spec.rb +5 -3
- data/spec/models/inbound_route_spec.rb +12 -10
- data/spec/models/list_payload_spec.rb +8 -6
- data/spec/models/list_update_payload_spec.rb +7 -5
- data/spec/models/log_job_status_spec.rb +5 -3
- data/spec/models/log_status_summary_spec.rb +18 -16
- data/spec/models/merge_email_payload_spec.rb +8 -6
- data/spec/models/message_attachment_spec.rb +14 -6
- data/spec/models/message_category_spec.rb +5 -3
- data/spec/models/new_api_key_spec.rb +12 -10
- data/spec/models/new_smtp_credentials_spec.rb +12 -10
- data/spec/models/options_spec.rb +11 -9
- data/spec/models/recipient_event_spec.rb +18 -16
- data/spec/models/segment_payload_spec.rb +7 -5
- data/spec/models/segment_spec.rb +7 -5
- data/spec/models/smtp_credentials_payload_spec.rb +9 -7
- data/spec/models/smtp_credentials_spec.rb +11 -9
- data/spec/models/sort_order_item_spec.rb +7 -5
- data/spec/models/split_optimization_type_spec.rb +5 -3
- data/spec/models/split_options_spec.rb +7 -5
- data/spec/models/sub_account_info_spec.rb +14 -12
- data/spec/models/subaccount_email_credits_payload_spec.rb +7 -5
- data/spec/models/subaccount_email_settings_payload_spec.rb +17 -9
- data/spec/models/subaccount_email_settings_spec.rb +18 -10
- data/spec/models/subaccount_payload_spec.rb +9 -7
- data/spec/models/subaccount_settings_info_payload_spec.rb +6 -4
- data/spec/models/subaccount_settings_info_spec.rb +6 -4
- data/spec/models/suppression_spec.rb +9 -7
- data/spec/models/template_payload_spec.rb +9 -7
- data/spec/models/template_scope_spec.rb +5 -3
- data/spec/models/template_spec.rb +11 -9
- data/spec/models/template_type_spec.rb +5 -3
- data/spec/models/transactional_recipient_spec.rb +8 -6
- data/spec/models/utm_spec.rb +9 -7
- data/spec/models/verification_file_result_details_spec.rb +12 -10
- data/spec/models/verification_file_result_spec.rb +11 -9
- data/spec/models/verification_status_spec.rb +5 -3
- data/spec/spec_helper.rb +1 -1
- metadata +10 -18
- data/docs/ContactHistEventType.md +0 -15
- data/docs/ContactHistory.md +0 -30
- data/docs/TemplateScopeType.md +0 -15
- data/lib/ElasticEmail/models/contact_hist_event_type.rb +0 -49
- data/lib/ElasticEmail/models/template_scope_type.rb +0 -38
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/contact_hist_event_type_spec.rb +0 -28
- data/spec/models/contact_history_spec.rb +0 -70
- data/spec/models/template_scope_type_spec.rb +0 -28
@@ -0,0 +1,415 @@
|
|
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.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module ElasticEmail
|
17
|
+
class EmailJobStatus
|
18
|
+
# ID number of your attachment
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# Name of status: submitted, complete, in_progress
|
22
|
+
attr_accessor :status
|
23
|
+
|
24
|
+
attr_accessor :recipients_count
|
25
|
+
|
26
|
+
attr_accessor :failed
|
27
|
+
|
28
|
+
# Total emails failed.
|
29
|
+
attr_accessor :failed_count
|
30
|
+
|
31
|
+
attr_accessor :sent
|
32
|
+
|
33
|
+
# Total emails sent.
|
34
|
+
attr_accessor :sent_count
|
35
|
+
|
36
|
+
# Number of delivered messages
|
37
|
+
attr_accessor :delivered
|
38
|
+
|
39
|
+
attr_accessor :delivered_count
|
40
|
+
|
41
|
+
attr_accessor :pending
|
42
|
+
|
43
|
+
attr_accessor :pending_count
|
44
|
+
|
45
|
+
# Number of opened messages
|
46
|
+
attr_accessor :opened
|
47
|
+
|
48
|
+
# Total emails opened.
|
49
|
+
attr_accessor :opened_count
|
50
|
+
|
51
|
+
# Number of clicked messages
|
52
|
+
attr_accessor :clicked
|
53
|
+
|
54
|
+
# Total emails clicked
|
55
|
+
attr_accessor :clicked_count
|
56
|
+
|
57
|
+
# Number of unsubscribed messages
|
58
|
+
attr_accessor :unsubscribed
|
59
|
+
|
60
|
+
# Total emails unsubscribed
|
61
|
+
attr_accessor :unsubscribed_count
|
62
|
+
|
63
|
+
attr_accessor :abuse_reports
|
64
|
+
|
65
|
+
attr_accessor :abuse_reports_count
|
66
|
+
|
67
|
+
# List of all MessageIDs for this job.
|
68
|
+
attr_accessor :message_ids
|
69
|
+
|
70
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
71
|
+
def self.attribute_map
|
72
|
+
{
|
73
|
+
:'id' => :'ID',
|
74
|
+
:'status' => :'Status',
|
75
|
+
:'recipients_count' => :'RecipientsCount',
|
76
|
+
:'failed' => :'Failed',
|
77
|
+
:'failed_count' => :'FailedCount',
|
78
|
+
:'sent' => :'Sent',
|
79
|
+
:'sent_count' => :'SentCount',
|
80
|
+
:'delivered' => :'Delivered',
|
81
|
+
:'delivered_count' => :'DeliveredCount',
|
82
|
+
:'pending' => :'Pending',
|
83
|
+
:'pending_count' => :'PendingCount',
|
84
|
+
:'opened' => :'Opened',
|
85
|
+
:'opened_count' => :'OpenedCount',
|
86
|
+
:'clicked' => :'Clicked',
|
87
|
+
:'clicked_count' => :'ClickedCount',
|
88
|
+
:'unsubscribed' => :'Unsubscribed',
|
89
|
+
:'unsubscribed_count' => :'UnsubscribedCount',
|
90
|
+
:'abuse_reports' => :'AbuseReports',
|
91
|
+
:'abuse_reports_count' => :'AbuseReportsCount',
|
92
|
+
:'message_ids' => :'MessageIDs'
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
# Returns all the JSON keys this model knows about
|
97
|
+
def self.acceptable_attributes
|
98
|
+
attribute_map.values
|
99
|
+
end
|
100
|
+
|
101
|
+
# Attribute type mapping.
|
102
|
+
def self.openapi_types
|
103
|
+
{
|
104
|
+
:'id' => :'String',
|
105
|
+
:'status' => :'String',
|
106
|
+
:'recipients_count' => :'Integer',
|
107
|
+
:'failed' => :'Array<EmailJobFailedStatus>',
|
108
|
+
:'failed_count' => :'Integer',
|
109
|
+
:'sent' => :'Array<String>',
|
110
|
+
:'sent_count' => :'Integer',
|
111
|
+
:'delivered' => :'Array<String>',
|
112
|
+
:'delivered_count' => :'Integer',
|
113
|
+
:'pending' => :'Array<String>',
|
114
|
+
:'pending_count' => :'Integer',
|
115
|
+
:'opened' => :'Array<String>',
|
116
|
+
:'opened_count' => :'Integer',
|
117
|
+
:'clicked' => :'Array<String>',
|
118
|
+
:'clicked_count' => :'Integer',
|
119
|
+
:'unsubscribed' => :'Array<String>',
|
120
|
+
:'unsubscribed_count' => :'Integer',
|
121
|
+
:'abuse_reports' => :'Array<String>',
|
122
|
+
:'abuse_reports_count' => :'Integer',
|
123
|
+
:'message_ids' => :'Array<String>'
|
124
|
+
}
|
125
|
+
end
|
126
|
+
|
127
|
+
# List of attributes with nullable: true
|
128
|
+
def self.openapi_nullable
|
129
|
+
Set.new([
|
130
|
+
])
|
131
|
+
end
|
132
|
+
|
133
|
+
# Initializes the object
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
def initialize(attributes = {})
|
136
|
+
if (!attributes.is_a?(Hash))
|
137
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ElasticEmail::EmailJobStatus` initialize method"
|
138
|
+
end
|
139
|
+
|
140
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
141
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
142
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
143
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ElasticEmail::EmailJobStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
144
|
+
end
|
145
|
+
h[k.to_sym] = v
|
146
|
+
}
|
147
|
+
|
148
|
+
if attributes.key?(:'id')
|
149
|
+
self.id = attributes[:'id']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'status')
|
153
|
+
self.status = attributes[:'status']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'recipients_count')
|
157
|
+
self.recipients_count = attributes[:'recipients_count']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'failed')
|
161
|
+
if (value = attributes[:'failed']).is_a?(Array)
|
162
|
+
self.failed = value
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'failed_count')
|
167
|
+
self.failed_count = attributes[:'failed_count']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.key?(:'sent')
|
171
|
+
if (value = attributes[:'sent']).is_a?(Array)
|
172
|
+
self.sent = value
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'sent_count')
|
177
|
+
self.sent_count = attributes[:'sent_count']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'delivered')
|
181
|
+
if (value = attributes[:'delivered']).is_a?(Array)
|
182
|
+
self.delivered = value
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.key?(:'delivered_count')
|
187
|
+
self.delivered_count = attributes[:'delivered_count']
|
188
|
+
end
|
189
|
+
|
190
|
+
if attributes.key?(:'pending')
|
191
|
+
if (value = attributes[:'pending']).is_a?(Array)
|
192
|
+
self.pending = value
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'pending_count')
|
197
|
+
self.pending_count = attributes[:'pending_count']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'opened')
|
201
|
+
if (value = attributes[:'opened']).is_a?(Array)
|
202
|
+
self.opened = value
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.key?(:'opened_count')
|
207
|
+
self.opened_count = attributes[:'opened_count']
|
208
|
+
end
|
209
|
+
|
210
|
+
if attributes.key?(:'clicked')
|
211
|
+
if (value = attributes[:'clicked']).is_a?(Array)
|
212
|
+
self.clicked = value
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
if attributes.key?(:'clicked_count')
|
217
|
+
self.clicked_count = attributes[:'clicked_count']
|
218
|
+
end
|
219
|
+
|
220
|
+
if attributes.key?(:'unsubscribed')
|
221
|
+
if (value = attributes[:'unsubscribed']).is_a?(Array)
|
222
|
+
self.unsubscribed = value
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
if attributes.key?(:'unsubscribed_count')
|
227
|
+
self.unsubscribed_count = attributes[:'unsubscribed_count']
|
228
|
+
end
|
229
|
+
|
230
|
+
if attributes.key?(:'abuse_reports')
|
231
|
+
if (value = attributes[:'abuse_reports']).is_a?(Array)
|
232
|
+
self.abuse_reports = value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'abuse_reports_count')
|
237
|
+
self.abuse_reports_count = attributes[:'abuse_reports_count']
|
238
|
+
end
|
239
|
+
|
240
|
+
if attributes.key?(:'message_ids')
|
241
|
+
if (value = attributes[:'message_ids']).is_a?(Array)
|
242
|
+
self.message_ids = value
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
248
|
+
# @return Array for valid properties with the reasons
|
249
|
+
def list_invalid_properties
|
250
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
251
|
+
invalid_properties = Array.new
|
252
|
+
invalid_properties
|
253
|
+
end
|
254
|
+
|
255
|
+
# Check to see if the all the properties in the model are valid
|
256
|
+
# @return true if the model is valid
|
257
|
+
def valid?
|
258
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
259
|
+
true
|
260
|
+
end
|
261
|
+
|
262
|
+
# Checks equality by comparing each attribute.
|
263
|
+
# @param [Object] Object to be compared
|
264
|
+
def ==(o)
|
265
|
+
return true if self.equal?(o)
|
266
|
+
self.class == o.class &&
|
267
|
+
id == o.id &&
|
268
|
+
status == o.status &&
|
269
|
+
recipients_count == o.recipients_count &&
|
270
|
+
failed == o.failed &&
|
271
|
+
failed_count == o.failed_count &&
|
272
|
+
sent == o.sent &&
|
273
|
+
sent_count == o.sent_count &&
|
274
|
+
delivered == o.delivered &&
|
275
|
+
delivered_count == o.delivered_count &&
|
276
|
+
pending == o.pending &&
|
277
|
+
pending_count == o.pending_count &&
|
278
|
+
opened == o.opened &&
|
279
|
+
opened_count == o.opened_count &&
|
280
|
+
clicked == o.clicked &&
|
281
|
+
clicked_count == o.clicked_count &&
|
282
|
+
unsubscribed == o.unsubscribed &&
|
283
|
+
unsubscribed_count == o.unsubscribed_count &&
|
284
|
+
abuse_reports == o.abuse_reports &&
|
285
|
+
abuse_reports_count == o.abuse_reports_count &&
|
286
|
+
message_ids == o.message_ids
|
287
|
+
end
|
288
|
+
|
289
|
+
# @see the `==` method
|
290
|
+
# @param [Object] Object to be compared
|
291
|
+
def eql?(o)
|
292
|
+
self == o
|
293
|
+
end
|
294
|
+
|
295
|
+
# Calculates hash code according to all attributes.
|
296
|
+
# @return [Integer] Hash code
|
297
|
+
def hash
|
298
|
+
[id, status, recipients_count, failed, failed_count, sent, sent_count, delivered, delivered_count, pending, pending_count, opened, opened_count, clicked, clicked_count, unsubscribed, unsubscribed_count, abuse_reports, abuse_reports_count, message_ids].hash
|
299
|
+
end
|
300
|
+
|
301
|
+
# Builds the object from hash
|
302
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
303
|
+
# @return [Object] Returns the model itself
|
304
|
+
def self.build_from_hash(attributes)
|
305
|
+
return nil unless attributes.is_a?(Hash)
|
306
|
+
attributes = attributes.transform_keys(&:to_sym)
|
307
|
+
transformed_hash = {}
|
308
|
+
openapi_types.each_pair do |key, type|
|
309
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
310
|
+
transformed_hash["#{key}"] = nil
|
311
|
+
elsif type =~ /\AArray<(.*)>/i
|
312
|
+
# check to ensure the input is an array given that the attribute
|
313
|
+
# is documented as an array but the input is not
|
314
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
315
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
316
|
+
end
|
317
|
+
elsif !attributes[attribute_map[key]].nil?
|
318
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
319
|
+
end
|
320
|
+
end
|
321
|
+
new(transformed_hash)
|
322
|
+
end
|
323
|
+
|
324
|
+
# Deserializes the data based on type
|
325
|
+
# @param string type Data type
|
326
|
+
# @param string value Value to be deserialized
|
327
|
+
# @return [Object] Deserialized data
|
328
|
+
def self._deserialize(type, value)
|
329
|
+
case type.to_sym
|
330
|
+
when :Time
|
331
|
+
Time.parse(value)
|
332
|
+
when :Date
|
333
|
+
Date.parse(value)
|
334
|
+
when :String
|
335
|
+
value.to_s
|
336
|
+
when :Integer
|
337
|
+
value.to_i
|
338
|
+
when :Float
|
339
|
+
value.to_f
|
340
|
+
when :Boolean
|
341
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
342
|
+
true
|
343
|
+
else
|
344
|
+
false
|
345
|
+
end
|
346
|
+
when :Object
|
347
|
+
# generic object (usually a Hash), return directly
|
348
|
+
value
|
349
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
350
|
+
inner_type = Regexp.last_match[:inner_type]
|
351
|
+
value.map { |v| _deserialize(inner_type, v) }
|
352
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
353
|
+
k_type = Regexp.last_match[:k_type]
|
354
|
+
v_type = Regexp.last_match[:v_type]
|
355
|
+
{}.tap do |hash|
|
356
|
+
value.each do |k, v|
|
357
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
else # model
|
361
|
+
# models (e.g. Pet) or oneOf
|
362
|
+
klass = ElasticEmail.const_get(type)
|
363
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
# Returns the string representation of the object
|
368
|
+
# @return [String] String presentation of the object
|
369
|
+
def to_s
|
370
|
+
to_hash.to_s
|
371
|
+
end
|
372
|
+
|
373
|
+
# to_body is an alias to to_hash (backward compatibility)
|
374
|
+
# @return [Hash] Returns the object in the form of hash
|
375
|
+
def to_body
|
376
|
+
to_hash
|
377
|
+
end
|
378
|
+
|
379
|
+
# Returns the object in the form of hash
|
380
|
+
# @return [Hash] Returns the object in the form of hash
|
381
|
+
def to_hash
|
382
|
+
hash = {}
|
383
|
+
self.class.attribute_map.each_pair do |attr, param|
|
384
|
+
value = self.send(attr)
|
385
|
+
if value.nil?
|
386
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
387
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
388
|
+
end
|
389
|
+
|
390
|
+
hash[param] = _to_hash(value)
|
391
|
+
end
|
392
|
+
hash
|
393
|
+
end
|
394
|
+
|
395
|
+
# Outputs non-array value in the form of hash
|
396
|
+
# For object, use to_hash. Otherwise, just return the value
|
397
|
+
# @param [Object] value Any valid value
|
398
|
+
# @return [Hash] Returns the value in the form of hash
|
399
|
+
def _to_hash(value)
|
400
|
+
if value.is_a?(Array)
|
401
|
+
value.compact.map { |v| _to_hash(v) }
|
402
|
+
elsif value.is_a?(Hash)
|
403
|
+
{}.tap do |hash|
|
404
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
405
|
+
end
|
406
|
+
elsif value.respond_to? :to_hash
|
407
|
+
value.to_hash
|
408
|
+
else
|
409
|
+
value
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
end
|
414
|
+
|
415
|
+
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
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -71,10 +71,14 @@ module ElasticEmail
|
|
71
71
|
if (value = attributes[:'recipients']).is_a?(Array)
|
72
72
|
self.recipients = value
|
73
73
|
end
|
74
|
+
else
|
75
|
+
self.recipients = nil
|
74
76
|
end
|
75
77
|
|
76
78
|
if attributes.key?(:'content')
|
77
79
|
self.content = attributes[:'content']
|
80
|
+
else
|
81
|
+
self.content = nil
|
78
82
|
end
|
79
83
|
|
80
84
|
if attributes.key?(:'options')
|
@@ -85,18 +89,25 @@ module ElasticEmail
|
|
85
89
|
# Show invalid properties with the reasons. Usually used together with valid?
|
86
90
|
# @return Array for valid properties with the reasons
|
87
91
|
def list_invalid_properties
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
88
93
|
invalid_properties = Array.new
|
89
94
|
if @recipients.nil?
|
90
95
|
invalid_properties.push('invalid value for "recipients", recipients cannot be nil.')
|
91
96
|
end
|
92
97
|
|
98
|
+
if @content.nil?
|
99
|
+
invalid_properties.push('invalid value for "content", content cannot be nil.')
|
100
|
+
end
|
101
|
+
|
93
102
|
invalid_properties
|
94
103
|
end
|
95
104
|
|
96
105
|
# Check to see if the all the properties in the model are valid
|
97
106
|
# @return true if the model is valid
|
98
107
|
def valid?
|
108
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
99
109
|
return false if @recipients.nil?
|
110
|
+
return false if @content.nil?
|
100
111
|
true
|
101
112
|
end
|
102
113
|
|
@@ -126,37 +137,30 @@ module ElasticEmail
|
|
126
137
|
# @param [Hash] attributes Model attributes in the form of hash
|
127
138
|
# @return [Object] Returns the model itself
|
128
139
|
def self.build_from_hash(attributes)
|
129
|
-
new.build_from_hash(attributes)
|
130
|
-
end
|
131
|
-
|
132
|
-
# Builds the object from hash
|
133
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
-
# @return [Object] Returns the model itself
|
135
|
-
def build_from_hash(attributes)
|
136
140
|
return nil unless attributes.is_a?(Hash)
|
137
141
|
attributes = attributes.transform_keys(&:to_sym)
|
138
|
-
|
139
|
-
|
140
|
-
|
142
|
+
transformed_hash = {}
|
143
|
+
openapi_types.each_pair do |key, type|
|
144
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
145
|
+
transformed_hash["#{key}"] = nil
|
141
146
|
elsif type =~ /\AArray<(.*)>/i
|
142
147
|
# check to ensure the input is an array given that the attribute
|
143
148
|
# is documented as an array but the input is not
|
144
|
-
if attributes[
|
145
|
-
|
149
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
150
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
146
151
|
end
|
147
|
-
elsif !attributes[
|
148
|
-
|
152
|
+
elsif !attributes[attribute_map[key]].nil?
|
153
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
149
154
|
end
|
150
155
|
end
|
151
|
-
|
152
|
-
self
|
156
|
+
new(transformed_hash)
|
153
157
|
end
|
154
158
|
|
155
159
|
# Deserializes the data based on type
|
156
160
|
# @param string type Data type
|
157
161
|
# @param string value Value to be deserialized
|
158
162
|
# @return [Object] Deserialized data
|
159
|
-
def _deserialize(type, value)
|
163
|
+
def self._deserialize(type, value)
|
160
164
|
case type.to_sym
|
161
165
|
when :Time
|
162
166
|
Time.parse(value)
|
@@ -191,7 +195,7 @@ module ElasticEmail
|
|
191
195
|
else # model
|
192
196
|
# models (e.g. Pet) or oneOf
|
193
197
|
klass = ElasticEmail.const_get(type)
|
194
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
198
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
195
199
|
end
|
196
200
|
end
|
197
201
|
|
@@ -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
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -66,6 +66,8 @@ module ElasticEmail
|
|
66
66
|
|
67
67
|
if attributes.key?(:'email')
|
68
68
|
self.email = attributes[:'email']
|
69
|
+
else
|
70
|
+
self.email = nil
|
69
71
|
end
|
70
72
|
|
71
73
|
if attributes.key?(:'fields')
|
@@ -78,6 +80,7 @@ module ElasticEmail
|
|
78
80
|
# Show invalid properties with the reasons. Usually used together with valid?
|
79
81
|
# @return Array for valid properties with the reasons
|
80
82
|
def list_invalid_properties
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
81
84
|
invalid_properties = Array.new
|
82
85
|
if @email.nil?
|
83
86
|
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
@@ -89,6 +92,7 @@ module ElasticEmail
|
|
89
92
|
# Check to see if the all the properties in the model are valid
|
90
93
|
# @return true if the model is valid
|
91
94
|
def valid?
|
95
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
92
96
|
return false if @email.nil?
|
93
97
|
true
|
94
98
|
end
|
@@ -118,37 +122,30 @@ module ElasticEmail
|
|
118
122
|
# @param [Hash] attributes Model attributes in the form of hash
|
119
123
|
# @return [Object] Returns the model itself
|
120
124
|
def self.build_from_hash(attributes)
|
121
|
-
new.build_from_hash(attributes)
|
122
|
-
end
|
123
|
-
|
124
|
-
# Builds the object from hash
|
125
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
-
# @return [Object] Returns the model itself
|
127
|
-
def build_from_hash(attributes)
|
128
125
|
return nil unless attributes.is_a?(Hash)
|
129
126
|
attributes = attributes.transform_keys(&:to_sym)
|
130
|
-
|
131
|
-
|
132
|
-
|
127
|
+
transformed_hash = {}
|
128
|
+
openapi_types.each_pair do |key, type|
|
129
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
130
|
+
transformed_hash["#{key}"] = nil
|
133
131
|
elsif type =~ /\AArray<(.*)>/i
|
134
132
|
# check to ensure the input is an array given that the attribute
|
135
133
|
# is documented as an array but the input is not
|
136
|
-
if attributes[
|
137
|
-
|
134
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
135
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
138
136
|
end
|
139
|
-
elsif !attributes[
|
140
|
-
|
137
|
+
elsif !attributes[attribute_map[key]].nil?
|
138
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
141
139
|
end
|
142
140
|
end
|
143
|
-
|
144
|
-
self
|
141
|
+
new(transformed_hash)
|
145
142
|
end
|
146
143
|
|
147
144
|
# Deserializes the data based on type
|
148
145
|
# @param string type Data type
|
149
146
|
# @param string value Value to be deserialized
|
150
147
|
# @return [Object] Deserialized data
|
151
|
-
def _deserialize(type, value)
|
148
|
+
def self._deserialize(type, value)
|
152
149
|
case type.to_sym
|
153
150
|
when :Time
|
154
151
|
Time.parse(value)
|
@@ -183,7 +180,7 @@ module ElasticEmail
|
|
183
180
|
else # model
|
184
181
|
# models (e.g. Pet) or oneOf
|
185
182
|
klass = ElasticEmail.const_get(type)
|
186
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
184
|
end
|
188
185
|
end
|
189
186
|
|