unsent 1.0.1 → 1.0.2
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/LICENSE.txt +1 -1
- data/README.md +258 -2
- data/lib/unsent/analytics.rb +30 -0
- data/lib/unsent/api_keys.rb +21 -0
- data/lib/unsent/campaigns.rb +4 -0
- data/lib/unsent/client.rb +8 -1
- data/lib/unsent/contact_books.rb +29 -0
- data/lib/unsent/contacts.rb +11 -0
- data/lib/unsent/emails.rb +47 -0
- data/lib/unsent/errors.rb +2 -0
- data/lib/unsent/models/add_suppression_request.rb +223 -0
- data/lib/unsent/models/create_api_key_request.rb +218 -0
- data/lib/unsent/models/create_campaign200_response.rb +750 -0
- data/lib/unsent/models/create_campaign_request.rb +426 -0
- data/lib/unsent/models/create_campaign_request_reply_to.rb +103 -0
- data/lib/unsent/models/create_contact200_response.rb +147 -0
- data/lib/unsent/models/create_contact_book200_response.rb +304 -0
- data/lib/unsent/models/create_contact_book_request.rb +193 -0
- data/lib/unsent/models/create_contact_request.rb +202 -0
- data/lib/unsent/models/create_domain_request.rb +190 -0
- data/lib/unsent/models/create_template200_response.rb +164 -0
- data/lib/unsent/models/create_template_request.rb +226 -0
- data/lib/unsent/models/delete_contact_book200_response.rb +164 -0
- data/lib/unsent/models/get_api_keys200_response_inner.rb +278 -0
- data/lib/unsent/models/get_campaigns200_response_inner.rb +296 -0
- data/lib/unsent/models/get_contact_book200_response.rb +330 -0
- data/lib/unsent/models/get_contact_book200_response_details.rb +218 -0
- data/lib/unsent/models/get_domains200_response_inner.rb +482 -0
- data/lib/unsent/models/get_domains200_response_inner_dns_records_inner.rb +318 -0
- data/lib/unsent/models/get_health200_response.rb +216 -0
- data/lib/unsent/models/get_templates200_response_inner.rb +314 -0
- data/lib/unsent/models/list_emails_domain_id_parameter.rb +103 -0
- data/lib/unsent/models/schedule_campaign_request.rb +185 -0
- data/lib/unsent/models/send_email_request.rb +378 -0
- data/lib/unsent/models/send_email_request_to.rb +103 -0
- data/lib/unsent/models/update_contact_book200_response.rb +190 -0
- data/lib/unsent/models/update_contact_book_request.rb +167 -0
- data/lib/unsent/models/update_contact_request.rb +176 -0
- data/lib/unsent/models/update_template_request.rb +174 -0
- data/lib/unsent/settings.rb +13 -0
- data/lib/unsent/suppressions.rb +28 -0
- data/lib/unsent/templates.rb +29 -0
- data/lib/unsent/version.rb +1 -1
- data/lib/unsent/webhooks.rb +25 -0
- data/lib/unsent.rb +7 -0
- metadata +38 -2
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Unsent API
|
|
3
|
+
|
|
4
|
+
#API for Unsent.dev
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@unsent.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Unsent
|
|
17
|
+
class GetContactBook200ResponseDetails < ApiModelBase
|
|
18
|
+
attr_accessor :total_contacts
|
|
19
|
+
|
|
20
|
+
attr_accessor :unsubscribed_contacts
|
|
21
|
+
|
|
22
|
+
attr_accessor :campaigns
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'total_contacts' => :'totalContacts',
|
|
28
|
+
:'unsubscribed_contacts' => :'unsubscribedContacts',
|
|
29
|
+
:'campaigns' => :'campaigns'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'total_contacts' => :'Float',
|
|
47
|
+
:'unsubscribed_contacts' => :'Float',
|
|
48
|
+
:'campaigns' => :'Array<Object>'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Unsent::GetContactBook200ResponseDetails` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Unsent::GetContactBook200ResponseDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'total_contacts')
|
|
75
|
+
self.total_contacts = attributes[:'total_contacts']
|
|
76
|
+
else
|
|
77
|
+
self.total_contacts = nil
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'unsubscribed_contacts')
|
|
81
|
+
self.unsubscribed_contacts = attributes[:'unsubscribed_contacts']
|
|
82
|
+
else
|
|
83
|
+
self.unsubscribed_contacts = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'campaigns')
|
|
87
|
+
if (value = attributes[:'campaigns']).is_a?(Array)
|
|
88
|
+
self.campaigns = value
|
|
89
|
+
end
|
|
90
|
+
else
|
|
91
|
+
self.campaigns = nil
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
96
|
+
# @return Array for valid properties with the reasons
|
|
97
|
+
def list_invalid_properties
|
|
98
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
|
+
invalid_properties = Array.new
|
|
100
|
+
if @total_contacts.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "total_contacts", total_contacts cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @unsubscribed_contacts.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "unsubscribed_contacts", unsubscribed_contacts cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @campaigns.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "campaigns", campaigns cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
invalid_properties
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Check to see if the all the properties in the model are valid
|
|
116
|
+
# @return true if the model is valid
|
|
117
|
+
def valid?
|
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
+
return false if @total_contacts.nil?
|
|
120
|
+
return false if @unsubscribed_contacts.nil?
|
|
121
|
+
return false if @campaigns.nil?
|
|
122
|
+
true
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Custom attribute writer method with validation
|
|
126
|
+
# @param [Object] total_contacts Value to be assigned
|
|
127
|
+
def total_contacts=(total_contacts)
|
|
128
|
+
if total_contacts.nil?
|
|
129
|
+
fail ArgumentError, 'total_contacts cannot be nil'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
@total_contacts = total_contacts
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method with validation
|
|
136
|
+
# @param [Object] unsubscribed_contacts Value to be assigned
|
|
137
|
+
def unsubscribed_contacts=(unsubscribed_contacts)
|
|
138
|
+
if unsubscribed_contacts.nil?
|
|
139
|
+
fail ArgumentError, 'unsubscribed_contacts cannot be nil'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
@unsubscribed_contacts = unsubscribed_contacts
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] campaigns Value to be assigned
|
|
147
|
+
def campaigns=(campaigns)
|
|
148
|
+
if campaigns.nil?
|
|
149
|
+
fail ArgumentError, 'campaigns cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@campaigns = campaigns
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Checks equality by comparing each attribute.
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def ==(o)
|
|
158
|
+
return true if self.equal?(o)
|
|
159
|
+
self.class == o.class &&
|
|
160
|
+
total_contacts == o.total_contacts &&
|
|
161
|
+
unsubscribed_contacts == o.unsubscribed_contacts &&
|
|
162
|
+
campaigns == o.campaigns
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# @see the `==` method
|
|
166
|
+
# @param [Object] Object to be compared
|
|
167
|
+
def eql?(o)
|
|
168
|
+
self == o
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Calculates hash code according to all attributes.
|
|
172
|
+
# @return [Integer] Hash code
|
|
173
|
+
def hash
|
|
174
|
+
[total_contacts, unsubscribed_contacts, campaigns].hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Builds the object from hash
|
|
178
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
179
|
+
# @return [Object] Returns the model itself
|
|
180
|
+
def self.build_from_hash(attributes)
|
|
181
|
+
return nil unless attributes.is_a?(Hash)
|
|
182
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
183
|
+
transformed_hash = {}
|
|
184
|
+
openapi_types.each_pair do |key, type|
|
|
185
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = nil
|
|
187
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
188
|
+
# check to ensure the input is an array given that the attribute
|
|
189
|
+
# is documented as an array but the input is not
|
|
190
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
191
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
192
|
+
end
|
|
193
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
new(transformed_hash)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the object in the form of hash
|
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
|
202
|
+
def to_hash
|
|
203
|
+
hash = {}
|
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
205
|
+
value = self.send(attr)
|
|
206
|
+
if value.nil?
|
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
hash[param] = _to_hash(value)
|
|
212
|
+
end
|
|
213
|
+
hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Unsent API
|
|
3
|
+
|
|
4
|
+
#API for Unsent.dev
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@unsent.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Unsent
|
|
17
|
+
class GetDomains200ResponseInner < ApiModelBase
|
|
18
|
+
# The ID of the domain
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The name of the domain
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# The ID of the team
|
|
25
|
+
attr_accessor :team_id
|
|
26
|
+
|
|
27
|
+
# The status of the domain
|
|
28
|
+
attr_accessor :status
|
|
29
|
+
|
|
30
|
+
# The region of the domain
|
|
31
|
+
attr_accessor :region
|
|
32
|
+
|
|
33
|
+
# Whether click tracking is enabled
|
|
34
|
+
attr_accessor :click_tracking
|
|
35
|
+
|
|
36
|
+
# Whether open tracking is enabled
|
|
37
|
+
attr_accessor :open_tracking
|
|
38
|
+
|
|
39
|
+
# The public key of the domain
|
|
40
|
+
attr_accessor :public_key
|
|
41
|
+
|
|
42
|
+
# The DKIM status of the domain
|
|
43
|
+
attr_accessor :dkim_status
|
|
44
|
+
|
|
45
|
+
# The SPF details of the domain
|
|
46
|
+
attr_accessor :spf_details
|
|
47
|
+
|
|
48
|
+
# The creation date of the domain
|
|
49
|
+
attr_accessor :created_at
|
|
50
|
+
|
|
51
|
+
# The last update date of the domain
|
|
52
|
+
attr_accessor :updated_at
|
|
53
|
+
|
|
54
|
+
# Whether DMARC is added
|
|
55
|
+
attr_accessor :dmarc_added
|
|
56
|
+
|
|
57
|
+
# Whether the domain is verifying
|
|
58
|
+
attr_accessor :is_verifying
|
|
59
|
+
|
|
60
|
+
# The error message of the domain
|
|
61
|
+
attr_accessor :error_message
|
|
62
|
+
|
|
63
|
+
# The subdomain of the domain
|
|
64
|
+
attr_accessor :subdomain
|
|
65
|
+
|
|
66
|
+
# The verification error of the domain
|
|
67
|
+
attr_accessor :verification_error
|
|
68
|
+
|
|
69
|
+
# The last checked time of the domain
|
|
70
|
+
attr_accessor :last_checked_time
|
|
71
|
+
|
|
72
|
+
# The DNS records of the domain
|
|
73
|
+
attr_accessor :dns_records
|
|
74
|
+
|
|
75
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
76
|
+
def self.attribute_map
|
|
77
|
+
{
|
|
78
|
+
:'id' => :'id',
|
|
79
|
+
:'name' => :'name',
|
|
80
|
+
:'team_id' => :'teamId',
|
|
81
|
+
:'status' => :'status',
|
|
82
|
+
:'region' => :'region',
|
|
83
|
+
:'click_tracking' => :'clickTracking',
|
|
84
|
+
:'open_tracking' => :'openTracking',
|
|
85
|
+
:'public_key' => :'publicKey',
|
|
86
|
+
:'dkim_status' => :'dkimStatus',
|
|
87
|
+
:'spf_details' => :'spfDetails',
|
|
88
|
+
:'created_at' => :'createdAt',
|
|
89
|
+
:'updated_at' => :'updatedAt',
|
|
90
|
+
:'dmarc_added' => :'dmarcAdded',
|
|
91
|
+
:'is_verifying' => :'isVerifying',
|
|
92
|
+
:'error_message' => :'errorMessage',
|
|
93
|
+
:'subdomain' => :'subdomain',
|
|
94
|
+
:'verification_error' => :'verificationError',
|
|
95
|
+
:'last_checked_time' => :'lastCheckedTime',
|
|
96
|
+
:'dns_records' => :'dnsRecords'
|
|
97
|
+
}
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Returns attribute mapping this model knows about
|
|
101
|
+
def self.acceptable_attribute_map
|
|
102
|
+
attribute_map
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Returns all the JSON keys this model knows about
|
|
106
|
+
def self.acceptable_attributes
|
|
107
|
+
acceptable_attribute_map.values
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Attribute type mapping.
|
|
111
|
+
def self.openapi_types
|
|
112
|
+
{
|
|
113
|
+
:'id' => :'String',
|
|
114
|
+
:'name' => :'String',
|
|
115
|
+
:'team_id' => :'String',
|
|
116
|
+
:'status' => :'String',
|
|
117
|
+
:'region' => :'String',
|
|
118
|
+
:'click_tracking' => :'Boolean',
|
|
119
|
+
:'open_tracking' => :'Boolean',
|
|
120
|
+
:'public_key' => :'String',
|
|
121
|
+
:'dkim_status' => :'String',
|
|
122
|
+
:'spf_details' => :'String',
|
|
123
|
+
:'created_at' => :'String',
|
|
124
|
+
:'updated_at' => :'String',
|
|
125
|
+
:'dmarc_added' => :'Boolean',
|
|
126
|
+
:'is_verifying' => :'Boolean',
|
|
127
|
+
:'error_message' => :'String',
|
|
128
|
+
:'subdomain' => :'String',
|
|
129
|
+
:'verification_error' => :'String',
|
|
130
|
+
:'last_checked_time' => :'String',
|
|
131
|
+
:'dns_records' => :'Array<GetDomains200ResponseInnerDnsRecordsInner>'
|
|
132
|
+
}
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# List of attributes with nullable: true
|
|
136
|
+
def self.openapi_nullable
|
|
137
|
+
Set.new([
|
|
138
|
+
:'dkim_status',
|
|
139
|
+
:'spf_details',
|
|
140
|
+
:'error_message',
|
|
141
|
+
:'subdomain',
|
|
142
|
+
:'verification_error',
|
|
143
|
+
:'last_checked_time',
|
|
144
|
+
])
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Initializes the object
|
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
149
|
+
def initialize(attributes = {})
|
|
150
|
+
if (!attributes.is_a?(Hash))
|
|
151
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Unsent::GetDomains200ResponseInner` initialize method"
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
155
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
156
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
157
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
158
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Unsent::GetDomains200ResponseInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
159
|
+
end
|
|
160
|
+
h[k.to_sym] = v
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'id')
|
|
164
|
+
self.id = attributes[:'id']
|
|
165
|
+
else
|
|
166
|
+
self.id = nil
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'name')
|
|
170
|
+
self.name = attributes[:'name']
|
|
171
|
+
else
|
|
172
|
+
self.name = nil
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'team_id')
|
|
176
|
+
self.team_id = attributes[:'team_id']
|
|
177
|
+
else
|
|
178
|
+
self.team_id = nil
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.key?(:'status')
|
|
182
|
+
self.status = attributes[:'status']
|
|
183
|
+
else
|
|
184
|
+
self.status = nil
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'region')
|
|
188
|
+
self.region = attributes[:'region']
|
|
189
|
+
else
|
|
190
|
+
self.region = 'us-east-1'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'click_tracking')
|
|
194
|
+
self.click_tracking = attributes[:'click_tracking']
|
|
195
|
+
else
|
|
196
|
+
self.click_tracking = false
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'open_tracking')
|
|
200
|
+
self.open_tracking = attributes[:'open_tracking']
|
|
201
|
+
else
|
|
202
|
+
self.open_tracking = false
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'public_key')
|
|
206
|
+
self.public_key = attributes[:'public_key']
|
|
207
|
+
else
|
|
208
|
+
self.public_key = nil
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'dkim_status')
|
|
212
|
+
self.dkim_status = attributes[:'dkim_status']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'spf_details')
|
|
216
|
+
self.spf_details = attributes[:'spf_details']
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if attributes.key?(:'created_at')
|
|
220
|
+
self.created_at = attributes[:'created_at']
|
|
221
|
+
else
|
|
222
|
+
self.created_at = nil
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'updated_at')
|
|
226
|
+
self.updated_at = attributes[:'updated_at']
|
|
227
|
+
else
|
|
228
|
+
self.updated_at = nil
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if attributes.key?(:'dmarc_added')
|
|
232
|
+
self.dmarc_added = attributes[:'dmarc_added']
|
|
233
|
+
else
|
|
234
|
+
self.dmarc_added = false
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'is_verifying')
|
|
238
|
+
self.is_verifying = attributes[:'is_verifying']
|
|
239
|
+
else
|
|
240
|
+
self.is_verifying = false
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
if attributes.key?(:'error_message')
|
|
244
|
+
self.error_message = attributes[:'error_message']
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
if attributes.key?(:'subdomain')
|
|
248
|
+
self.subdomain = attributes[:'subdomain']
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
if attributes.key?(:'verification_error')
|
|
252
|
+
self.verification_error = attributes[:'verification_error']
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
if attributes.key?(:'last_checked_time')
|
|
256
|
+
self.last_checked_time = attributes[:'last_checked_time']
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
if attributes.key?(:'dns_records')
|
|
260
|
+
if (value = attributes[:'dns_records']).is_a?(Array)
|
|
261
|
+
self.dns_records = value
|
|
262
|
+
end
|
|
263
|
+
else
|
|
264
|
+
self.dns_records = nil
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
269
|
+
# @return Array for valid properties with the reasons
|
|
270
|
+
def list_invalid_properties
|
|
271
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
272
|
+
invalid_properties = Array.new
|
|
273
|
+
if @id.nil?
|
|
274
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if @name.nil?
|
|
278
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if @team_id.nil?
|
|
282
|
+
invalid_properties.push('invalid value for "team_id", team_id cannot be nil.')
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
if @status.nil?
|
|
286
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
if @public_key.nil?
|
|
290
|
+
invalid_properties.push('invalid value for "public_key", public_key cannot be nil.')
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
if @created_at.nil?
|
|
294
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
if @updated_at.nil?
|
|
298
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
if @dns_records.nil?
|
|
302
|
+
invalid_properties.push('invalid value for "dns_records", dns_records cannot be nil.')
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
invalid_properties
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Check to see if the all the properties in the model are valid
|
|
309
|
+
# @return true if the model is valid
|
|
310
|
+
def valid?
|
|
311
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
312
|
+
return false if @id.nil?
|
|
313
|
+
return false if @name.nil?
|
|
314
|
+
return false if @team_id.nil?
|
|
315
|
+
return false if @status.nil?
|
|
316
|
+
return false if @public_key.nil?
|
|
317
|
+
return false if @created_at.nil?
|
|
318
|
+
return false if @updated_at.nil?
|
|
319
|
+
return false if @dns_records.nil?
|
|
320
|
+
true
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Custom attribute writer method with validation
|
|
324
|
+
# @param [Object] id Value to be assigned
|
|
325
|
+
def id=(id)
|
|
326
|
+
if id.nil?
|
|
327
|
+
fail ArgumentError, 'id cannot be nil'
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
@id = id
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Custom attribute writer method with validation
|
|
334
|
+
# @param [Object] name Value to be assigned
|
|
335
|
+
def name=(name)
|
|
336
|
+
if name.nil?
|
|
337
|
+
fail ArgumentError, 'name cannot be nil'
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
@name = name
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Custom attribute writer method with validation
|
|
344
|
+
# @param [Object] team_id Value to be assigned
|
|
345
|
+
def team_id=(team_id)
|
|
346
|
+
if team_id.nil?
|
|
347
|
+
fail ArgumentError, 'team_id cannot be nil'
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
@team_id = team_id
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
# Custom attribute writer method with validation
|
|
354
|
+
# @param [Object] status Value to be assigned
|
|
355
|
+
def status=(status)
|
|
356
|
+
if status.nil?
|
|
357
|
+
fail ArgumentError, 'status cannot be nil'
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
@status = status
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# Custom attribute writer method with validation
|
|
364
|
+
# @param [Object] public_key Value to be assigned
|
|
365
|
+
def public_key=(public_key)
|
|
366
|
+
if public_key.nil?
|
|
367
|
+
fail ArgumentError, 'public_key cannot be nil'
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
@public_key = public_key
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
# Custom attribute writer method with validation
|
|
374
|
+
# @param [Object] created_at Value to be assigned
|
|
375
|
+
def created_at=(created_at)
|
|
376
|
+
if created_at.nil?
|
|
377
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
@created_at = created_at
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# Custom attribute writer method with validation
|
|
384
|
+
# @param [Object] updated_at Value to be assigned
|
|
385
|
+
def updated_at=(updated_at)
|
|
386
|
+
if updated_at.nil?
|
|
387
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
@updated_at = updated_at
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Custom attribute writer method with validation
|
|
394
|
+
# @param [Object] dns_records Value to be assigned
|
|
395
|
+
def dns_records=(dns_records)
|
|
396
|
+
if dns_records.nil?
|
|
397
|
+
fail ArgumentError, 'dns_records cannot be nil'
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
@dns_records = dns_records
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# Checks equality by comparing each attribute.
|
|
404
|
+
# @param [Object] Object to be compared
|
|
405
|
+
def ==(o)
|
|
406
|
+
return true if self.equal?(o)
|
|
407
|
+
self.class == o.class &&
|
|
408
|
+
id == o.id &&
|
|
409
|
+
name == o.name &&
|
|
410
|
+
team_id == o.team_id &&
|
|
411
|
+
status == o.status &&
|
|
412
|
+
region == o.region &&
|
|
413
|
+
click_tracking == o.click_tracking &&
|
|
414
|
+
open_tracking == o.open_tracking &&
|
|
415
|
+
public_key == o.public_key &&
|
|
416
|
+
dkim_status == o.dkim_status &&
|
|
417
|
+
spf_details == o.spf_details &&
|
|
418
|
+
created_at == o.created_at &&
|
|
419
|
+
updated_at == o.updated_at &&
|
|
420
|
+
dmarc_added == o.dmarc_added &&
|
|
421
|
+
is_verifying == o.is_verifying &&
|
|
422
|
+
error_message == o.error_message &&
|
|
423
|
+
subdomain == o.subdomain &&
|
|
424
|
+
verification_error == o.verification_error &&
|
|
425
|
+
last_checked_time == o.last_checked_time &&
|
|
426
|
+
dns_records == o.dns_records
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# @see the `==` method
|
|
430
|
+
# @param [Object] Object to be compared
|
|
431
|
+
def eql?(o)
|
|
432
|
+
self == o
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
# Calculates hash code according to all attributes.
|
|
436
|
+
# @return [Integer] Hash code
|
|
437
|
+
def hash
|
|
438
|
+
[id, name, team_id, status, region, click_tracking, open_tracking, public_key, dkim_status, spf_details, created_at, updated_at, dmarc_added, is_verifying, error_message, subdomain, verification_error, last_checked_time, dns_records].hash
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
# Builds the object from hash
|
|
442
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
443
|
+
# @return [Object] Returns the model itself
|
|
444
|
+
def self.build_from_hash(attributes)
|
|
445
|
+
return nil unless attributes.is_a?(Hash)
|
|
446
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
447
|
+
transformed_hash = {}
|
|
448
|
+
openapi_types.each_pair do |key, type|
|
|
449
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
450
|
+
transformed_hash["#{key}"] = nil
|
|
451
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
452
|
+
# check to ensure the input is an array given that the attribute
|
|
453
|
+
# is documented as an array but the input is not
|
|
454
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
455
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
456
|
+
end
|
|
457
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
458
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
459
|
+
end
|
|
460
|
+
end
|
|
461
|
+
new(transformed_hash)
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
# Returns the object in the form of hash
|
|
465
|
+
# @return [Hash] Returns the object in the form of hash
|
|
466
|
+
def to_hash
|
|
467
|
+
hash = {}
|
|
468
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
469
|
+
value = self.send(attr)
|
|
470
|
+
if value.nil?
|
|
471
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
472
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
hash[param] = _to_hash(value)
|
|
476
|
+
end
|
|
477
|
+
hash
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
end
|