mailslurp_client 15.18.5 → 15.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/connector_controller_api.rb +260 -0
  3. data/lib/mailslurp_client/api/domain_controller_api.rb +126 -0
  4. data/lib/mailslurp_client/api/email_controller_api.rb +138 -0
  5. data/lib/mailslurp_client/api/imap_controller_api.rb +279 -0
  6. data/lib/mailslurp_client/api/inbox_controller_api.rb +114 -0
  7. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +3 -0
  8. data/lib/mailslurp_client/api/mail_server_controller_api.rb +62 -0
  9. data/lib/mailslurp_client/models/alias_projection.rb +29 -29
  10. data/lib/mailslurp_client/models/attachment_projection.rb +29 -29
  11. data/lib/mailslurp_client/models/bounce_projection.rb +29 -29
  12. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +22 -22
  13. data/lib/mailslurp_client/models/connector_dto.rb +42 -108
  14. data/lib/mailslurp_client/models/connector_imap_connection_dto.rb +311 -0
  15. data/lib/mailslurp_client/models/connector_projection.rb +39 -43
  16. data/lib/mailslurp_client/models/connector_smtp_connection_dto.rb +293 -0
  17. data/lib/mailslurp_client/models/connector_sync_event_projection.rb +15 -15
  18. data/lib/mailslurp_client/models/contact_projection.rb +10 -10
  19. data/lib/mailslurp_client/models/create_connector_imap_connection_options.rb +286 -0
  20. data/lib/mailslurp_client/models/create_connector_options.rb +38 -87
  21. data/lib/mailslurp_client/models/create_connector_smtp_connection_options.rb +256 -0
  22. data/lib/mailslurp_client/models/dns_lookup_options.rb +1 -1
  23. data/lib/mailslurp_client/models/dns_lookups_options.rb +214 -0
  24. data/lib/mailslurp_client/models/domain_group.rb +261 -0
  25. data/lib/mailslurp_client/models/domain_groups_dto.rb +213 -0
  26. data/lib/mailslurp_client/models/domain_information.rb +274 -0
  27. data/lib/mailslurp_client/models/email_preview_urls.rb +18 -4
  28. data/lib/mailslurp_client/models/email_projection.rb +19 -19
  29. data/lib/mailslurp_client/models/email_screenshot_result.rb +211 -0
  30. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  31. data/lib/mailslurp_client/models/get_email_screenshot_options.rb +220 -0
  32. data/lib/mailslurp_client/models/imap_access_details.rb +273 -0
  33. data/lib/mailslurp_client/models/imap_email_projection.rb +239 -0
  34. data/lib/mailslurp_client/models/{create_connector_imap_options.rb → imap_server_fetch_item.rb} +55 -49
  35. data/lib/mailslurp_client/models/imap_server_fetch_result.rb +208 -0
  36. data/lib/mailslurp_client/models/{create_connector_imap_fetch_options.rb → imap_server_list_options.rb} +18 -16
  37. data/lib/mailslurp_client/models/imap_server_list_result.rb +213 -0
  38. data/lib/mailslurp_client/models/imap_server_search_options.rb +318 -0
  39. data/lib/mailslurp_client/models/imap_server_search_result.rb +213 -0
  40. data/lib/mailslurp_client/models/imap_smtp_access_details.rb +16 -1
  41. data/lib/mailslurp_client/models/imap_update_flags_options.rb +277 -0
  42. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +10 -10
  43. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +10 -10
  44. data/lib/mailslurp_client/models/list_unsubscribe_recipient_projection.rb +15 -15
  45. data/lib/mailslurp_client/models/match_option.rb +4 -4
  46. data/lib/mailslurp_client/models/missed_email_projection.rb +14 -14
  47. data/lib/mailslurp_client/models/page_alias.rb +15 -15
  48. data/lib/mailslurp_client/models/page_attachment_entity.rb +15 -15
  49. data/lib/mailslurp_client/models/page_bounced_email.rb +15 -15
  50. data/lib/mailslurp_client/models/page_bounced_recipients.rb +15 -15
  51. data/lib/mailslurp_client/models/page_complaint.rb +15 -15
  52. data/lib/mailslurp_client/models/page_connector.rb +15 -15
  53. data/lib/mailslurp_client/models/page_connector_sync_events.rb +15 -15
  54. data/lib/mailslurp_client/models/page_contact_projection.rb +15 -15
  55. data/lib/mailslurp_client/models/page_delivery_status.rb +15 -15
  56. data/lib/mailslurp_client/models/page_email_preview.rb +15 -15
  57. data/lib/mailslurp_client/models/page_email_projection.rb +15 -15
  58. data/lib/mailslurp_client/models/page_email_validation_request.rb +15 -15
  59. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +15 -15
  60. data/lib/mailslurp_client/models/page_group_projection.rb +15 -15
  61. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +15 -15
  62. data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +15 -15
  63. data/lib/mailslurp_client/models/page_inbox_projection.rb +15 -15
  64. data/lib/mailslurp_client/models/page_inbox_replier_dto.rb +15 -15
  65. data/lib/mailslurp_client/models/page_inbox_replier_events.rb +15 -15
  66. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +15 -15
  67. data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +15 -15
  68. data/lib/mailslurp_client/models/page_missed_email_projection.rb +15 -15
  69. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +15 -15
  70. data/lib/mailslurp_client/models/page_phone_number_projection.rb +15 -15
  71. data/lib/mailslurp_client/models/page_scheduled_jobs.rb +15 -15
  72. data/lib/mailslurp_client/models/page_sent_email_projection.rb +15 -15
  73. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +15 -15
  74. data/lib/mailslurp_client/models/page_sms_projection.rb +15 -15
  75. data/lib/mailslurp_client/models/page_template_projection.rb +15 -15
  76. data/lib/mailslurp_client/models/page_thread_projection.rb +15 -15
  77. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +15 -15
  78. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +15 -15
  79. data/lib/mailslurp_client/models/page_webhook_projection.rb +15 -15
  80. data/lib/mailslurp_client/models/page_webhook_result.rb +15 -15
  81. data/lib/mailslurp_client/models/phone_number_projection.rb +15 -15
  82. data/lib/mailslurp_client/models/sent_email_projection.rb +35 -35
  83. data/lib/mailslurp_client/models/sms_match_option.rb +2 -2
  84. data/lib/mailslurp_client/models/sms_projection.rb +29 -29
  85. data/lib/mailslurp_client/models/smtp_access_details.rb +329 -0
  86. data/lib/mailslurp_client/models/template_projection.rb +17 -17
  87. data/lib/mailslurp_client/models/thread_projection.rb +35 -35
  88. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +15 -15
  89. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +13 -13
  90. data/lib/mailslurp_client/models/webhook_projection.rb +25 -25
  91. data/lib/mailslurp_client/version.rb +1 -1
  92. data/lib/mailslurp_client.rb +21 -2
  93. metadata +23 -4
