mailslurp_client 16.1.2 → 16.1.4

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
@@ -19,12 +19,12 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :recipients
21
21
 
22
- # User ID
23
- attr_accessor :user_id
24
-
25
22
  # Inbox ID
26
23
  attr_accessor :inbox_id
27
24
 
25
+ # User ID
26
+ attr_accessor :user_id
27
+
28
28
  # Updated at DateTime
29
29
  attr_accessor :updated_at
30
30
 
@@ -43,6 +43,12 @@ module MailSlurpClient
43
43
  # Has attachments
44
44
  attr_accessor :has_attachments
45
45
 
46
+ # Has unread
47
+ attr_accessor :unread
48
+
49
+ # Number of messages in the thread
50
+ attr_accessor :message_count
51
+
46
52
  # Last body excerpt
47
53
  attr_accessor :last_body_excerpt
48
54
 
@@ -57,12 +63,6 @@ module MailSlurpClient
57
63
 
58
64
  attr_accessor :last_sender
59
65
 
60
- # Number of messages in the thread
61
- attr_accessor :message_count
62
-
63
- # Has unread
64
- attr_accessor :unread
65
-
66
66
  # Thread topic subject
67
67
  attr_accessor :subject
68
68
 
@@ -77,21 +77,21 @@ module MailSlurpClient
77
77
  {
78
78
  :'sender' => :'sender',
79
79
  :'recipients' => :'recipients',
80
- :'user_id' => :'userId',
81
80
  :'inbox_id' => :'inboxId',
81
+ :'user_id' => :'userId',
82
82
  :'updated_at' => :'updatedAt',
83
83
  :'created_at' => :'createdAt',
84
84
  :'to' => :'to',
85
85
  :'cc' => :'cc',
86
86
  :'bcc' => :'bcc',
87
87
  :'has_attachments' => :'hasAttachments',
88
+ :'unread' => :'unread',
89
+ :'message_count' => :'messageCount',
88
90
  :'last_body_excerpt' => :'lastBodyExcerpt',
89
91
  :'last_text_excerpt' => :'lastTextExcerpt',
90
92
  :'last_created_at' => :'lastCreatedAt',
91
93
  :'last_from' => :'lastFrom',
92
94
  :'last_sender' => :'lastSender',
93
- :'message_count' => :'messageCount',
94
- :'unread' => :'unread',
95
95
  :'subject' => :'subject',
96
96
  :'id' => :'id',
97
97
  :'from' => :'from'
@@ -103,21 +103,21 @@ module MailSlurpClient
103
103
  {
104
104
  :'sender' => :'SenderProjection',
105
105
  :'recipients' => :'EmailRecipientsProjection',
106
- :'user_id' => :'String',
107
106
  :'inbox_id' => :'String',
107
+ :'user_id' => :'String',
108
108
  :'updated_at' => :'DateTime',
109
109
  :'created_at' => :'DateTime',
110
110
  :'to' => :'Array<String>',
111
111
  :'cc' => :'Array<String>',
112
112
  :'bcc' => :'Array<String>',
113
113
  :'has_attachments' => :'Boolean',
114
+ :'unread' => :'Boolean',
115
+ :'message_count' => :'Integer',
114
116
  :'last_body_excerpt' => :'String',
115
117
  :'last_text_excerpt' => :'String',
116
118
  :'last_created_at' => :'DateTime',
117
119
  :'last_from' => :'String',
118
120
  :'last_sender' => :'SenderProjection',
119
- :'message_count' => :'Integer',
120
- :'unread' => :'Boolean',
121
121
  :'subject' => :'String',
122
122
  :'id' => :'String',
123
123
  :'from' => :'String'
@@ -153,14 +153,14 @@ module MailSlurpClient
153
153
  self.recipients = attributes[:'recipients']
154
154
  end
155
155
 
156
- if attributes.key?(:'user_id')
157
- self.user_id = attributes[:'user_id']
158
- end
159
-
160
156
  if attributes.key?(:'inbox_id')
161
157
  self.inbox_id = attributes[:'inbox_id']
162
158
  end
163
159
 
160
+ if attributes.key?(:'user_id')
161
+ self.user_id = attributes[:'user_id']
162
+ end
163
+
164
164
  if attributes.key?(:'updated_at')
165
165
  self.updated_at = attributes[:'updated_at']
166
166
  end
@@ -191,6 +191,14 @@ module MailSlurpClient
191
191
  self.has_attachments = attributes[:'has_attachments']
192
192
  end
193
193
 
194
+ if attributes.key?(:'unread')
195
+ self.unread = attributes[:'unread']
196
+ end
197
+
198
+ if attributes.key?(:'message_count')
199
+ self.message_count = attributes[:'message_count']
200
+ end
201
+
194
202
  if attributes.key?(:'last_body_excerpt')
195
203
  self.last_body_excerpt = attributes[:'last_body_excerpt']
196
204
  end
@@ -211,14 +219,6 @@ module MailSlurpClient
211
219
  self.last_sender = attributes[:'last_sender']
212
220
  end
213
221
 
214
- if attributes.key?(:'message_count')
215
- self.message_count = attributes[:'message_count']
216
- end
217
-
218
- if attributes.key?(:'unread')
219
- self.unread = attributes[:'unread']
220
- end
221
-
222
222
  if attributes.key?(:'subject')
223
223
  self.subject = attributes[:'subject']
224
224
  end
@@ -256,14 +256,14 @@ module MailSlurpClient
256
256
  invalid_properties.push('invalid value for "has_attachments", has_attachments cannot be nil.')
257
257
  end
258
258
 
259
- if @message_count.nil?
260
- invalid_properties.push('invalid value for "message_count", message_count cannot be nil.')
261
- end
262
-
263
259
  if @unread.nil?
264
260
  invalid_properties.push('invalid value for "unread", unread cannot be nil.')
265
261
  end
266
262
 
263
+ if @message_count.nil?
264
+ invalid_properties.push('invalid value for "message_count", message_count cannot be nil.')
265
+ end
266
+
267
267
  if @id.nil?
268
268
  invalid_properties.push('invalid value for "id", id cannot be nil.')
269
269
  end
@@ -279,8 +279,8 @@ module MailSlurpClient
279
279
  return false if @created_at.nil?
280
280
  return false if @to.nil?
281
281
  return false if @has_attachments.nil?
282
- return false if @message_count.nil?
283
282
  return false if @unread.nil?
283
+ return false if @message_count.nil?
284
284
  return false if @id.nil?
285
285
  true
286
286
  end
@@ -292,21 +292,21 @@ module MailSlurpClient
292
292
  self.class == o.class &&
293
293
  sender == o.sender &&
294
294
  recipients == o.recipients &&
295
- user_id == o.user_id &&
296
295
  inbox_id == o.inbox_id &&
296
+ user_id == o.user_id &&
297
297
  updated_at == o.updated_at &&
298
298
  created_at == o.created_at &&
299
299
  to == o.to &&
300
300
  cc == o.cc &&
301
301
  bcc == o.bcc &&
302
302
  has_attachments == o.has_attachments &&
303
+ unread == o.unread &&
304
+ message_count == o.message_count &&
303
305
  last_body_excerpt == o.last_body_excerpt &&
304
306
  last_text_excerpt == o.last_text_excerpt &&
305
307
  last_created_at == o.last_created_at &&
306
308
  last_from == o.last_from &&
307
309
  last_sender == o.last_sender &&
308
- message_count == o.message_count &&
309
- unread == o.unread &&
310
310
  subject == o.subject &&
311
311
  id == o.id &&
312
312
  from == o.from
@@ -321,7 +321,7 @@ module MailSlurpClient
321
321
  # Calculates hash code according to all attributes.
322
322
  # @return [Integer] Hash code
323
323
  def hash
324
- [sender, recipients, user_id, inbox_id, updated_at, created_at, to, cc, bcc, has_attachments, last_body_excerpt, last_text_excerpt, last_created_at, last_from, last_sender, message_count, unread, subject, id, from].hash
324
+ [sender, recipients, inbox_id, user_id, updated_at, created_at, to, cc, bcc, has_attachments, unread, message_count, last_body_excerpt, last_text_excerpt, last_created_at, last_from, last_sender, subject, id, from].hash
325
325
  end
326
326
 
327
327
  # Builds the object from hash
@@ -23,12 +23,20 @@ module MailSlurpClient
23
23
 
24
24
  attr_accessor :output_schema
25
25
 
26
+ # ID of transformer to apply
27
+ attr_accessor :transform_id
28
+
29
+ # Optional email ID for more context
30
+ attr_accessor :email_id
31
+
26
32
  # Attribute mapping from ruby-style variable name to JSON key.
27
33
  def self.attribute_map
28
34
  {
29
35
  :'attachment_id' => :'attachmentId',
30
36
  :'instructions' => :'instructions',
31
- :'output_schema' => :'outputSchema'
37
+ :'output_schema' => :'outputSchema',
38
+ :'transform_id' => :'transformId',
39
+ :'email_id' => :'emailId'
32
40
  }
33
41
  end
34
42
 
@@ -37,13 +45,18 @@ module MailSlurpClient
37
45
  {
38
46
  :'attachment_id' => :'String',
39
47
  :'instructions' => :'String',
40
- :'output_schema' => :'StructuredOutputSchema'
48
+ :'output_schema' => :'StructuredOutputSchema',
49
+ :'transform_id' => :'String',
50
+ :'email_id' => :'String'
41
51
  }
42
52
  end
43
53
 
44
54
  # List of attributes with nullable: true
45
55
  def self.openapi_nullable
46
56
  Set.new([
57
+ :'instructions',
58
+ :'transform_id',
59
+ :'email_id'
47
60
  ])
48
61
  end
49
62
 
@@ -73,6 +86,14 @@ module MailSlurpClient
73
86
  if attributes.key?(:'output_schema')
74
87
  self.output_schema = attributes[:'output_schema']
75
88
  end
89
+
90
+ if attributes.key?(:'transform_id')
91
+ self.transform_id = attributes[:'transform_id']
92
+ end
93
+
94
+ if attributes.key?(:'email_id')
95
+ self.email_id = attributes[:'email_id']
96
+ end
76
97
  end
77
98
 
78
99
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -83,10 +104,6 @@ module MailSlurpClient
83
104
  invalid_properties.push('invalid value for "attachment_id", attachment_id cannot be nil.')
84
105
  end
85
106
 
86
- if @output_schema.nil?
87
- invalid_properties.push('invalid value for "output_schema", output_schema cannot be nil.')
88
- end
89
-
90
107
  invalid_properties
91
108
  end
92
109
 
@@ -94,7 +111,6 @@ module MailSlurpClient
94
111
  # @return true if the model is valid
95
112
  def valid?
96
113
  return false if @attachment_id.nil?
97
- return false if @output_schema.nil?
98
114
  true
99
115
  end
100
116
 
@@ -105,7 +121,9 @@ module MailSlurpClient
105
121
  self.class == o.class &&
106
122
  attachment_id == o.attachment_id &&
107
123
  instructions == o.instructions &&
108
- output_schema == o.output_schema
124
+ output_schema == o.output_schema &&
125
+ transform_id == o.transform_id &&
126
+ email_id == o.email_id
109
127
  end
110
128
 
111
129
  # @see the `==` method
@@ -117,7 +135,7 @@ module MailSlurpClient
117
135
  # Calculates hash code according to all attributes.
118
136
  # @return [Integer] Hash code
119
137
  def hash
120
- [attachment_id, instructions, output_schema].hash
138
+ [attachment_id, instructions, output_schema, transform_id, email_id].hash
121
139
  end
122
140
 
123
141
  # Builds the object from hash
@@ -26,6 +26,9 @@ module MailSlurpClient
26
26
 
27
27
  attr_accessor :output_schema
28
28
 
29
+ # ID of transformer to apply
30
+ attr_accessor :transform_id
31
+
29
32
  class EnumAttributeValidator
30
33
  attr_reader :datatype
31
34
  attr_reader :allowable_values
@@ -54,7 +57,8 @@ module MailSlurpClient
54
57
  :'email_id' => :'emailId',
55
58
  :'content_selector' => :'contentSelector',
56
59
  :'instructions' => :'instructions',
57
- :'output_schema' => :'outputSchema'
60
+ :'output_schema' => :'outputSchema',
61
+ :'transform_id' => :'transformId'
58
62
  }
59
63
  end
60
64
 
@@ -64,13 +68,17 @@ module MailSlurpClient
64
68
  :'email_id' => :'String',
65
69
  :'content_selector' => :'String',
66
70
  :'instructions' => :'String',
67
- :'output_schema' => :'StructuredOutputSchema'
71
+ :'output_schema' => :'StructuredOutputSchema',
72
+ :'transform_id' => :'String'
68
73
  }
