mailslurp_client 16.1.3 → 16.1.5

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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/ai_controller_api.rb +813 -6
  3. data/lib/mailslurp_client/models/ai_tranform_create_options.rb +237 -0
  4. data/lib/mailslurp_client/models/ai_transform_dto.rb +251 -0
  5. data/lib/mailslurp_client/models/ai_transform_mapping_dto.rb +310 -0
  6. data/lib/mailslurp_client/models/ai_transform_mapping_projection.rb +352 -0
  7. data/lib/mailslurp_client/models/ai_transform_projection.rb +251 -0
  8. data/lib/mailslurp_client/models/ai_transform_result_dto.rb +353 -0
  9. data/lib/mailslurp_client/models/ai_transform_result_projection.rb +324 -0
  10. data/lib/mailslurp_client/models/alias_projection.rb +15 -15
  11. data/lib/mailslurp_client/models/alias_thread_projection.rb +16 -16
  12. data/lib/mailslurp_client/models/attachment_projection.rb +10 -10
  13. data/lib/mailslurp_client/models/connector_projection.rb +15 -15
  14. data/lib/mailslurp_client/models/create_ai_transformer_mapping_options.rb +338 -0
  15. data/lib/mailslurp_client/models/create_webhook_options.rb +12 -1
  16. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  17. data/lib/mailslurp_client/models/email_thread_projection.rb +36 -36
  18. data/lib/mailslurp_client/models/generate_structured_content_attachment_options.rb +27 -9
  19. data/lib/mailslurp_client/models/generate_structured_content_email_options.rb +19 -11
  20. data/lib/mailslurp_client/models/generate_structured_content_sms_options.rb +244 -0
  21. data/lib/mailslurp_client/models/guest_portal_user_projection.rb +10 -10
  22. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +11 -11
  23. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +11 -11
  24. data/lib/mailslurp_client/models/page_ai_transform_mapping_projection.rb +309 -0
  25. data/lib/mailslurp_client/models/page_ai_transform_projection.rb +309 -0
  26. data/lib/mailslurp_client/models/page_ai_transform_result_projection.rb +309 -0
  27. data/lib/mailslurp_client/models/page_alias.rb +15 -15
  28. data/lib/mailslurp_client/models/page_alias_thread_projection.rb +15 -15
  29. data/lib/mailslurp_client/models/page_attachment_entity.rb +15 -15
  30. data/lib/mailslurp_client/models/page_bounced_email.rb +15 -15
  31. data/lib/mailslurp_client/models/page_bounced_recipients.rb +15 -15
  32. data/lib/mailslurp_client/models/page_complaint.rb +15 -15
  33. data/lib/mailslurp_client/models/page_connector.rb +15 -15
  34. data/lib/mailslurp_client/models/page_connector_events.rb +15 -15
  35. data/lib/mailslurp_client/models/page_contact_projection.rb +15 -15
  36. data/lib/mailslurp_client/models/page_delivery_status.rb +15 -15
  37. data/lib/mailslurp_client/models/page_email_preview.rb +15 -15
  38. data/lib/mailslurp_client/models/page_email_projection.rb +15 -15
  39. data/lib/mailslurp_client/models/page_email_thread_projection.rb +15 -15
  40. data/lib/mailslurp_client/models/page_email_validation_request.rb +15 -15
  41. data/lib/mailslurp_client/models/page_entity_automation_items.rb +15 -15
  42. data/lib/mailslurp_client/models/page_entity_event_items.rb +15 -15
  43. data/lib/mailslurp_client/models/page_entity_favourite_items.rb +15 -15
  44. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +15 -15
  45. data/lib/mailslurp_client/models/page_group_projection.rb +15 -15
  46. data/lib/mailslurp_client/models/page_guest_portal_users.rb +15 -15
  47. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +15 -15
  48. data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +15 -15
  49. data/lib/mailslurp_client/models/page_inbox_projection.rb +15 -15
  50. data/lib/mailslurp_client/models/page_inbox_replier_dto.rb +15 -15
  51. data/lib/mailslurp_client/models/page_inbox_replier_events.rb +15 -15
  52. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +15 -15
  53. data/lib/mailslurp_client/models/page_inbox_tags.rb +15 -15
  54. data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +15 -15
  55. data/lib/mailslurp_client/models/page_missed_email_projection.rb +15 -15
  56. data/lib/mailslurp_client/models/page_opt_in_identity_projection.rb +15 -15
  57. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +15 -15
  58. data/lib/mailslurp_client/models/page_phone_message_thread_item_projection.rb +15 -15
  59. data/lib/mailslurp_client/models/page_phone_message_thread_projection.rb +15 -15
  60. data/lib/mailslurp_client/models/page_phone_number_projection.rb +15 -15
  61. data/lib/mailslurp_client/models/page_plus_address_projection.rb +15 -15
  62. data/lib/mailslurp_client/models/page_reputation_items.rb +15 -15
  63. data/lib/mailslurp_client/models/page_scheduled_jobs.rb +15 -15
  64. data/lib/mailslurp_client/models/page_sent_email_projection.rb +15 -15
  65. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +15 -15
  66. data/lib/mailslurp_client/models/page_sent_sms_projection.rb +15 -15
  67. data/lib/mailslurp_client/models/page_sms_projection.rb +15 -15
  68. data/lib/mailslurp_client/models/page_template_projection.rb +15 -15
  69. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +15 -15
  70. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +15 -15
  71. data/lib/mailslurp_client/models/page_webhook_endpoint_projection.rb +15 -15
  72. data/lib/mailslurp_client/models/page_webhook_projection.rb +15 -15
  73. data/lib/mailslurp_client/models/page_webhook_result.rb +15 -15
  74. data/lib/mailslurp_client/models/plus_address_projection.rb +15 -15
  75. data/lib/mailslurp_client/models/sent_email_projection.rb +15 -15
  76. data/lib/mailslurp_client/models/sort_object.rb +10 -10
  77. data/lib/mailslurp_client/models/{structured_content_result.rb → structured_content_result_dto.rb} +3 -3
  78. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  79. data/lib/mailslurp_client/models/webhook_dto.rb +12 -1
  80. data/lib/mailslurp_client/models/webhook_projection.rb +19 -10
  81. data/lib/mailslurp_client/version.rb +1 -1
  82. data/lib/mailslurp_client.rb +13 -1
  83. metadata +15 -3