@@ -13,30 +13,32 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- class CreateConnectorImapFetchOptions
17
- attr_accessor :select_folder
16
+ class ImapServerListOptions
17
+ attr_accessor :uid_set
18
18
 
19
- attr_accessor :search_terms
19
+ attr_accessor :seq_set
20
20
 
21
21
  # Attribute mapping from ruby-style variable name to JSON key.
22
22
  def self.attribute_map
23
23
  {
24
- :'select_folder' => :'selectFolder',
25
- :'search_terms' => :'searchTerms'
24
+ :'uid_set' => :'uidSet',
25
+ :'seq_set' => :'seqSet'
26
26
  }
27
27
  end
28
28
 
29
29
  # Attribute type mapping.
30
30
  def self.openapi_types
31
31
  {
32
- :'select_folder' => :'String',
33
- :'search_terms' => :'String'
32
+ :'uid_set' => :'String',
33
+ :'seq_set' => :'String'
34
34
  }
35
35
  end
36
36
 
37
37
  # List of attributes with nullable: true
38
38
  def self.openapi_nullable
39
39
  Set.new([
40
+ :'uid_set',
41
+ :'seq_set'
40
42
  ])
41
43
  end
42
44
 
@@ -44,23 +46,23 @@ module MailSlurpClient
44
46
  # @param [Hash] attributes Model attributes in the form of hash
45
47
  def initialize(attributes = {})
46
48
  if (!attributes.is_a?(Hash))
47
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateConnectorImapFetchOptions` initialize method"
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ImapServerListOptions` initialize method"
48
50
  end
49
51
 
50
52
  # check to see if the attribute exists and convert string to symbol for hash key
51
53
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
54
  if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateConnectorImapFetchOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ImapServerListOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
56
  end
55
57
  h[k.to_sym] = v
56
58
  }
57
59
 