69
74
  end
70
75
 
71
76
  # List of attributes with nullable: true
72
77
  def self.openapi_nullable
73
78
  Set.new([
79
+ :'content_selector',
80
+ :'instructions',
81
+ :'transform_id'
74
82
  ])
75
83
  end
76
84
 
@@ -104,6 +112,10 @@ module MailSlurpClient
104
112
  if attributes.key?(:'output_schema')
105
113
  self.output_schema = attributes[:'output_schema']
106
114
  end
115
+
116
+ if attributes.key?(:'transform_id')
117
+ self.transform_id = attributes[:'transform_id']
118
+ end
107
119
  end
108
120
 
109
121
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -114,10 +126,6 @@ module MailSlurpClient
114
126
  invalid_properties.push('invalid value for "email_id", email_id cannot be nil.')
115
127
  end
116
128
 
117
- if @output_schema.nil?
118
- invalid_properties.push('invalid value for "output_schema", output_schema cannot be nil.')
119
- end
120
-
121
129
  invalid_properties
122
130
  end
123
131
 
@@ -125,16 +133,15 @@ module MailSlurpClient
125
133
  # @return true if the model is valid
126
134
  def valid?
127
135
  return false if @email_id.nil?
128
- content_selector_validator = EnumAttributeValidator.new('String', ["RAW", "BODY"])
136
+ content_selector_validator = EnumAttributeValidator.new('String', ["RAW", "BODY", "BODY_ATTACHMENTS"])
129
137
  return false unless content_selector_validator.valid?(@content_selector)
