mailslurp_client 12.5.0 → 12.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailslurp_client.rb +9 -2
- data/lib/mailslurp_client/api/contact_controller_api.rb +4 -4
- data/lib/mailslurp_client/api/email_controller_api.rb +64 -0
- data/lib/mailslurp_client/api/group_controller_api.rb +4 -4
- data/lib/mailslurp_client/api/inbox_controller_api.rb +11 -8
- data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +211 -3
- data/lib/mailslurp_client/api/missed_email_controller_api.rb +81 -7
- data/lib/mailslurp_client/api/template_controller_api.rb +4 -4
- data/lib/mailslurp_client/api/tracking_controller_api.rb +215 -0
- data/lib/mailslurp_client/api/wait_for_controller_api.rb +2 -2
- data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +4 -4
- data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +215 -0
- data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +17 -3
- data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +211 -0
- data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +223 -0
- data/lib/mailslurp_client/models/{page_inbox_ruleset_projection.rb → page_inbox_ruleset_dto.rb} +4 -4
- data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +299 -0
- data/lib/mailslurp_client/models/send_email_options.rb +11 -1
- data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
- data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +225 -0
- data/lib/mailslurp_client/models/{inbox_ruleset_projection.rb → tracking_pixel_dto.rb} +37 -115
- data/lib/mailslurp_client/models/tracking_pixel_projection.rb +262 -0
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +11 -4
@@ -13,63 +13,36 @@ OpenAPI Generator version: 4.3.1
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module MailSlurpClient
|
16
|
-
|
17
|
-
|
18
|
-
attr_accessor :action
|
19
|
-
|
20
|
-
attr_accessor :handler
|
16
|
+
class TrackingPixelDto
|
17
|
+
attr_accessor :html
|
21
18
|
|
22
19
|
attr_accessor :id
|
23
20
|
|
24
|
-
attr_accessor :
|
25
|
-
|
26
|
-
attr_accessor :scope
|
27
|
-
|
28
|
-
attr_accessor :target
|
21
|
+
attr_accessor :recipient
|
29
22
|
|
30
|
-
|
31
|
-
attr_reader :datatype
|
32
|
-
attr_reader :allowable_values
|
33
|
-
|
34
|
-
def initialize(datatype, allowable_values)
|
35
|
-
@allowable_values = allowable_values.map do |value|
|
36
|
-
case datatype.to_s
|
37
|
-
when /Integer/i
|
38
|
-
value.to_i
|
39
|
-
when /Float/i
|
40
|
-
value.to_f
|
41
|
-
else
|
42
|
-
value
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
23
|
+
attr_accessor :seen
|
46
24
|
|
47
|
-
|
48
|
-
!value || allowable_values.include?(value)
|
49
|
-
end
|
50
|
-
end
|
25
|
+
attr_accessor :url
|
51
26
|
|
52
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
53
28
|
def self.attribute_map
|
54
29
|
{
|
55
|
-
:'
|
56
|
-
:'handler' => :'handler',
|
30
|
+
:'html' => :'html',
|
57
31
|
:'id' => :'id',
|
58
|
-
:'
|
59
|
-
:'
|
60
|
-
:'
|
32
|
+
:'recipient' => :'recipient',
|
33
|
+
:'seen' => :'seen',
|
34
|
+
:'url' => :'url'
|
61
35
|
}
|
62
36
|
end
|
63
37
|
|
64
38
|
# Attribute type mapping.
|
65
39
|
def self.openapi_types
|
66
40
|
{
|
67
|
-
:'
|
68
|
-
:'handler' => :'String',
|
41
|
+
:'html' => :'String',
|
69
42
|
:'id' => :'String',
|
70
|
-
:'
|
71
|
-
:'
|
72
|
-
:'
|
43
|
+
:'recipient' => :'String',
|
44
|
+
:'seen' => :'Boolean',
|
45
|
+
:'url' => :'String'
|
73
46
|
}
|
74
47
|
end
|
75
48
|
|
@@ -83,39 +56,35 @@ module MailSlurpClient
|
|
83
56
|
# @param [Hash] attributes Model attributes in the form of hash
|
84
57
|
def initialize(attributes = {})
|
85
58
|
if (!attributes.is_a?(Hash))
|
86
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::TrackingPixelDto` initialize method"
|
87
60
|
end
|
88
61
|
|
89
62
|
# check to see if the attribute exists and convert string to symbol for hash key
|
90
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
64
|
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::TrackingPixelDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
66
|
end
|
94
67
|
h[k.to_sym] = v
|
95
68
|
}
|
96
69
|
|
97
|
-
if attributes.key?(:'
|
98
|
-
self.
|
99
|
-
end
|
100
|
-
|
101
|
-
if attributes.key?(:'handler')
|
102
|
-
self.handler = attributes[:'handler']
|
70
|
+
if attributes.key?(:'html')
|
71
|
+
self.html = attributes[:'html']
|
103
72
|
end
|
104
73
|
|
105
74
|
if attributes.key?(:'id')
|
106
75
|
self.id = attributes[:'id']
|
107
76
|
end
|
108
77
|
|
109
|
-
if attributes.key?(:'
|
110
|
-
self.
|
78
|
+
if attributes.key?(:'recipient')
|
79
|
+
self.recipient = attributes[:'recipient']
|
111
80
|
end
|
112
81
|
|
113
|
-
if attributes.key?(:'
|
114
|
-
self.
|
82
|
+
if attributes.key?(:'seen')
|
83
|
+
self.seen = attributes[:'seen']
|
115
84
|
end
|
116
85
|
|
117
|
-
if attributes.key?(:'
|
118
|
-
self.
|
86
|
+
if attributes.key?(:'url')
|
87
|
+
self.url = attributes[:'url']
|
119
88
|
end
|
120
89
|
end
|
121
90
|
|
@@ -123,28 +92,20 @@ module MailSlurpClient
|
|
123
92
|
# @return Array for valid properties with the reasons
|
124
93
|
def list_invalid_properties
|
125
94
|
invalid_properties = Array.new
|
126
|
-
if @
|
127
|
-
invalid_properties.push('invalid value for "
|
128
|
-
end
|
129
|
-
|
130
|
-
if @handler.nil?
|
131
|
-
invalid_properties.push('invalid value for "handler", handler cannot be nil.')
|
95
|
+
if @html.nil?
|
96
|
+
invalid_properties.push('invalid value for "html", html cannot be nil.')
|
132
97
|
end
|
133
98
|
|
134
99
|
if @id.nil?
|
135
100
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
136
101
|
end
|
137
102
|
|
138
|
-
if @
|
139
|
-
invalid_properties.push('invalid value for "
|
140
|
-
end
|
141
|
-
|
142
|
-
if @scope.nil?
|
143
|
-
invalid_properties.push('invalid value for "scope", scope cannot be nil.')
|
103
|
+
if @seen.nil?
|
104
|
+
invalid_properties.push('invalid value for "seen", seen cannot be nil.')
|
144
105
|
end
|
145
106
|
|
146
|
-
if @
|
147
|
-
invalid_properties.push('invalid value for "
|
107
|
+
if @url.nil?
|
108
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
148
109
|
end
|
149
110
|
|
150
111
|
invalid_properties
|
@@ -153,62 +114,23 @@ module MailSlurpClient
|
|
153
114
|
# Check to see if the all the properties in the model are valid
|
154
115
|
# @return true if the model is valid
|
155
116
|
def valid?
|
156
|
-
return false if @
|
157
|
-
action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
|
158
|
-
return false unless action_validator.valid?(@action)
|
159
|
-
return false if @handler.nil?
|
160
|
-
handler_validator = EnumAttributeValidator.new('String', ["EXCEPTION"])
|
161
|
-
return false unless handler_validator.valid?(@handler)
|
117
|
+
return false if @html.nil?
|
162
118
|
return false if @id.nil?
|
163
|
-
return false if @
|
164
|
-
return false if @
|
165
|
-
scope_validator = EnumAttributeValidator.new('String', ["RECEIVING_EMAILS", "SENDING_EMAILS"])
|
166
|
-
return false unless scope_validator.valid?(@scope)
|
167
|
-
return false if @target.nil?
|
119
|
+
return false if @seen.nil?
|
120
|
+
return false if @url.nil?
|
168
121
|
true
|
169
122
|
end
|
170
123
|
|
171
|
-
# Custom attribute writer method checking allowed values (enum).
|
172
|
-
# @param [Object] action Object to be assigned
|
173
|
-
def action=(action)
|
174
|
-
validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
|
175
|
-
unless validator.valid?(action)
|
176
|
-
fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
|
177
|
-
end
|
178
|
-
@action = action
|
179
|
-
end
|
180
|
-
|
181
|
-
# Custom attribute writer method checking allowed values (enum).
|
182
|
-
# @param [Object] handler Object to be assigned
|
183
|
-
def handler=(handler)
|
184
|
-
validator = EnumAttributeValidator.new('String', ["EXCEPTION"])
|
185
|
-
unless validator.valid?(handler)
|
186
|
-
fail ArgumentError, "invalid value for \"handler\", must be one of #{validator.allowable_values}."
|
187
|
-
end
|
188
|
-
@handler = handler
|
189
|
-
end
|
190
|
-
|
191
|
-
# Custom attribute writer method checking allowed values (enum).
|
192
|
-
# @param [Object] scope Object to be assigned
|
193
|
-
def scope=(scope)
|
194
|
-
validator = EnumAttributeValidator.new('String', ["RECEIVING_EMAILS", "SENDING_EMAILS"])
|
195
|
-
unless validator.valid?(scope)
|
196
|
-
fail ArgumentError, "invalid value for \"scope\", must be one of #{validator.allowable_values}."
|
197
|
-
end
|
198
|
-
@scope = scope
|
199
|
-
end
|
200
|
-
|
201
124
|
# Checks equality by comparing each attribute.
|
202
125
|
# @param [Object] Object to be compared
|
203
126
|
def ==(o)
|
204
127
|
return true if self.equal?(o)
|
205
128
|
self.class == o.class &&
|
206
|
-
|
207
|
-
handler == o.handler &&
|
129
|
+
html == o.html &&
|
208
130
|
id == o.id &&
|
209
|
-
|
210
|
-
|
211
|
-
|
131
|
+
recipient == o.recipient &&
|
132
|
+
seen == o.seen &&
|
133
|
+
url == o.url
|
212
134
|
end
|
213
135
|
|
214
136
|
# @see the `==` method
|
@@ -220,7 +142,7 @@ module MailSlurpClient
|
|
220
142
|
# Calculates hash code according to all attributes.
|
221
143
|
# @return [Integer] Hash code
|
222
144
|
def hash
|
223
|
-
[
|
145
|
+
[html, id, recipient, seen, url].hash
|
224
146
|
end
|
225
147
|
|
226
148
|
# Builds the object from hash
|
@@ -0,0 +1,262 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
class TrackingPixelProjection
|
17
|
+
attr_accessor :created_at
|
18
|
+
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
attr_accessor :name
|
22
|
+
|
23
|
+
attr_accessor :seen
|
24
|
+
|
25
|
+
attr_accessor :user_id
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'created_at' => :'createdAt',
|
31
|
+
:'id' => :'id',
|
32
|
+
:'name' => :'name',
|
33
|
+
:'seen' => :'seen',
|
34
|
+
:'user_id' => :'userId'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'created_at' => :'DateTime',
|
42
|
+
:'id' => :'String',
|
43
|
+
:'name' => :'String',
|
44
|
+
:'seen' => :'Boolean',
|
45
|
+
:'user_id' => :'String'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# List of attributes with nullable: true
|
50
|
+
def self.openapi_nullable
|
51
|
+
Set.new([
|
52
|
+
])
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
if (!attributes.is_a?(Hash))
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::TrackingPixelProjection` initialize method"
|
60
|
+
end
|
61
|
+
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
64
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::TrackingPixelProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
|
+
end
|
67
|
+
h[k.to_sym] = v
|
68
|
+
}
|
69
|
+
|
70
|
+
if attributes.key?(:'created_at')
|
71
|
+
self.created_at = attributes[:'created_at']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'id')
|
75
|
+
self.id = attributes[:'id']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'name')
|
79
|
+
self.name = attributes[:'name']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'seen')
|
83
|
+
self.seen = attributes[:'seen']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'user_id')
|
87
|
+
self.user_id = attributes[:'user_id']
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
92
|
+
# @return Array for valid properties with the reasons
|
93
|
+
def list_invalid_properties
|
94
|
+
invalid_properties = Array.new
|
95
|
+
if @created_at.nil?
|
96
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
97
|
+
end
|
98
|
+
|
99
|
+
if @id.nil?
|
100
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
101
|
+
end
|
102
|
+
|
103
|
+
if @seen.nil?
|
104
|
+
invalid_properties.push('invalid value for "seen", seen cannot be nil.')
|
105
|
+
end
|
106
|
+
|
107
|
+
if @user_id.nil?
|
108
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
109
|
+
end
|
110
|
+
|
111
|
+
invalid_properties
|
112
|
+
end
|
113
|
+
|
114
|
+
# Check to see if the all the properties in the model are valid
|
115
|
+
# @return true if the model is valid
|
116
|
+
def valid?
|
117
|
+
return false if @created_at.nil?
|
118
|
+
return false if @id.nil?
|
119
|
+
return false if @seen.nil?
|
120
|
+
return false if @user_id.nil?
|
121
|
+
true
|
122
|
+
end
|
123
|
+
|
124
|
+
# Checks equality by comparing each attribute.
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def ==(o)
|
127
|
+
return true if self.equal?(o)
|
128
|
+
self.class == o.class &&
|
129
|
+
created_at == o.created_at &&
|
130
|
+
id == o.id &&
|
131
|
+
name == o.name &&
|
132
|
+
seen == o.seen &&
|
133
|
+
user_id == o.user_id
|
134
|
+
end
|
135
|
+
|
136
|
+
# @see the `==` method
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def eql?(o)
|
139
|
+
self == o
|
140
|
+
end
|
141
|
+
|
142
|
+
# Calculates hash code according to all attributes.
|
143
|
+
# @return [Integer] Hash code
|
144
|
+
def hash
|
145
|
+
[created_at, id, name, seen, user_id].hash
|
146
|
+
end
|
147
|
+
|
148
|
+
# Builds the object from hash
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
150
|
+
# @return [Object] Returns the model itself
|
151
|
+
def self.build_from_hash(attributes)
|
152
|
+
new.build_from_hash(attributes)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def build_from_hash(attributes)
|
159
|
+
return nil unless attributes.is_a?(Hash)
|
160
|
+
self.class.openapi_types.each_pair do |key, type|
|
161
|
+
if type =~ /\AArray<(.*)>/i
|
162
|
+
# check to ensure the input is an array given that the attribute
|
163
|
+
# is documented as an array but the input is not
|
164
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
165
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
166
|
+
end
|
167
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
168
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
169
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
170
|
+
end
|
171
|
+
|
172
|
+
self
|
173
|
+
end
|
174
|
+
|
175
|
+
# Deserializes the data based on type
|
176
|
+
# @param string type Data type
|
177
|
+
# @param string value Value to be deserialized
|
178
|
+
# @return [Object] Deserialized data
|
179
|
+
def _deserialize(type, value)
|
180
|
+
case type.to_sym
|
181
|
+
when :DateTime
|
182
|
+
DateTime.parse(value)
|
183
|
+
when :Date
|
184
|
+
Date.parse(value)
|
185
|
+
when :String
|
186
|
+
value.to_s
|
187
|
+
when :Integer
|
188
|
+
value.to_i
|
189
|
+
when :Float
|
190
|
+
value.to_f
|
191
|
+
when :Boolean
|
192
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
193
|
+
true
|
194
|
+
else
|
195
|
+
false
|
196
|
+
end
|
197
|
+
when :Object
|
198
|
+
# generic object (usually a Hash), return directly
|
199
|
+
value
|
200
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
201
|
+
inner_type = Regexp.last_match[:inner_type]
|
202
|
+
value.map { |v| _deserialize(inner_type, v) }
|
203
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
204
|
+
k_type = Regexp.last_match[:k_type]
|
205
|
+
v_type = Regexp.last_match[:v_type]
|
206
|
+
{}.tap do |hash|
|
207
|
+
value.each do |k, v|
|
208
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
else # model
|
212
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the string representation of the object
|
217
|
+
# @return [String] String presentation of the object
|
218
|
+
def to_s
|
219
|
+
to_hash.to_s
|
220
|
+
end
|
221
|
+
|
222
|
+
# to_body is an alias to to_hash (backward compatibility)
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_body
|
225
|
+
to_hash
|
226
|
+
end
|
227
|
+
|
228
|
+
# Returns the object in the form of hash
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
230
|
+
def to_hash
|
231
|
+
hash = {}
|
232
|
+
self.class.attribute_map.each_pair do |attr, param|
|
233
|
+
value = self.send(attr)
|
234
|
+
if value.nil?
|
235
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
236
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
237
|
+
end
|
238
|
+
|
239
|
+
hash[param] = _to_hash(value)
|
240
|
+
end
|
241
|
+
hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Outputs non-array value in the form of hash
|
245
|
+
# For object, use to_hash. Otherwise, just return the value
|
246
|
+
# @param [Object] value Any valid value
|
247
|
+
# @return [Hash] Returns the value in the form of hash
|
248
|
+
def _to_hash(value)
|
249
|
+
if value.is_a?(Array)
|
250
|
+
value.compact.map { |v| _to_hash(v) }
|
251
|
+
elsif value.is_a?(Hash)
|
252
|
+
{}.tap do |hash|
|
253
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
254
|
+
end
|
255
|
+
elsif value.respond_to? :to_hash
|
256
|
+
value.to_hash
|
257
|
+
else
|
258
|
+
value
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|