ElasticEmail 4.0.23 → 4.0.24
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.
- 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
|
@@ -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
|
|
|
@@ -84,6 +84,7 @@ module ElasticEmail
|
|
|
84
84
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
85
85
|
# @return Array for valid properties with the reasons
|
|
86
86
|
def list_invalid_properties
|
|
87
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
88
|
invalid_properties = Array.new
|
|
88
89
|
invalid_properties
|
|
89
90
|
end
|
|
@@ -91,6 +92,7 @@ module ElasticEmail
|
|
|
91
92
|
# Check to see if the all the properties in the model are valid
|
|
92
93
|
# @return true if the model is valid
|
|
93
94
|
def valid?
|
|
95
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
96
|
true
|
|
95
97
|
end
|
|
96
98
|
|
|
@@ -120,37 +122,30 @@ module ElasticEmail
|
|
|
120
122
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
121
123
|
# @return [Object] Returns the model itself
|
|
122
124
|
def self.build_from_hash(attributes)
|
|
123
|
-
new.build_from_hash(attributes)
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
# Builds the object from hash
|
|
127
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
128
|
-
# @return [Object] Returns the model itself
|
|
129
|
-
def build_from_hash(attributes)
|
|
130
125
|
return nil unless attributes.is_a?(Hash)
|
|
131
126
|
attributes = attributes.transform_keys(&:to_sym)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
|
135
131
|
elsif type =~ /\AArray<(.*)>/i
|
|
136
132
|
# check to ensure the input is an array given that the attribute
|
|
137
133
|
# is documented as an array but the input is not
|
|
138
|
-
if attributes[
|
|
139
|
-
|
|
134
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
135
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
140
136
|
end
|
|
141
|
-
elsif !attributes[
|
|
142
|
-
|
|
137
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
138
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
143
139
|
end
|
|
144
140
|
end
|
|
145
|
-
|
|
146
|
-
self
|
|
141
|
+
new(transformed_hash)
|
|
147
142
|
end
|
|
148
143
|
|
|
149
144
|
# Deserializes the data based on type
|
|
150
145
|
# @param string type Data type
|
|
151
146
|
# @param string value Value to be deserialized
|
|
152
147
|
# @return [Object] Deserialized data
|
|
153
|
-
def _deserialize(type, value)
|
|
148
|
+
def self._deserialize(type, value)
|
|
154
149
|
case type.to_sym
|
|
155
150
|
when :Time
|
|
156
151
|
Time.parse(value)
|
|
@@ -185,7 +180,7 @@ module ElasticEmail
|
|
|
185
180
|
else # model
|
|
186
181
|
# models (e.g. Pet) or oneOf
|
|
187
182
|
klass = ElasticEmail.const_get(type)
|
|
188
|
-
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)
|
|
189
184
|
end
|
|
190
185
|
end
|
|
191
186
|
|
|
@@ -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://elasticemail.com/
|
|
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
|
-
|
|
9
|
+
Generator version: 7.7.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,37 +14,23 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module ElasticEmail
|
|
17
|
-
class
|
|
18
|
-
attr_accessor :
|
|
17
|
+
class EmailJobFailedStatus
|
|
18
|
+
attr_accessor :address
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
attr_accessor :event_date
|
|
20
|
+
attr_accessor :error
|
|
22
21
|
|
|
23
|
-
#
|
|
24
|
-
attr_accessor :
|
|
22
|
+
# RFC Error code
|
|
23
|
+
attr_accessor :error_code
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
attr_accessor :template_name
|
|
28
|
-
|
|
29
|
-
# IP Address of the event.
|
|
30
|
-
attr_accessor :ip_address
|
|
31
|
-
|
|
32
|
-
# Country of the event.
|
|
33
|
-
attr_accessor :country
|
|
34
|
-
|
|
35
|
-
# Additional information about the event
|
|
36
|
-
attr_accessor :data
|
|
25
|
+
attr_accessor :category
|
|
37
26
|
|
|
38
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
28
|
def self.attribute_map
|
|
40
29
|
{
|
|
41
|
-
:'
|
|
42
|
-
:'
|
|
43
|
-
:'
|
|
44
|
-
:'
|
|
45
|
-
:'ip_address' => :'IPAddress',
|
|
46
|
-
:'country' => :'Country',
|
|
47
|
-
:'data' => :'Data'
|
|
30
|
+
:'address' => :'Address',
|
|
31
|
+
:'error' => :'Error',
|
|
32
|
+
:'error_code' => :'ErrorCode',
|
|
33
|
+
:'category' => :'Category'
|
|
48
34
|
}
|
|
49
35
|
end
|
|
50
36
|
|
|
@@ -56,13 +42,10 @@ module ElasticEmail
|
|
|
56
42
|
# Attribute type mapping.
|
|
57
43
|
def self.openapi_types
|
|
58
44
|
{
|
|
59
|
-
:'
|
|
60
|
-
:'
|
|
61
|
-
:'
|
|
62
|
-
:'
|
|
63
|
-
:'ip_address' => :'String',
|
|
64
|
-
:'country' => :'String',
|
|
65
|
-
:'data' => :'String'
|
|
45
|
+
:'address' => :'String',
|
|
46
|
+
:'error' => :'String',
|
|
47
|
+
:'error_code' => :'Integer',
|
|
48
|
+
:'category' => :'String'
|
|
66
49
|
}
|
|
67
50
|
end
|
|
68
51
|
|
|
@@ -76,51 +59,38 @@ module ElasticEmail
|
|
|
76
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
77
60
|
def initialize(attributes = {})
|
|
78
61
|
if (!attributes.is_a?(Hash))
|
|
79
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `ElasticEmail::
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ElasticEmail::EmailJobFailedStatus` initialize method"
|
|
80
63
|
end
|
|
81
64
|
|
|
82
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
83
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
84
67
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
85
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `ElasticEmail::
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ElasticEmail::EmailJobFailedStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
86
69
|
end
|
|
87
70
|
h[k.to_sym] = v
|
|
88
71
|
}
|
|
89
72
|
|
|
90
|
-
if attributes.key?(:'
|
|
91
|
-
self.
|
|
92
|
-
else
|
|
93
|
-
self.event_type = 'Opened'
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
if attributes.key?(:'event_date')
|
|
97
|
-
self.event_date = attributes[:'event_date']
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
if attributes.key?(:'channel_name')
|
|
101
|
-
self.channel_name = attributes[:'channel_name']
|
|
73
|
+
if attributes.key?(:'address')
|
|
74
|
+
self.address = attributes[:'address']
|
|
102
75
|
end
|
|
103
76
|
|
|
104
|
-
if attributes.key?(:'
|
|
105
|
-
self.
|
|
77
|
+
if attributes.key?(:'error')
|
|
78
|
+
self.error = attributes[:'error']
|
|
106
79
|
end
|
|
107
80
|
|
|
108
|
-
if attributes.key?(:'
|
|
109
|
-
self.
|
|
81
|
+
if attributes.key?(:'error_code')
|
|
82
|
+
self.error_code = attributes[:'error_code']
|
|
110
83
|
end
|
|
111
84
|
|
|
112
|
-
if attributes.key?(:'
|
|
113
|
-
self.
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
if attributes.key?(:'data')
|
|
117
|
-
self.data = attributes[:'data']
|
|
85
|
+
if attributes.key?(:'category')
|
|
86
|
+
self.category = attributes[:'category']
|
|
118
87
|
end
|
|
119
88
|
end
|
|
120
89
|
|
|
121
90
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
122
91
|
# @return Array for valid properties with the reasons
|
|
123
92
|
def list_invalid_properties
|
|
93
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
124
94
|
invalid_properties = Array.new
|
|
125
95
|
invalid_properties
|
|
126
96
|
end
|
|
@@ -128,6 +98,7 @@ module ElasticEmail
|
|
|
128
98
|
# Check to see if the all the properties in the model are valid
|
|
129
99
|
# @return true if the model is valid
|
|
130
100
|
def valid?
|
|
101
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
131
102
|
true
|
|
132
103
|
end
|
|
133
104
|
|
|
@@ -136,13 +107,10 @@ module ElasticEmail
|
|
|
136
107
|
def ==(o)
|
|
137
108
|
return true if self.equal?(o)
|
|
138
109
|
self.class == o.class &&
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
ip_address == o.ip_address &&
|
|
144
|
-
country == o.country &&
|
|
145
|
-
data == o.data
|
|
110
|
+
address == o.address &&
|
|
111
|
+
error == o.error &&
|
|
112
|
+
error_code == o.error_code &&
|
|
113
|
+
category == o.category
|
|
146
114
|
end
|
|
147
115
|
|
|
148
116
|
# @see the `==` method
|
|
@@ -154,44 +122,37 @@ module ElasticEmail
|
|
|
154
122
|
# Calculates hash code according to all attributes.
|
|
155
123
|
# @return [Integer] Hash code
|
|
156
124
|
def hash
|
|
157
|
-
[
|
|
125
|
+
[address, error, error_code, category].hash
|
|
158
126
|
end
|
|
159
127
|
|
|
160
128
|
# Builds the object from hash
|
|
161
129
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
162
130
|
# @return [Object] Returns the model itself
|
|
163
131
|
def self.build_from_hash(attributes)
|
|
164
|
-
new.build_from_hash(attributes)
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
# Builds the object from hash
|
|
168
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
169
|
-
# @return [Object] Returns the model itself
|
|
170
|
-
def build_from_hash(attributes)
|
|
171
132
|
return nil unless attributes.is_a?(Hash)
|
|
172
133
|
attributes = attributes.transform_keys(&:to_sym)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
134
|
+
transformed_hash = {}
|
|
135
|
+
openapi_types.each_pair do |key, type|
|
|
136
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
137
|
+
transformed_hash["#{key}"] = nil
|
|
176
138
|
elsif type =~ /\AArray<(.*)>/i
|
|
177
139
|
# check to ensure the input is an array given that the attribute
|
|
178
140
|
# is documented as an array but the input is not
|
|
179
|
-
if attributes[
|
|
180
|
-
|
|
141
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
142
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
181
143
|
end
|
|
182
|
-
elsif !attributes[
|
|
183
|
-
|
|
144
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
145
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
184
146
|
end
|
|
185
147
|
end
|
|
186
|
-
|
|
187
|
-
self
|
|
148
|
+
new(transformed_hash)
|
|
188
149
|
end
|
|
189
150
|
|
|
190
151
|
# Deserializes the data based on type
|
|
191
152
|
# @param string type Data type
|
|
192
153
|
# @param string value Value to be deserialized
|
|
193
154
|
# @return [Object] Deserialized data
|
|
194
|
-
def _deserialize(type, value)
|
|
155
|
+
def self._deserialize(type, value)
|
|
195
156
|
case type.to_sym
|
|
196
157
|
when :Time
|
|
197
158
|
Time.parse(value)
|
|
@@ -226,7 +187,7 @@ module ElasticEmail
|
|
|
226
187
|
else # model
|
|
227
188
|
# models (e.g. Pet) or oneOf
|
|
228
189
|
klass = ElasticEmail.const_get(type)
|
|
229
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
190
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
230
191
|
end
|
|
231
192
|
end
|
|
232
193
|
|