130
- return false if @output_schema.nil?
131
138
  true
132
139
  end
133
140
 
134
141
  # Custom attribute writer method checking allowed values (enum).
135
142
  # @param [Object] content_selector Object to be assigned
136
143
  def content_selector=(content_selector)
137
- validator = EnumAttributeValidator.new('String', ["RAW", "BODY"])
144
+ validator = EnumAttributeValidator.new('String', ["RAW", "BODY", "BODY_ATTACHMENTS"])
138
145
  unless validator.valid?(content_selector)
139
146
  fail ArgumentError, "invalid value for \"content_selector\", must be one of #{validator.allowable_values}."
140
147
  end
@@ -149,7 +156,8 @@ module MailSlurpClient
149
156
  email_id == o.email_id &&
150
157
  content_selector == o.content_selector &&
151
158
  instructions == o.instructions &&
152
- output_schema == o.output_schema
159
+ output_schema == o.output_schema &&
160
+ transform_id == o.transform_id
153
161
  end
154
162
 
155
163
  # @see the `==` method
@@ -161,7 +169,7 @@ module MailSlurpClient
161
169
  # Calculates hash code according to all attributes.
162
170
  # @return [Integer] Hash code
163
171
  def hash
164
- [email_id, content_selector, instructions, output_schema].hash
172
+ [email_id, content_selector, instructions, output_schema, transform_id].hash
165
173
  end
