mailslurp_client 12.1.1 → 12.1.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26d71dcbba0c71c4f1887b4b310766b50c5960a0f94f2fcd3c99ff7fc717fb93
4
- data.tar.gz: 3ef52e97f70aa606f43040d4f0a96b8b7d37a9d26930e037f717298187ccd667
3
+ metadata.gz: 5f878bf983ebb1864e73ab7693ac90d1a04f8ef4a84698f2bef34752d9d97c5b
4
+ data.tar.gz: ce0ed9bf08a4bf8490cf11e9cbe8f041f3e9595c78a6ad86afe7fbdfc017dba3
5
5
  SHA512:
6
- metadata.gz: 108460f9d2090917d2aa9ae56a1e11519c59e789906bb8b61fd5d4198e85a9673ec5ce7cd6ba7d42e5449be62f0df86ec63abd6cd2cceaf3f84cb839d5512d72
7
- data.tar.gz: 55e1110b31561de24227c60bd694f6f1d0da8f431af3585c58700405866a5aefbfb1cae973b2779bb257b83e598ed3d258aa50a1063c16f0b3ebe52b2a9cad85
6
+ metadata.gz: 3b241ae5a62ce1bcff2d129230d81b83f60449620c762041ef5d6c1ccb474f1f5ac4c4d2a5d4d7c0fe4eb61b7d3d8fc9f8383eef39ed5f782c30bb2532a6a177
7
+ data.tar.gz: 79597481eb7050d4be1858b872252269f6a4ec540a9859196a7af4a60ca86041c0a2d09a376e15cd37674f764d06767ef7deb564de75c54d22dd789e3363e971
@@ -24,6 +24,7 @@ require 'mailslurp_client/models/attachment_meta_data'
24
24
  require 'mailslurp_client/models/attachment_projection'
25
25
  require 'mailslurp_client/models/basic_auth_options'
26
26
  require 'mailslurp_client/models/bulk_send_email_options'
27
+ require 'mailslurp_client/models/condition_option'
27
28
  require 'mailslurp_client/models/contact_dto'
28
29
  require 'mailslurp_client/models/contact_projection'
29
30
  require 'mailslurp_client/models/content_match_options'
@@ -288,7 +288,7 @@ module MailSlurpClient
288
288
  return data, status_code, headers
289
289
  end
290
290
 
291
- # Wait for or return the first email that matches proved MatchOptions array
291
+ # Wait for or return the first email that matches provided MatchOptions array
292
292
  # Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
293
293
  # @param match_options [MatchOptions] matchOptions
294
294
  # @param [Hash] opts the optional parameters
@@ -301,7 +301,7 @@ module MailSlurpClient
301
301
  data
302
302
  end
303
303
 
304
- # Wait for or return the first email that matches proved MatchOptions array
304
+ # Wait for or return the first email that matches provided MatchOptions array
305
305
  # Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
306
306
  # @param match_options [MatchOptions] matchOptions
307
307
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,264 @@
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
+ # Options for matching emails in an inbox based on a condition such as `HAS_ATTACHMENTS=TRUE`
17
+ class ConditionOption
18
+ # The condition to evaluate against the email
19
+ attr_accessor :condition
20
+
21
+ # What the condition should evaluate to. A string 'TRUE|FALSE' not a boolean.
22
+ attr_accessor :value
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'condition' => :'condition',
50
+ :'value' => :'value'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'condition' => :'String',
58
+ :'value' => :'String'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
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 `MailSlurpClient::ConditionOption` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ConditionOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'condition')
84
+ self.condition = attributes[:'condition']
85
+ end
86
+
87
+ if attributes.key?(:'value')
88
+ self.value = attributes[:'value']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ condition_validator = EnumAttributeValidator.new('String', ["HAS_ATTACHMENTS"])
103
+ return false unless condition_validator.valid?(@condition)
104
+ value_validator = EnumAttributeValidator.new('String', ["TRUE", "FALSE"])
105
+ return false unless value_validator.valid?(@value)
106
+ true
107
+ end
108
+
109
+ # Custom attribute writer method checking allowed values (enum).
110
+ # @param [Object] condition Object to be assigned
111
+ def condition=(condition)
112
+ validator = EnumAttributeValidator.new('String', ["HAS_ATTACHMENTS"])
113
+ unless validator.valid?(condition)
114
+ fail ArgumentError, "invalid value for \"condition\", must be one of #{validator.allowable_values}."
115
+ end
116
+ @condition = condition
117
+ end
118
+
119
+ # Custom attribute writer method checking allowed values (enum).
120
+ # @param [Object] value Object to be assigned
121
+ def value=(value)
122
+ validator = EnumAttributeValidator.new('String', ["TRUE", "FALSE"])
123
+ unless validator.valid?(value)
124
+ fail ArgumentError, "invalid value for \"value\", must be one of #{validator.allowable_values}."
125
+ end
126
+ @value = value
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ condition == o.condition &&
135
+ value == o.value
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [condition, value].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ new.build_from_hash(attributes)
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ self.class.openapi_types.each_pair do |key, type|
163
+ if type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
167
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
168
+ end
169
+ elsif !attributes[self.class.attribute_map[key]].nil?
170
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
171
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :DateTime
184
+ DateTime.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ MailSlurpClient.const_get(type).build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.openapi_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+ end
264
+ end
@@ -13,14 +13,18 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController.
16
+ # Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. You can also pass conditions such as `HAS_ATTACHMENT`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController.
17
17
  class MatchOptions