@@ -0,0 +1,251 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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 AITransformProjection
17
+ attr_accessor :conditions
18
+
19
+ attr_accessor :instructions
20
+
21
+ attr_accessor :output_schema
22
+
23
+ attr_accessor :name
24
+
25
+ attr_accessor :id
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'conditions' => :'conditions',
31
+ :'instructions' => :'instructions',
32
+ :'output_schema' => :'outputSchema',
33
+ :'name' => :'name',
34
+ :'id' => :'id'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'conditions' => :'Array<String>',
42
+ :'instructions' => :'Array<String>',
43
+ :'output_schema' => :'StructuredOutputSchema',
44
+ :'name' => :'String',
45
+ :'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::AITransformProjection` 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::AITransformProjection`. 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?(:'conditions')
71
+ if (value = attributes[:'conditions']).is_a?(Array)
72
+ self.conditions = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'instructions')
77
+ if (value = attributes[:'instructions']).is_a?(Array)
78
+ self.instructions = value
79
+ end
80
+ end
81
+
82
+ if attributes.key?(:'output_schema')
83
+ self.output_schema = attributes[:'output_schema']
84
+ end
85
+
86
+ if attributes.key?(:'name')
87
+ self.name = attributes[:'name']
88
+ end
89
+
90
+ if attributes.key?(:'id')
91
+ self.id = attributes[:'id']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @id.nil?
100
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @id.nil?
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ conditions == o.conditions &&
119
+ instructions == o.instructions &&
120
+ output_schema == o.output_schema &&
121
+ name == o.name &&
122
+ id == o.id
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [conditions, instructions, output_schema, name, id].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ new.build_from_hash(attributes)
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.openapi_types.each_pair do |key, type|
150
+ if type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :DateTime
171
+ DateTime.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ MailSlurpClient.const_get(type).build_from_hash(value)
202
+ end
203
+ end
204
+
205
+ # Returns the string representation of the object
206
+ # @return [String] String presentation of the object
207
+ def to_s
208
+ to_hash.to_s
209
+ end
210
+
211
+ # to_body is an alias to to_hash (backward compatibility)
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_body
214
+ to_hash
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
234
+ # For object, use to_hash. Otherwise, just return the value
235
+ # @param [Object] value Any valid value
236
+ # @return [Hash] Returns the value in the form of hash
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map { |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+ end
251
+ end
@@ -0,0 +1,353 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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 AITransformResultDto
17
+ attr_accessor :id
18
+
19
+ attr_accessor :user_id
20
+
21
+ attr_accessor :ai_transform_id
22
+
23
+ attr_accessor :ai_transform_mapping_id
24
+
25
+ attr_accessor :value
26
+
27
+ attr_accessor :entity_id
28
+
29
+ attr_accessor :entity_type
30
+
31
+ attr_accessor :created_at
32
+
33
+ attr_accessor :updated_at
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'id' => :'id',
61
+ :'user_id' => :'userId',
62
+ :'ai_transform_id' => :'aiTransformId',
63
+ :'ai_transform_mapping_id' => :'aiTransformMappingId',
64
+ :'value' => :'value',
65
+ :'entity_id' => :'entityId',
66
+ :'entity_type' => :'entityType',
67
+ :'created_at' => :'createdAt',
68
+ :'updated_at' => :'updatedAt'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'id' => :'String',
76
+ :'user_id' => :'String',
77
+ :'ai_transform_id' => :'String',
78
+ :'ai_transform_mapping_id' => :'String',
79
+ :'value' => :'Object',
80
+ :'entity_id' => :'String',
81
+ :'entity_type' => :'String',
82
+ :'created_at' => :'DateTime',
83
+ :'updated_at' => :'DateTime'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ :'value',
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::AITransformResultDto` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!self.class.attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::AITransformResultDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'id')
110
+ self.id = attributes[:'id']
111
+ end
112
+
113
+ if attributes.key?(:'user_id')
114
+ self.user_id = attributes[:'user_id']
115
+ end
116
+
117
+ if attributes.key?(:'ai_transform_id')
118
+ self.ai_transform_id = attributes[:'ai_transform_id']
119
+ end
120
+
121
+ if attributes.key?(:'ai_transform_mapping_id')
122
+ self.ai_transform_mapping_id = attributes[:'ai_transform_mapping_id']
123
+ end
124
+
125
+ if attributes.key?(:'value')
126
+ self.value = attributes[:'value']
127
+ end
128
+
129
+ if attributes.key?(:'entity_id')
130
+ self.entity_id = attributes[:'entity_id']
131
+ end
132
+
133
+ if attributes.key?(:'entity_type')
134
+ self.entity_type = attributes[:'entity_type']
135
+ end
136
+
137
+ if attributes.key?(:'created_at')
138
+ self.created_at = attributes[:'created_at']
139
+ end
140
+
141
+ if attributes.key?(:'updated_at')
142
+ self.updated_at = attributes[:'updated_at']
143
+ end
144
+ end
145
+
146
+ # Show invalid properties with the reasons. Usually used together with valid?
147
+ # @return Array for valid properties with the reasons
148
+ def list_invalid_properties
149
+ invalid_properties = Array.new
150
+ if @id.nil?
151
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
152
+ end
153
+
154
+ if @user_id.nil?
155
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
156
+ end
157
+
158
+ if @ai_transform_id.nil?
159
+ invalid_properties.push('invalid value for "ai_transform_id", ai_transform_id cannot be nil.')
160
+ end
161
+
162
+ if @ai_transform_mapping_id.nil?
163
+ invalid_properties.push('invalid value for "ai_transform_mapping_id", ai_transform_mapping_id cannot be nil.')
164
+ end
165
+
166
+ if @entity_id.nil?
167
+ invalid_properties.push('invalid value for "entity_id", entity_id cannot be nil.')
168
+ end
169
+
170
+ if @entity_type.nil?
171
+ invalid_properties.push('invalid value for "entity_type", entity_type cannot be nil.')
172
+ end
173
+
174
+ if @created_at.nil?
175
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
176
+ end
177
+
178
+ if @updated_at.nil?
179
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
180
+ end
181
+
182
+ invalid_properties
183
+ end
184
+
185
+ # Check to see if the all the properties in the model are valid
186
+ # @return true if the model is valid
187
+ def valid?
188
+ return false if @id.nil?
189
+ return false if @user_id.nil?
190
+ return false if @ai_transform_id.nil?
191
+ return false if @ai_transform_mapping_id.nil?
192
+ return false if @entity_id.nil?
193
+ return false if @entity_type.nil?
194
+ entity_type_validator = EnumAttributeValidator.new('String', ["INBOX", "PHONE"])
195
+ return false unless entity_type_validator.valid?(@entity_type)
196
+ return false if @created_at.nil?
197
+ return false if @updated_at.nil?
198
+ true
199
+ end
200
+
201
+ # Custom attribute writer method checking allowed values (enum).
202
+ # @param [Object] entity_type Object to be assigned
203
+ def entity_type=(entity_type)
204
+ validator = EnumAttributeValidator.new('String', ["INBOX", "PHONE"])
205
+ unless validator.valid?(entity_type)
206
+ fail ArgumentError, "invalid value for \"entity_type\", must be one of #{validator.allowable_values}."
207
+ end
208
+ @entity_type = entity_type
209
+ end
210
+
211
+ # Checks equality by comparing each attribute.
212
+ # @param [Object] Object to be compared
213
+ def ==(o)
214
+ return true if self.equal?(o)
215
+ self.class == o.class &&
216
+ id == o.id &&
217
+ user_id == o.user_id &&
218
+ ai_transform_id == o.ai_transform_id &&
219
+ ai_transform_mapping_id == o.ai_transform_mapping_id &&
220
+ value == o.value &&
221
+ entity_id == o.entity_id &&
222
+ entity_type == o.entity_type &&
223
+ created_at == o.created_at &&
224
+ updated_at == o.updated_at
225
+ end
226
+
227
+ # @see the `==` method
228
+ # @param [Object] Object to be compared
229
+ def eql?(o)
230
+ self == o
231
+ end
232
+
233
+ # Calculates hash code according to all attributes.
234
+ # @return [Integer] Hash code
235
+ def hash
236
+ [id, user_id, ai_transform_id, ai_transform_mapping_id, value, entity_id, entity_type, created_at, updated_at].hash
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def self.build_from_hash(attributes)
243
+ new.build_from_hash(attributes)
244
+ end
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+ self.class.openapi_types.each_pair do |key, type|
252
+ if type =~ /\AArray<(.*)>/i
253
+ # check to ensure the input is an array given that the attribute
254
+ # is documented as an array but the input is not
255
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
256
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
257
+ end
258
+ elsif !attributes[self.class.attribute_map[key]].nil?
259
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
260
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
261
+ end
262
+
263
+ self
264
+ end
265
+
266
+ # Deserializes the data based on type
267
+ # @param string type Data type
268
+ # @param string value Value to be deserialized
269
+ # @return [Object] Deserialized data
270
+ def _deserialize(type, value)
271
+ case type.to_sym
272
+ when :DateTime
273
+ DateTime.parse(value)
274
+ when :Date
275
+ Date.parse(value)
276
+ when :String
277
+ value.to_s
278
+ when :Integer
279
+ value.to_i
280
+ when :Float
281
+ value.to_f
282
+ when :Boolean
283
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
284
+ true
285
+ else
286
+ false
287
+ end
288
+ when :Object
289
+ # generic object (usually a Hash), return directly
290
+ value
291
+ when /\AArray<(?<inner_type>.+)>\z/
292
+ inner_type = Regexp.last_match[:inner_type]
293
+ value.map { |v| _deserialize(inner_type, v) }
294
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
295
+ k_type = Regexp.last_match[:k_type]
296
+ v_type = Regexp.last_match[:v_type]
297
+ {}.tap do |hash|
298
+ value.each do |k, v|
299
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
300
+ end
301
+ end
302
+ else # model
303
+ MailSlurpClient.const_get(type).build_from_hash(value)
304
+ end
305
+ end
306
+
307
+ # Returns the string representation of the object
308
+ # @return [String] String presentation of the object
309
+ def to_s
310
+ to_hash.to_s
311
+ end
312
+
313
+ # to_body is an alias to to_hash (backward compatibility)
314
+ # @return [Hash] Returns the object in the form of hash
315
+ def to_body
316
+ to_hash
317
+ end
318
+
319
+ # Returns the object in the form of hash
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_hash
322
+ hash = {}
323
+ self.class.attribute_map.each_pair do |attr, param|
324
+ value = self.send(attr)
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
330
+ hash[param] = _to_hash(value)
331
+ end
332
+ hash
333
+ end
334
+
335
+ # Outputs non-array value in the form of hash
336
+ # For object, use to_hash. Otherwise, just return the value
337
+ # @param [Object] value Any valid value
338
+ # @return [Hash] Returns the value in the form of hash
339
+ def _to_hash(value)
340
+ if value.is_a?(Array)
341
+ value.compact.map { |v| _to_hash(v) }
342
+ elsif value.is_a?(Hash)
343
+ {}.tap do |hash|
344
+ value.each { |k, v| hash[k] = _to_hash(v) }
345
+ end
346
+ elsif value.respond_to? :to_hash
347
+ value.to_hash
348
+ else
349
+ value
350
+ end
351
+ end
352
+ end
353
+ end