mailslurp_client 8.3.1 → 8.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,234 @@
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 AliasVerificationResult
17
+ attr_accessor :alias_id
18
+
19
+ attr_accessor :is_verified
20
+
21
+ attr_accessor :message
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'alias_id' => :'aliasId',
27
+ :'is_verified' => :'isVerified',
28
+ :'message' => :'message'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'alias_id' => :'String',
36
+ :'is_verified' => :'Boolean',
37
+ :'message' => :'String'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::AliasVerificationResult` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::AliasVerificationResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'alias_id')
63
+ self.alias_id = attributes[:'alias_id']
64
+ end
65
+
66
+ if attributes.key?(:'is_verified')
67
+ self.is_verified = attributes[:'is_verified']
68
+ end
69
+
70
+ if attributes.key?(:'message')
71
+ self.message = attributes[:'message']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @alias_id.nil?
80
+ invalid_properties.push('invalid value for "alias_id", alias_id cannot be nil.')
81
+ end
82
+
83
+ if @is_verified.nil?
84
+ invalid_properties.push('invalid value for "is_verified", is_verified cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @alias_id.nil?
94
+ return false if @is_verified.nil?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ alias_id == o.alias_id &&
104
+ is_verified == o.is_verified &&
105
+ message == o.message
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [alias_id, is_verified, message].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ DateTime.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ MailSlurpClient.const_get(type).build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_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
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+ end
234
+ end
@@ -14,18 +14,18 @@ require 'date'
14
14
 
15
15
  module MailSlurpClient
16
16
  # Create email alias options. Email aliases can be used to mask real email addresses behind an ID. You can also attach an inbox to an alias so that any email received by the inbox email address if forwarded to the alias email address.
17
- class CreateOwnedAliasOptions
18
- # Email address to be hidden behind alias
17
+ class CreateAliasOptions
18
+ # Email address to be hidden behind alias. Emails sent to the alias email address will be forwarded to this address. If you want to enable replies set useThreads true and the reply-to for the email will allow outbound communication via a thread.
19
19
  attr_accessor :email_address
20
20
 
21
- # Optional inbox ID to attach to alias. Emails received by this inbox will be forwarded to the alias email address
21
+ # Optional inbox ID to attach to alias. Null by default means an a new inbox will be created for the alias. Use a custom inbox to control what email address the alias uses. To use custom email addresses create a domain and an inbox, the use the inbox ID with this call. Emails received by this inbox will be forwarded to the alias email address
22
22
  attr_accessor :inbox_id
23
23
 
24
24
  # Optional name for alias
25
25
  attr_accessor :name
26
26
 
27
- # Optional proxied flag. When proxied is true alias will forward the incoming emails to the aliased email address via a proxy inbox. A new proxy is created for every new email thread. By replying to the proxy you can correspond with using your email alias without revealing your real email address.
28
- attr_accessor :proxied
27
+ # Enable threads options. If true emails will be sent with a unique reply-to thread address. This means you can reply to the forwarded email and it will be sent to the recipients via your alias address. That way a thread conversation is preserved.
28
+ attr_accessor :use_threads
29
29
 
30
30
  # Attribute mapping from ruby-style variable name to JSON key.
31
31
  def self.attribute_map
@@ -33,7 +33,7 @@ module MailSlurpClient
33
33
  :'email_address' => :'emailAddress',
34
34
  :'inbox_id' => :'inboxId',
35
35
  :'name' => :'name',
36
- :'proxied' => :'proxied'
36
+ :'use_threads' => :'useThreads'
37
37
  }
38
38
  end
39
39
 
@@ -43,7 +43,7 @@ module MailSlurpClient
43
43
  :'email_address' => :'String',
44
44
  :'inbox_id' => :'String',
45
45
  :'name' => :'String',
46
- :'proxied' => :'Boolean'
46
+ :'use_threads' => :'Boolean'
47
47
  }
48
48
  end
49
49
 
@@ -57,13 +57,13 @@ module MailSlurpClient
57
57
  # @param [Hash] attributes Model attributes in the form of hash
58
58
  def initialize(attributes = {})
59
59
  if (!attributes.is_a?(Hash))
60
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateOwnedAliasOptions` initialize method"
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateAliasOptions` initialize method"
61
61
  end
62
62
 
63
63
  # check to see if the attribute exists and convert string to symbol for hash key
64
64
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
65
  if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateOwnedAliasOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateAliasOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
67
  end
68
68
  h[k.to_sym] = v
69
69
  }
@@ -80,8 +80,8 @@ module MailSlurpClient
80
80
  self.name = attributes[:'name']
81
81
  end
82
82
 
83
- if attributes.key?(:'proxied')
84
- self.proxied = attributes[:'proxied']
83
+ if attributes.key?(:'use_threads')
84
+ self.use_threads = attributes[:'use_threads']
85
85
  end
86
86
  end
87
87
 
@@ -106,7 +106,7 @@ module MailSlurpClient
106
106
  email_address == o.email_address &&
107
107
  inbox_id == o.inbox_id &&
108
108
  name == o.name &&
109
- proxied == o.proxied
109
+ use_threads == o.use_threads
110
110
  end
111
111
 
112
112
  # @see the `==` method
@@ -118,7 +118,7 @@ module MailSlurpClient
118
118
  # Calculates hash code according to all attributes.
119
119
  # @return [Integer] Hash code
120
120
  def hash
121
- [email_address, inbox_id, name, proxied].hash
121
+ [email_address, inbox_id, name, use_threads].hash
122
122
  end
123
123
 
124
124
  # Builds the object from hash
@@ -55,6 +55,9 @@ module MailSlurpClient
55
55
  # Has the email been viewed ever
56
56
  attr_accessor :read
57
57
 
58
+ # The replyTo field on the received email
59
+ attr_accessor :reply_to
60
+
58
61
  # The subject line of the email message
59
62
  attr_accessor :subject
60
63
 
@@ -84,6 +87,7 @@ module MailSlurpClient
84
87
  :'inbox_id' => :'inboxId',
85
88
  :'is_html' => :'isHTML',
86
89
  :'read' => :'read',
90
+ :'reply_to' => :'replyTo',
87
91
  :'subject' => :'subject',
88
92
  :'to' => :'to',
89
93
  :'updated_at' => :'updatedAt',
@@ -108,6 +112,7 @@ module MailSlurpClient
108
112
  :'inbox_id' => :'String',
109
113
  :'is_html' => :'Boolean',
110
114
  :'read' => :'Boolean',
115
+ :'reply_to' => :'String',
111
116
  :'subject' => :'String',
112
117
  :'to' => :'Array<String>',
113
118
  :'updated_at' => :'DateTime',
@@ -200,6 +205,10 @@ module MailSlurpClient
200
205
  self.read = attributes[:'read']
201
206
  end
202
207
 
208
+ if attributes.key?(:'reply_to')
209
+ self.reply_to = attributes[:'reply_to']
210
+ end
211
+
203
212
  if attributes.key?(:'subject')
204
213
  self.subject = attributes[:'subject']
205
214
  end
@@ -251,6 +260,7 @@ module MailSlurpClient
251
260
  inbox_id == o.inbox_id &&
252
261
  is_html == o.is_html &&
253
262
  read == o.read &&
263
+ reply_to == o.reply_to &&
254
264
  subject == o.subject &&
255
265
  to == o.to &&
256
266
  updated_at == o.updated_at &&
@@ -266,7 +276,7 @@ module MailSlurpClient
266
276
  # Calculates hash code according to all attributes.
267
277
  # @return [Integer] Hash code
268
278
  def hash
269
- [analysis, attachments, bcc, body, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, subject, to, updated_at, user_id].hash
279
+ [analysis, attachments, bcc, body, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, reply_to, subject, to, updated_at, user_id].hash
270
280
  end
271
281
 
272
282
  # Builds the object from hash
@@ -16,31 +16,34 @@ module MailSlurpClient
16
16
  class ModelAlias
17
17
  attr_accessor :created_at
18
18
 
19
- attr_accessor :email_address
20
-
21
19
  attr_accessor :id
22
20
 
23
21
  attr_accessor :inbox_id
24
22
 
25
23
  attr_accessor :name
26
24
 
27
- attr_accessor :proxied
25
+ attr_accessor :pending_email_address
28
26
 
29
27
  attr_accessor :updated_at
30
28
 
29
+ attr_accessor :use_threads
30
+
31
31
  attr_accessor :user_id
32
32
 
33
+ attr_accessor :verified_email_address
34
+
33
35
  # Attribute mapping from ruby-style variable name to JSON key.
34
36
  def self.attribute_map
35
37
  {
36
38
  :'created_at' => :'createdAt',
37
- :'email_address' => :'emailAddress',
38
39
  :'id' => :'id',
39
40
  :'inbox_id' => :'inboxId',
40
41
  :'name' => :'name',
41
- :'proxied' => :'proxied',
42
+ :'pending_email_address' => :'pendingEmailAddress',
42
43
  :'updated_at' => :'updatedAt',
43
- :'user_id' => :'userId'
44
+ :'use_threads' => :'useThreads',
45
+ :'user_id' => :'userId',
46
+ :'verified_email_address' => :'verifiedEmailAddress'
44
47
  }
45
48
  end
46
49
 
@@ -48,13 +51,14 @@ module MailSlurpClient
48
51
  def self.openapi_types
49
52
  {
50
53
  :'created_at' => :'DateTime',
51
- :'email_address' => :'String',
52
54
  :'id' => :'String',
53
55
  :'inbox_id' => :'String',
54
56
  :'name' => :'String',
55
- :'proxied' => :'Boolean',
57
+ :'pending_email_address' => :'String',
56
58
  :'updated_at' => :'DateTime',
57
- :'user_id' => :'String'
59
+ :'use_threads' => :'Boolean',
60
+ :'user_id' => :'String',
61
+ :'verified_email_address' => :'String'
58
62
  }
59
63
  end
60
64
 
@@ -83,10 +87,6 @@ module MailSlurpClient
83
87
  self.created_at = attributes[:'created_at']
84
88
  end
85
89
 
86
- if attributes.key?(:'email_address')
87
- self.email_address = attributes[:'email_address']
88
- end
89
-
90
90
  if attributes.key?(:'id')
91
91
  self.id = attributes[:'id']
92
92
  end
@@ -99,17 +99,25 @@ module MailSlurpClient
99
99
  self.name = attributes[:'name']
100
100
  end
101
101
 
102
- if attributes.key?(:'proxied')
103
- self.proxied = attributes[:'proxied']
102
+ if attributes.key?(:'pending_email_address')
103
+ self.pending_email_address = attributes[:'pending_email_address']
104
104
  end
105
105
 
106
106
  if attributes.key?(:'updated_at')
107
107
  self.updated_at = attributes[:'updated_at']
108
108
  end
109
109
 
110
+ if attributes.key?(:'use_threads')
111
+ self.use_threads = attributes[:'use_threads']
112
+ end
113
+
110
114
  if attributes.key?(:'user_id')
111
115
  self.user_id = attributes[:'user_id']
112
116
  end
117
+
118
+ if attributes.key?(:'verified_email_address')
119
+ self.verified_email_address = attributes[:'verified_email_address']
120
+ end
113
121
  end
114
122
 
115
123
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -120,14 +128,18 @@ module MailSlurpClient
120
128
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
121
129
  end
122
130
 
123
- if @email_address.nil?
124
- invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
131
+ if @inbox_id.nil?
132
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
125
133
  end
126
134
 
127
135
  if @updated_at.nil?
128
136
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
129
137
  end
130
138
 
139
+ if @user_id.nil?
140
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
141
+ end
142
+
131
143
  invalid_properties
132
144
  end
133
145
 
@@ -135,8 +147,9 @@ module MailSlurpClient
135
147
  # @return true if the model is valid
136
148
  def valid?
137
149
  return false if @created_at.nil?
138
- return false if @email_address.nil?
150
+ return false if @inbox_id.nil?
139
151
  return false if @updated_at.nil?
152
+ return false if @user_id.nil?
140
153
  true
141
154
  end
142
155
 
@@ -146,13 +159,14 @@ module MailSlurpClient
146
159
  return true if self.equal?(o)
147
160
  self.class == o.class &&
148
161
  created_at == o.created_at &&
149
- email_address == o.email_address &&
150
162
  id == o.id &&
151
163
  inbox_id == o.inbox_id &&
152
164
  name == o.name &&
153
- proxied == o.proxied &&
165
+ pending_email_address == o.pending_email_address &&
154
166
  updated_at == o.updated_at &&
155
- user_id == o.user_id
167
+ use_threads == o.use_threads &&
168
+ user_id == o.user_id &&
169
+ verified_email_address == o.verified_email_address
156
170
  end
157
171
 
158
172
  # @see the `==` method
@@ -164,7 +178,7 @@ module MailSlurpClient
164
178
  # Calculates hash code according to all attributes.
165
179
  # @return [Integer] Hash code
166
180
  def hash
167
- [created_at, email_address, id, inbox_id, name, proxied, updated_at, user_id].hash
181
+ [created_at, id, inbox_id, name, pending_email_address, updated_at, use_threads, user_id, verified_email_address].hash
168
182
  end
169
183
 
170
184
  # Builds the object from hash