18
- # 1 or more match options. Options are additive so if one does not match the email is excluded from results
18
+ # Zero or more conditions such as `{ condition: 'HAS_ATTACHMENTS', value: 'TRUE' }`. Note the values are the strings `TRUE|FALSE` not booleans.
19
+ attr_accessor :conditions
20
+
21
+ # Zero or more match options such as `{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }`. Options are additive so if one does not match the email is excluded from results
19
22
  attr_accessor :matches
20
23
 
21
24
  # Attribute mapping from ruby-style variable name to JSON key.
22
25
  def self.attribute_map
23
26
  {
27
+ :'conditions' => :'conditions',
24
28
  :'matches' => :'matches'
25
29
  }
26
30
  end
@@ -28,6 +32,7 @@ module MailSlurpClient
28
32
  # Attribute type mapping.
29
33
  def self.openapi_types
30
34
  {
35
+ :'conditions' => :'Array<ConditionOption>',
31
36
  :'matches' => :'Array<MatchOption>'
32
37
  }
33
38
  end
@@ -53,6 +58,12 @@ module MailSlurpClient
53
58
  h[k.to_sym] = v
54
59
  }
55
60
 
61
+ if attributes.key?(:'conditions')
62
+ if (value = attributes[:'conditions']).is_a?(Array)
63
+ self.conditions = value
64
+ end
65
+ end
66
+
56
67
  if attributes.key?(:'matches')
57
68
  if (value = attributes[:'matches']).is_a?(Array)
58
69
  self.matches = value
@@ -78,6 +89,7 @@ module MailSlurpClient
78
89
  def ==(o)
79
90
  return true if self.equal?(o)
80
91
  self.class == o.class &&
92
+ conditions == o.conditions &&
81
93
  matches == o.matches
82
94
  end
83
95
 
@@ -90,7 +102,7 @@ module MailSlurpClient
90
102
  # Calculates hash code according to all attributes.
91
103
  # @return [Integer] Hash code
92
104
  def hash
93
- [matches].hash
105
+ [conditions, matches].hash
94
106
  end
95
107
 
96
108
  # Builds the object from hash
@@ -15,7 +15,7 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # Options for sending an email message from an inbox. You must provide one of: `to`, `toGroup`, or `toContacts` to send an email. All other parameters are optional.
17
17
  class SendEmailOptions
18
- # Optional list of attachment IDs to send with this email. You must first upload each attachment separately in order to obtain attachment IDs. This way you can reuse attachments with different emails once uploaded.
18
+ # Optional list of attachment IDs to send with this email. You must first upload each attachment separately via method call or dashboard in order to obtain attachment IDs. This way you can reuse attachments with different emails once uploaded. There are several ways to upload that support `multi-part form`, `base64 file encoding`, and octet stream binary uploads. See the `UploadController` for available methods.
19
19
  attr_accessor :attachments
20
20
 
21
21
  # Optional list of bcc destination email addresses
@@ -30,10 +30,10 @@ module MailSlurpClient
30
30
  # Optional charset
31
31
  attr_accessor :charset
32
32
 