166
174
 
167
175
  # Builds the object from hash
@@ -0,0 +1,244 @@
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
+ # Options for generating structured content output from an SMS
17
+ class GenerateStructuredContentSmsOptions
18
+ # SMS ID to read and pass to AI
19
+ attr_accessor :sms_id
20
+
21
+ # Optional instructions for the AI to follow. Try to be precise and clear. You can include examples and hints.
22
+ attr_accessor :instructions
23
+
24
+ attr_accessor :output_schema
25
+
26
+ # ID of transformer to apply
27
+ attr_accessor :transform_id
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'sms_id' => :'smsId',
33
+ :'instructions' => :'instructions',
34
+ :'output_schema' => :'outputSchema',
35
+ :'transform_id' => :'transformId'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'sms_id' => :'String',
43
+ :'instructions' => :'String',
44
+ :'output_schema' => :'StructuredOutputSchema',
45
+ :'transform_id' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'instructions',
53
+ :'transform_id'
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::GenerateStructuredContentSmsOptions` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::GenerateStructuredContentSmsOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'sms_id')
73
+ self.sms_id = attributes[:'sms_id']
74
+ end
75
+
76
+ if attributes.key?(:'instructions')
77
+ self.instructions = attributes[:'instructions']
78
+ end
79
+
80
+ if attributes.key?(:'output_schema')
81
+ self.output_schema = attributes[:'output_schema']
82
+ end
83
+
84
+ if attributes.key?(:'transform_id')
85
+ self.transform_id = attributes[:'transform_id']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ if @sms_id.nil?
94
+ invalid_properties.push('invalid value for "sms_id", sms_id cannot be nil.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ return false if @sms_id.nil?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ sms_id == o.sms_id &&
113
+ instructions == o.instructions &&
114
+ output_schema == o.output_schema &&
115
+ transform_id == o.transform_id
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [sms_id, instructions, output_schema, transform_id].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
147
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
148
+ end
149
+ elsif !attributes[self.class.attribute_map[key]].nil?
150
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
151
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ DateTime.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :Boolean
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ MailSlurpClient.const_get(type).build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+ end
244
+ end