58
- if attributes.key?(:'select_folder')
59
- self.select_folder = attributes[:'select_folder']
60
+ if attributes.key?(:'uid_set')
61
+ self.uid_set = attributes[:'uid_set']
60
62
  end
61
63
 
62
- if attributes.key?(:'search_terms')
63
- self.search_terms = attributes[:'search_terms']
64
+ if attributes.key?(:'seq_set')
65
+ self.seq_set = attributes[:'seq_set']
64
66
  end
65
67
  end
66
68
 
@@ -82,8 +84,8 @@ module MailSlurpClient
82
84
  def ==(o)
83
85
  return true if self.equal?(o)
84
86
  self.class == o.class &&
85
- select_folder == o.select_folder &&
86
- search_terms == o.search_terms
87
+ uid_set == o.uid_set &&
88
+ seq_set == o.seq_set
87
89
  end
88
90
 
89
91
  # @see the `==` method
@@ -95,7 +97,7 @@ module MailSlurpClient
95
97
  # Calculates hash code according to all attributes.
96
98
  # @return [Integer] Hash code
97
99
  def hash
98
- [select_folder, search_terms].hash
100
+ [uid_set, seq_set].hash
99
101
  end
100
102
 
101
103
  # Builds the object from hash
@@ -0,0 +1,213 @@
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+ Contact: contact@mailslurp.dev
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 ImapServerListResult
17
+ attr_accessor :results
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'results' => :'results'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'results' => :'Array<ImapEmailProjection>'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ImapServerListResult` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ImapServerListResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'results')
55
+ if (value = attributes[:'results']).is_a?(Array)
56
+ self.results = value
57
+ end
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ if @results.nil?
66
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
67
+ end
68
+
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return false if @results.nil?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ results == o.results
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [results].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :Boolean
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ MailSlurpClient.const_get(type).build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ if value.nil?
186
+ is_nullable = self.class.openapi_nullable.include?(attr)
187
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
+ end
189
+
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+ end
213
+ end
@@ -0,0 +1,318 @@
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+ Contact: contact@mailslurp.dev
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
+ # IMAP server search options
17
+ class ImapServerSearchOptions
18
+ attr_accessor :seq_num
19
+
20
+ attr_accessor :uid
21
+
22
+ attr_accessor :since
23
+
24
+ attr_accessor :before
25
+
26
+ attr_accessor :sent_since
27
+
28
+ attr_accessor :sent_before
29
+
30
+ attr_accessor :header
31
+
32
+ attr_accessor :body
33
+
34
+ attr_accessor :text
35
+
36
+ attr_accessor :with_flags
37
+
38
+ attr_accessor :without_flags
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'seq_num' => :'seqNum',
44
+ :'uid' => :'uid',
45
+ :'since' => :'since',
46
+ :'before' => :'before',
47
+ :'sent_since' => :'sentSince',
48
+ :'sent_before' => :'sentBefore',
49
+ :'header' => :'header',
50
+ :'body' => :'body',
51
+ :'text' => :'text',
52
+ :'with_flags' => :'withFlags',
53
+ :'without_flags' => :'withoutFlags'
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'seq_num' => :'String',
61
+ :'uid' => :'String',
62
+ :'since' => :'DateTime',
63
+ :'before' => :'DateTime',
64
+ :'sent_since' => :'DateTime',
65
+ :'sent_before' => :'DateTime',
66
+ :'header' => :'Hash<String, Array<String>>',
67
+ :'body' => :'Array<String>',
68
+ :'text' => :'Array<String>',
69
+ :'with_flags' => :'Array<String>',
70
+ :'without_flags' => :'Array<String>'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ :'seq_num',
78
+ :'uid',
79
+ :'since',
80
+ :'before',
81
+ :'sent_since',
82
+ :'sent_before',
83
+ :'header',
84
+ :'body',
85
+ :'text',
86
+ :'with_flags',
87
+ :'without_flags'
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ImapServerSearchOptions` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ attributes = attributes.each_with_object({}) { |(k, v), h|
100
+ if (!self.class.attribute_map.key?(k.to_sym))
101
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ImapServerSearchOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
102
+ end
103
+ h[k.to_sym] = v
104
+ }
105
+
106
+ if attributes.key?(:'seq_num')
107
+ self.seq_num = attributes[:'seq_num']
108
+ end
109
+
110
+ if attributes.key?(:'uid')
111
+ self.uid = attributes[:'uid']
112
+ end
113
+
114
+ if attributes.key?(:'since')
115
+ self.since = attributes[:'since']
116
+ end
117
+
118
+ if attributes.key?(:'before')
119
+ self.before = attributes[:'before']
120
+ end
121
+
122
+ if attributes.key?(:'sent_since')
123
+ self.sent_since = attributes[:'sent_since']
124
+ end
125
+
126
+ if attributes.key?(:'sent_before')
127
+ self.sent_before = attributes[:'sent_before']
128
+ end
129
+
130
+ if attributes.key?(:'header')
131
+ if (value = attributes[:'header']).is_a?(Hash)
132
+ self.header = value
133
+ end
134
+ end
135
+
136
+ if attributes.key?(:'body')
137
+ if (value = attributes[:'body']).is_a?(Array)
138
+ self.body = value
139
+ end
140
+ end
141
+
142
+ if attributes.key?(:'text')
143
+ if (value = attributes[:'text']).is_a?(Array)
144
+ self.text = value
145
+ end
146
+ end
147
+
148
+ if attributes.key?(:'with_flags')
149
+ if (value = attributes[:'with_flags']).is_a?(Array)
150
+ self.with_flags = value
151
+ end
152
+ end
153
+
154
+ if attributes.key?(:'without_flags')
155
+ if (value = attributes[:'without_flags']).is_a?(Array)
156
+ self.without_flags = value
157
+ end
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ invalid_properties = Array.new
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ true
172
+ end
173
+
174
+ # Checks equality by comparing each attribute.
175
+ # @param [Object] Object to be compared
176
+ def ==(o)
177
+ return true if self.equal?(o)
178
+ self.class == o.class &&
179
+ seq_num == o.seq_num &&
180
+ uid == o.uid &&
181
+ since == o.since &&
182
+ before == o.before &&
183
+ sent_since == o.sent_since &&
184
+ sent_before == o.sent_before &&
185
+ header == o.header &&
186
+ body == o.body &&
187
+ text == o.text &&
188
+ with_flags == o.with_flags &&
189
+ without_flags == o.without_flags
190
+ end
191
+
192
+ # @see the `==` method
193
+ # @param [Object] Object to be compared
194
+ def eql?(o)
195
+ self == o
196
+ end
197
+
198
+ # Calculates hash code according to all attributes.
199
+ # @return [Integer] Hash code
200
+ def hash
201
+ [seq_num, uid, since, before, sent_since, sent_before, header, body, text, with_flags, without_flags].hash
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def self.build_from_hash(attributes)
208
+ new.build_from_hash(attributes)
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+ self.class.openapi_types.each_pair do |key, type|
217
+ if type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
221
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
222
+ end
223
+ elsif !attributes[self.class.attribute_map[key]].nil?
224
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
225
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
226
+ end
227
+
228
+ self
229
+ end
230
+
231
+ # Deserializes the data based on type
232
+ # @param string type Data type
233
+ # @param string value Value to be deserialized
234
+ # @return [Object] Deserialized data
235
+ def _deserialize(type, value)
236
+ case type.to_sym
237
+ when :DateTime
238
+ DateTime.parse(value)
239
+ when :Date
240
+ Date.parse(value)
241
+ when :String
242
+ value.to_s
243
+ when :Integer
244
+ value.to_i
245
+ when :Float
246
+ value.to_f
247
+ when :Boolean
248
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
249
+ true
250
+ else
251
+ false
252
+ end
253
+ when :Object
254
+ # generic object (usually a Hash), return directly
255
+ value
256
+ when /\AArray<(?<inner_type>.+)>\z/
257
+ inner_type = Regexp.last_match[:inner_type]
258
+ value.map { |v| _deserialize(inner_type, v) }
259
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
260
+ k_type = Regexp.last_match[:k_type]
261
+ v_type = Regexp.last_match[:v_type]
262
+ {}.tap do |hash|
263
+ value.each do |k, v|
264
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
265
+ end
266
+ end
267
+ else # model
268
+ MailSlurpClient.const_get(type).build_from_hash(value)
269
+ end
270
+ end
271
+
272
+ # Returns the string representation of the object
273
+ # @return [String] String presentation of the object
274
+ def to_s
275
+ to_hash.to_s
276
+ end
277
+
278
+ # to_body is an alias to to_hash (backward compatibility)
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_body
281
+ to_hash
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ if value.nil?
291
+ is_nullable = self.class.openapi_nullable.include?(attr)
292
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
293
+ end
294
+
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+ end
318
+ end