33
- # Optional from address. Email address is RFC 5322 format and may include a display name and email in angle brackets (`my@address.com` or `My inbox <my@address.com>`). If no sender is set the source inbox address will be used for this field. Beware of potential spam penalties when setting this field to an address not used by the inbox. For custom email addresses use a custom domain.
33
+ # Optional from address. Email address is RFC 5322 format and may include a display name and email in angle brackets (`my@address.com` or `My inbox <my@address.com>`). If no sender is set the source inbox address will be used for this field. If you set `useInboxName` to `true` the from field will include the inbox name as a display name: `inbox_name <inbox@address.com>`. For this to work use the name field when creating an inbox. Beware of potential spam penalties when setting the from field to an address not used by the inbox. Your emails may get blocked by services if you impersonate another address. To use a custom email addresses use a custom domain. You can create domains with the DomainController. The domain must be verified in the dashboard before it can be used.
34
34
  attr_accessor :from
35
35
 
36
- # Optional HTML flag (Deprecated: use isHTML instead)
36
+ # Optional HTML flag to indicate that contents is HTML. Set's a `content-type: text/html` for email. (Deprecated: use `isHTML` instead.)
37
37
  attr_accessor :html
38
38
 
39
39
  # Optional HTML flag. If true the `content-type` of the email will be `text/html`. Set to true when sending HTML to ensure proper rending on email clients
@@ -54,7 +54,7 @@ module MailSlurpClient
54
54
  # Optional map of template variables. Will replace moustache syntax variables in subject and body or template with the associated values if found.
55
55
  attr_accessor :template_variables
56
56
 
57
- # List of destination email addresses. Even single recipients must be in array form. Maximum recipients per email depends on your plan. If you need to send many emails try using contacts or contact groups or use a non standard sendStrategy to ensure that spam filters are not triggered (many recipients in one email can affect your spam rating).
57
+ # List of destination email addresses. Each email address must be RFC 5322 format. Even single recipients must be in array form. Maximum recipients per email depends on your plan. If you need to send many emails try using contacts or contact groups or use a non standard sendStrategy to ensure that spam filters are not triggered (many recipients in one email can affect your spam rating). Be cautious when sending emails that your recipients exist. High bounce rates (meaning a high percentage of emails cannot be delivered because an address does not exist) can result in account freezing.
58
58
  attr_accessor :to
59
59
 
60
60
  # Optional list of contact IDs to send email to. Manage your contacts via the API or dashboard. When contacts are used the email is sent to each contact separately so they will not see other recipients.
@@ -63,7 +63,7 @@ module MailSlurpClient
63
63
  # Optional contact group ID to send email to. You can create contacts and contact groups in the API or dashboard and use them for email campaigns. When contact groups are used the email is sent to each contact separately so they will not see other recipients
64
64
  attr_accessor :to_group
65
65
 
66
- # Use name of inbox as sender email address name. Will construct RFC 5322 email address with `Inbox name <inbox@address.com>`
66
+ # Use name of inbox as sender email address name. Will construct RFC 5322 email address with `Inbox name <inbox@address.com>` if the inbox has a name.
67
67
  attr_accessor :use_inbox_name
68
68
 
69
69
  class EnumAttributeValidator
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Conditions that a `waitForXEmails` endpoint operates on. The methods wait until given conditions are met or a timeout is reached. If the conditions are met without needing to wait the results will be returned immediately.
16
+ # Conditions that a `waitForXEmails` endpoint operates on. The methods wait until given conditions are met or a timeout is reached. If the conditions are met without needing to wait the results will be returned immediately. Can include `unreadOnly` to ignore already read emails that were returned in an API call or viewing in the dashboard. Can also include matches for emails containing `from`, `subject`, `hasAttachments` etc.
17
17
  class WaitForConditions
18
18
  # Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation.
19
19
  attr_accessor :count
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '12.1.1'
14
+ VERSION = '12.1.22'
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailslurp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.1
4
+ version: 12.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-31 00:00:00.000000000 Z
11
+ date: 2021-06-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create emails addresses in Ruby then send and receive real emails and
14
14
  attachments. See https://www.mailslurp.com/docs/ruby/ for full Ruby documentation.
@@ -50,6 +50,7 @@ files:
50
50
  - lib/mailslurp_client/models/attachment_projection.rb
51
51
  - lib/mailslurp_client/models/basic_auth_options.rb
52
52
  - lib/mailslurp_client/models/bulk_send_email_options.rb
53
+ - lib/mailslurp_client/models/condition_option.rb
53
54
  - lib/mailslurp_client/models/contact_dto.rb
54
55
  - lib/mailslurp_client/models/contact_projection.rb
55
56
  - lib/mailslurp_client/models/content_match_options.rb