parlo-sdk 1.0.0 → 1.1.0
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/README.md +6 -1
- data/lib/parlo-sdk/api/domains_api.rb +1 -1
- data/lib/parlo-sdk/api/emails_api.rb +94 -1
- data/lib/parlo-sdk/api_client.rb +1 -1
- data/lib/parlo-sdk/api_error.rb +1 -1
- data/lib/parlo-sdk/api_model_base.rb +1 -1
- data/lib/parlo-sdk/configuration.rb +1 -1
- data/lib/parlo-sdk/models/auth_health.rb +1 -1
- data/lib/parlo-sdk/models/auth_health_dkim.rb +1 -1
- data/lib/parlo-sdk/models/auth_health_dmarc.rb +1 -1
- data/lib/parlo-sdk/models/auth_health_spf.rb +1 -1
- data/lib/parlo-sdk/models/create_domain_request.rb +1 -1
- data/lib/parlo-sdk/models/delete_domain200_response.rb +1 -1
- data/lib/parlo-sdk/models/dns_record.rb +1 -1
- data/lib/parlo-sdk/models/domain.rb +1 -1
- data/lib/parlo-sdk/models/domain_summary.rb +1 -1
- data/lib/parlo-sdk/models/email.rb +106 -7
- data/lib/parlo-sdk/models/email_created.rb +1 -1
- data/lib/parlo-sdk/models/email_list.rb +192 -0
- data/lib/parlo-sdk/models/email_summary.rb +367 -0
- data/lib/parlo-sdk/models/error.rb +1 -1
- data/lib/parlo-sdk/models/list_domains200_response.rb +1 -1
- data/lib/parlo-sdk/models/list_meta.rb +240 -0
- data/lib/parlo-sdk/models/send_email_request.rb +2 -2
- data/lib/parlo-sdk/models/send_email_request_cc.rb +1 -1
- data/lib/parlo-sdk/models/send_email_request_to.rb +1 -1
- data/lib/parlo-sdk/models/webhook_event.rb +268 -0
- data/lib/parlo-sdk/version.rb +2 -2
- data/lib/parlo-sdk.rb +5 -1
- data/spec/models/email_list_spec.rb +42 -0
- data/spec/models/email_summary_spec.rb +88 -0
- data/spec/models/list_meta_spec.rb +60 -0
- data/spec/models/webhook_event_spec.rb +58 -0
- data/spec/spec_helper.rb +1 -1
- metadata +14 -2
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Parlo API
|
|
3
|
+
|
|
4
|
+
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Parlo
|
|
17
|
+
class ListMeta < ApiModelBase
|
|
18
|
+
attr_accessor :current_page
|
|
19
|
+
|
|
20
|
+
attr_accessor :next_page
|
|
21
|
+
|
|
22
|
+
attr_accessor :prev_page
|
|
23
|
+
|
|
24
|
+
attr_accessor :total_pages
|
|
25
|
+
|
|
26
|
+
attr_accessor :total_count
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'current_page' => :'current_page',
|
|
32
|
+
:'next_page' => :'next_page',
|
|
33
|
+
:'prev_page' => :'prev_page',
|
|
34
|
+
:'total_pages' => :'total_pages',
|
|
35
|
+
:'total_count' => :'total_count'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
acceptable_attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'current_page' => :'Integer',
|
|
53
|
+
:'next_page' => :'Integer',
|
|
54
|
+
:'prev_page' => :'Integer',
|
|
55
|
+
:'total_pages' => :'Integer',
|
|
56
|
+
:'total_count' => :'Integer'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
:'next_page',
|
|
64
|
+
:'prev_page',
|
|
65
|
+
])
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Initializes the object
|
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
70
|
+
def initialize(attributes = {})
|
|
71
|
+
if (!attributes.is_a?(Hash))
|
|
72
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Parlo::ListMeta` initialize method"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
76
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
78
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Parlo::ListMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
80
|
+
end
|
|
81
|
+
h[k.to_sym] = v
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'current_page')
|
|
85
|
+
self.current_page = attributes[:'current_page']
|
|
86
|
+
else
|
|
87
|
+
self.current_page = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'next_page')
|
|
91
|
+
self.next_page = attributes[:'next_page']
|
|
92
|
+
else
|
|
93
|
+
self.next_page = nil
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'prev_page')
|
|
97
|
+
self.prev_page = attributes[:'prev_page']
|
|
98
|
+
else
|
|
99
|
+
self.prev_page = nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'total_pages')
|
|
103
|
+
self.total_pages = attributes[:'total_pages']
|
|
104
|
+
else
|
|
105
|
+
self.total_pages = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'total_count')
|
|
109
|
+
self.total_count = attributes[:'total_count']
|
|
110
|
+
else
|
|
111
|
+
self.total_count = nil
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
116
|
+
# @return Array for valid properties with the reasons
|
|
117
|
+
def list_invalid_properties
|
|
118
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
119
|
+
invalid_properties = Array.new
|
|
120
|
+
if @current_page.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "current_page", current_page cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if @total_pages.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if @total_count.nil?
|
|
129
|
+
invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
invalid_properties
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Check to see if the all the properties in the model are valid
|
|
136
|
+
# @return true if the model is valid
|
|
137
|
+
def valid?
|
|
138
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
139
|
+
return false if @current_page.nil?
|
|
140
|
+
return false if @total_pages.nil?
|
|
141
|
+
return false if @total_count.nil?
|
|
142
|
+
true
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] current_page Value to be assigned
|
|
147
|
+
def current_page=(current_page)
|
|
148
|
+
if current_page.nil?
|
|
149
|
+
fail ArgumentError, 'current_page cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@current_page = current_page
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] total_pages Value to be assigned
|
|
157
|
+
def total_pages=(total_pages)
|
|
158
|
+
if total_pages.nil?
|
|
159
|
+
fail ArgumentError, 'total_pages cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
@total_pages = total_pages
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Custom attribute writer method with validation
|
|
166
|
+
# @param [Object] total_count Value to be assigned
|
|
167
|
+
def total_count=(total_count)
|
|
168
|
+
if total_count.nil?
|
|
169
|
+
fail ArgumentError, 'total_count cannot be nil'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
@total_count = total_count
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Checks equality by comparing each attribute.
|
|
176
|
+
# @param [Object] Object to be compared
|
|
177
|
+
def ==(o)
|
|
178
|
+
return true if self.equal?(o)
|
|
179
|
+
self.class == o.class &&
|
|
180
|
+
current_page == o.current_page &&
|
|
181
|
+
next_page == o.next_page &&
|
|
182
|
+
prev_page == o.prev_page &&
|
|
183
|
+
total_pages == o.total_pages &&
|
|
184
|
+
total_count == o.total_count
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# @see the `==` method
|
|
188
|
+
# @param [Object] Object to be compared
|
|
189
|
+
def eql?(o)
|
|
190
|
+
self == o
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Calculates hash code according to all attributes.
|
|
194
|
+
# @return [Integer] Hash code
|
|
195
|
+
def hash
|
|
196
|
+
[current_page, next_page, prev_page, total_pages, total_count].hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Builds the object from hash
|
|
200
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
201
|
+
# @return [Object] Returns the model itself
|
|
202
|
+
def self.build_from_hash(attributes)
|
|
203
|
+
return nil unless attributes.is_a?(Hash)
|
|
204
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
205
|
+
transformed_hash = {}
|
|
206
|
+
openapi_types.each_pair do |key, type|
|
|
207
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
208
|
+
transformed_hash["#{key}"] = nil
|
|
209
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
210
|
+
# check to ensure the input is an array given that the attribute
|
|
211
|
+
# is documented as an array but the input is not
|
|
212
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
213
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
214
|
+
end
|
|
215
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
216
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
new(transformed_hash)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Returns the object in the form of hash
|
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
|
224
|
+
def to_hash
|
|
225
|
+
hash = {}
|
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
227
|
+
value = self.send(attr)
|
|
228
|
+
if value.nil?
|
|
229
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
230
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
hash[param] = _to_hash(value)
|
|
234
|
+
end
|
|
235
|
+
hash
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.24.0-SNAPSHOT
|
|
@@ -37,7 +37,7 @@ module Parlo
|
|
|
37
37
|
# Values substituted into [placeholder] tokens in subject/html/text.
|
|
38
38
|
attr_accessor :data
|
|
39
39
|
|
|
40
|
-
#
|
|
40
|
+
# Key/value labels stored with the message and attached to its delivery events. Filter on them later with `GET /emails?tags[key]=value`. Keys and values accept only ASCII letters, digits, underscores and dashes, up to 256 characters each — this matches the constraint of the underlying delivery provider's message tags. Anything else is rejected with `422 invalid` at send time rather than failing later.
|
|
41
41
|
attr_accessor :tags
|
|
42
42
|
|
|
43
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.24.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.24.0-SNAPSHOT
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Parlo API
|
|
3
|
+
|
|
4
|
+
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Parlo
|
|
17
|
+
# The envelope Parlo POSTs to your configured webhook endpoint.
|
|
18
|
+
class WebhookEvent < ApiModelBase
|
|
19
|
+
# Unique per event and stable across delivery retries — dedupe on it.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
attr_accessor :created_at
|
|
25
|
+
|
|
26
|
+
attr_accessor :data
|
|
27
|
+
|
|
28
|
+
class EnumAttributeValidator
|
|
29
|
+
attr_reader :datatype
|
|
30
|
+
attr_reader :allowable_values
|
|
31
|
+
|
|
32
|
+
def initialize(datatype, allowable_values)
|
|
33
|
+
@allowable_values = allowable_values.map do |value|
|
|
34
|
+
case datatype.to_s
|
|
35
|
+
when /Integer/i
|
|
36
|
+
value.to_i
|
|
37
|
+
when /Float/i
|
|
38
|
+
value.to_f
|
|
39
|
+
else
|
|
40
|
+
value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def valid?(value)
|
|
46
|
+
!value || allowable_values.include?(value)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'id' => :'id',
|
|
54
|
+
:'type' => :'type',
|
|
55
|
+
:'created_at' => :'created_at',
|
|
56
|
+
:'data' => :'data'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns attribute mapping this model knows about
|
|
61
|
+
def self.acceptable_attribute_map
|
|
62
|
+
attribute_map
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns all the JSON keys this model knows about
|
|
66
|
+
def self.acceptable_attributes
|
|
67
|
+
acceptable_attribute_map.values
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Attribute type mapping.
|
|
71
|
+
def self.openapi_types
|
|
72
|
+
{
|
|
73
|
+
:'id' => :'String',
|
|
74
|
+
:'type' => :'String',
|
|
75
|
+
:'created_at' => :'Time',
|
|
76
|
+
:'data' => :'Email'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new([
|
|
83
|
+
])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
def initialize(attributes = {})
|
|
89
|
+
if (!attributes.is_a?(Hash))
|
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Parlo::WebhookEvent` initialize method"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Parlo::WebhookEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
98
|
+
end
|
|
99
|
+
h[k.to_sym] = v
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'id')
|
|
103
|
+
self.id = attributes[:'id']
|
|
104
|
+
else
|
|
105
|
+
self.id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'type')
|
|
109
|
+
self.type = attributes[:'type']
|
|
110
|
+
else
|
|
111
|
+
self.type = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'created_at')
|
|
115
|
+
self.created_at = attributes[:'created_at']
|
|
116
|
+
else
|
|
117
|
+
self.created_at = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'data')
|
|
121
|
+
self.data = attributes[:'data']
|
|
122
|
+
else
|
|
123
|
+
self.data = nil
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
128
|
+
# @return Array for valid properties with the reasons
|
|
129
|
+
def list_invalid_properties
|
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
131
|
+
invalid_properties = Array.new
|
|
132
|
+
if @id.nil?
|
|
133
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @type.nil?
|
|
137
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if @created_at.nil?
|
|
141
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if @data.nil?
|
|
145
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
invalid_properties
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Check to see if the all the properties in the model are valid
|
|
152
|
+
# @return true if the model is valid
|
|
153
|
+
def valid?
|
|
154
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
155
|
+
return false if @id.nil?
|
|
156
|
+
return false if @type.nil?
|
|
157
|
+
type_validator = EnumAttributeValidator.new('String', ["email.delivered", "email.bounced", "email.complained", "email.opened", "email.clicked", "email.failed"])
|
|
158
|
+
return false unless type_validator.valid?(@type)
|
|
159
|
+
return false if @created_at.nil?
|
|
160
|
+
return false if @data.nil?
|
|
161
|
+
true
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Custom attribute writer method with validation
|
|
165
|
+
# @param [Object] id Value to be assigned
|
|
166
|
+
def id=(id)
|
|
167
|
+
if id.nil?
|
|
168
|
+
fail ArgumentError, 'id cannot be nil'
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
@id = id
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
175
|
+
# @param [Object] type Object to be assigned
|
|
176
|
+
def type=(type)
|
|
177
|
+
validator = EnumAttributeValidator.new('String', ["email.delivered", "email.bounced", "email.complained", "email.opened", "email.clicked", "email.failed"])
|
|
178
|
+
unless validator.valid?(type)
|
|
179
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
180
|
+
end
|
|
181
|
+
@type = type
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Custom attribute writer method with validation
|
|
185
|
+
# @param [Object] created_at Value to be assigned
|
|
186
|
+
def created_at=(created_at)
|
|
187
|
+
if created_at.nil?
|
|
188
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
@created_at = created_at
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Custom attribute writer method with validation
|
|
195
|
+
# @param [Object] data Value to be assigned
|
|
196
|
+
def data=(data)
|
|
197
|
+
if data.nil?
|
|
198
|
+
fail ArgumentError, 'data cannot be nil'
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
@data = data
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Checks equality by comparing each attribute.
|
|
205
|
+
# @param [Object] Object to be compared
|
|
206
|
+
def ==(o)
|
|
207
|
+
return true if self.equal?(o)
|
|
208
|
+
self.class == o.class &&
|
|
209
|
+
id == o.id &&
|
|
210
|
+
type == o.type &&
|
|
211
|
+
created_at == o.created_at &&
|
|
212
|
+
data == o.data
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# @see the `==` method
|
|
216
|
+
# @param [Object] Object to be compared
|
|
217
|
+
def eql?(o)
|
|
218
|
+
self == o
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Calculates hash code according to all attributes.
|
|
222
|
+
# @return [Integer] Hash code
|
|
223
|
+
def hash
|
|
224
|
+
[id, type, created_at, data].hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Builds the object from hash
|
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
229
|
+
# @return [Object] Returns the model itself
|
|
230
|
+
def self.build_from_hash(attributes)
|
|
231
|
+
return nil unless attributes.is_a?(Hash)
|
|
232
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
233
|
+
transformed_hash = {}
|
|
234
|
+
openapi_types.each_pair do |key, type|
|
|
235
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
236
|
+
transformed_hash["#{key}"] = nil
|
|
237
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
238
|
+
# check to ensure the input is an array given that the attribute
|
|
239
|
+
# is documented as an array but the input is not
|
|
240
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
241
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
242
|
+
end
|
|
243
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
244
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
new(transformed_hash)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Returns the object in the form of hash
|
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
|
252
|
+
def to_hash
|
|
253
|
+
hash = {}
|
|
254
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
255
|
+
value = self.send(attr)
|
|
256
|
+
if value.nil?
|
|
257
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
258
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
hash[param] = _to_hash(value)
|
|
262
|
+
end
|
|
263
|
+
hash
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
end
|
data/lib/parlo-sdk/version.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.24.0-SNAPSHOT
|
|
@@ -11,5 +11,5 @@ Generator version: 7.24.0-SNAPSHOT
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module Parlo
|
|
14
|
-
VERSION = '1.
|
|
14
|
+
VERSION = '1.1.0'
|
|
15
15
|
end
|
data/lib/parlo-sdk.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.24.0-SNAPSHOT
|
|
@@ -29,11 +29,15 @@ require 'parlo-sdk/models/domain'
|
|
|
29
29
|
require 'parlo-sdk/models/domain_summary'
|
|
30
30
|
require 'parlo-sdk/models/email'
|
|
31
31
|
require 'parlo-sdk/models/email_created'
|
|
32
|
+
require 'parlo-sdk/models/email_list'
|
|
33
|
+
require 'parlo-sdk/models/email_summary'
|
|
32
34
|
require 'parlo-sdk/models/error'
|
|
33
35
|
require 'parlo-sdk/models/list_domains200_response'
|
|
36
|
+
require 'parlo-sdk/models/list_meta'
|
|
34
37
|
require 'parlo-sdk/models/send_email_request'
|
|
35
38
|
require 'parlo-sdk/models/send_email_request_cc'
|
|
36
39
|
require 'parlo-sdk/models/send_email_request_to'
|
|
40
|
+
require 'parlo-sdk/models/webhook_event'
|
|
37
41
|
|
|
38
42
|
# APIs
|
|
39
43
|
require 'parlo-sdk/api/domains_api'
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Parlo API
|
|
3
|
+
|
|
4
|
+
#The Parlo API sends transactional email and manages the sending domains it authenticates from. Marketing campaigns (audiences, templates, broadcasts) are designed and sent from the Parlo dashboard, not this API — the API is transactional-only at launch. All requests authenticate with a company API key as an HTTP bearer token: `Authorization: Bearer parlo_live_xxx`. Errors return a JSON body of the shape `{ \"message\": string, \"code\": string }`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Parlo::EmailList
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Parlo::EmailList do
|
|
21
|
+
#let(:instance) { Parlo::EmailList.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of EmailList' do
|
|
24
|
+
it 'should create an instance of EmailList' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Parlo::EmailList)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "emails"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "meta"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|