mailslurp_client 16.0.8 → 16.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2a82d78e1e1dd570c14b3f33010819af9e4d69f84c380a38b84ffd3981e433c
4
- data.tar.gz: 7ad890388d33921a8e9446b467b1ff1817619ddfc7bef4f8fd785be9ce647488
3
+ metadata.gz: 721d86a1a795042b4160e785468d389da75506821303cf137ad5f612eb03525d
4
+ data.tar.gz: 93d521285ffeeff92219f75fb6beffd713c50d67e304f9cf19b376d5d75028b7
5
5
  SHA512:
6
- metadata.gz: 18be563a8dad31f8861e79271974aa9747835cdb0bf193a5ca6acf6f4cb5fbb48f16a3518eceae2915d2bf227b7618116e15b606d9682d15839f0ce6627491b6
7
- data.tar.gz: dd6bbbc05f0218b5acf9de145f20fadef163ceca11254e3104004e04e1810ccde9a55d457d143eec948f5b56d2e668ec7344eeafe255b1265a9a025566a23bf0
6
+ metadata.gz: cebe7dad2d5516d911ff06e7724f292f55ddc398b9426255328e30d2acf13099d677fb77a768787b2a4a180655cef95a4298d56de6010fac95d8c912a9e3da23
7
+ data.tar.gz: b141f6384de76ddf78789d9663112880314fe856503f1f558f6e91634abf1c9a2ddb59ec903b6100276775134dd86d28a8195739e6325e60e3a959e3ae13725e
@@ -82,5 +82,69 @@ module MailSlurpClient
82
82
  end
83
83
  return data, status_code, headers
84
84
  end
85
+
86
+ # Validate structured content schema
87
+ # Check if a schema is valid and can be used to extract data using AI
88
+ # @param structured_output_schema [StructuredOutputSchema]
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [StructuredOutputSchemaValidation]
91
+ def validate_structured_output_schema(structured_output_schema, opts = {})
92
+ data, _status_code, _headers = validate_structured_output_schema_with_http_info(structured_output_schema, opts)
93
+ data
94
+ end
95
+
96
+ # Validate structured content schema
97
+ # Check if a schema is valid and can be used to extract data using AI
98
+ # @param structured_output_schema [StructuredOutputSchema]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(StructuredOutputSchemaValidation, Integer, Hash)>] StructuredOutputSchemaValidation data, response status code and response headers
101
+ def validate_structured_output_schema_with_http_info(structured_output_schema, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: AIControllerApi.validate_structured_output_schema ...'
104
+ end
105
+ # verify the required parameter 'structured_output_schema' is set
106
+ if @api_client.config.client_side_validation && structured_output_schema.nil?
107
+ fail ArgumentError, "Missing the required parameter 'structured_output_schema' when calling AIControllerApi.validate_structured_output_schema"
108
+ end
109
+ # resource path
110
+ local_var_path = '/ai/structured-content/validate'
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
119
+ # HTTP header 'Content-Type'
120
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:body] || @api_client.object_to_http_body(structured_output_schema)
127
+
128
+ # return_type
129
+ return_type = opts[:return_type] || 'StructuredOutputSchemaValidation'
130
+
131
+ # auth_names
132
+ auth_names = opts[:auth_names] || ['API_KEY']
133
+
134
+ new_options = opts.merge(
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: AIControllerApi#validate_structured_output_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
85
149
  end
86
150
  end
@@ -16,14 +16,14 @@ module MailSlurpClient
16
16
  class SentEmailProjection
17
17
  attr_accessor :id
18
18
 
19
+ attr_accessor :subject
20
+
19
21
  attr_accessor :from
20
22
 
21
23
  attr_accessor :sender
22
24
 
23
25
  attr_accessor :recipients
24
26
 
25
- attr_accessor :subject
26
-
27
27
  attr_accessor :user_id
28
28
 
29
29
  attr_accessor :attachments
@@ -56,10 +56,10 @@ module MailSlurpClient
56
56
  def self.attribute_map
57
57
  {
58
58
  :'id' => :'id',
59
+ :'subject' => :'subject',
59
60
  :'from' => :'from',
60
61
  :'sender' => :'sender',
61
62
  :'recipients' => :'recipients',
62
- :'subject' => :'subject',
63
63
  :'user_id' => :'userId',
64
64
  :'attachments' => :'attachments',
65
65
  :'inbox_id' => :'inboxId',
@@ -81,10 +81,10 @@ module MailSlurpClient
81
81
  def self.openapi_types
82
82
  {
83
83
  :'id' => :'String',
84
+ :'subject' => :'String',
84
85
  :'from' => :'String',
85
86
  :'sender' => :'Sender',
86
87
  :'recipients' => :'EmailRecipients',
87
- :'subject' => :'String',
88
88
  :'user_id' => :'String',
89
89
  :'attachments' => :'Array<String>',
90
90
  :'inbox_id' => :'String',
@@ -105,10 +105,10 @@ module MailSlurpClient
105
105
  # List of attributes with nullable: true
106
106
  def self.openapi_nullable
107
107
  Set.new([
108
+ :'subject',
108
109
  :'from',
109
110
  :'sender',
110
111
  :'recipients',
111
- :'subject',
112
112
  :'attachments',
113
113
  :'message_id',
114
114
  :'in_reply_to',
@@ -138,6 +138,10 @@ module MailSlurpClient
138
138
  self.id = attributes[:'id']
139
139
  end
140
140
 
141
+ if attributes.key?(:'subject')
142
+ self.subject = attributes[:'subject']
143
+ end
144
+
141
145
  if attributes.key?(:'from')
142
146
  self.from = attributes[:'from']
143
147
  end
@@ -150,10 +154,6 @@ module MailSlurpClient
150
154
  self.recipients = attributes[:'recipients']
151
155
  end
152
156
 
153
- if attributes.key?(:'subject')
154
- self.subject = attributes[:'subject']
155
- end
156
-
157
157
  if attributes.key?(:'user_id')
158
158
  self.user_id = attributes[:'user_id']
159
159
  end
@@ -278,10 +278,10 @@ module MailSlurpClient
278
278
  return true if self.equal?(o)
279
279
  self.class == o.class &&
280
280
  id == o.id &&
281
+ subject == o.subject &&
281
282
  from == o.from &&
282
283
  sender == o.sender &&
283
284
  recipients == o.recipients &&
284
- subject == o.subject &&
285
285
  user_id == o.user_id &&
286
286
  attachments == o.attachments &&
287
287
  inbox_id == o.inbox_id &&
@@ -307,7 +307,7 @@ module MailSlurpClient
307
307
  # Calculates hash code according to all attributes.
308
308
  # @return [Integer] Hash code
309
309
  def hash
310
- [id, from, sender, recipients, subject, user_id, attachments, inbox_id, created_at, to, cc, bcc, message_id, in_reply_to, body_excerpt, text_excerpt, body_md5_hash, virtual_send, thread_id].hash
310
+ [id, subject, from, sender, recipients, user_id, attachments, inbox_id, created_at, to, cc, bcc, message_id, in_reply_to, body_excerpt, text_excerpt, body_md5_hash, virtual_send, thread_id].hash
311
311
  end
312
312
 
313
313
  # Builds the object from hash
@@ -14,17 +14,17 @@ require 'date'
14
14
 
15
15
  module MailSlurpClient
16
16
  class SortObject
17
- attr_accessor :unsorted
18
-
19
17
  attr_accessor :sorted
20
18
 
19
+ attr_accessor :unsorted
20
+
21
21
  attr_accessor :empty
22
22
 
23
23
  # Attribute mapping from ruby-style variable name to JSON key.
24
24
  def self.attribute_map
25
25
  {
26
- :'unsorted' => :'unsorted',
27
26
  :'sorted' => :'sorted',
27
+ :'unsorted' => :'unsorted',
28
28
  :'empty' => :'empty'
29
29
  }
30
30
  end
@@ -32,8 +32,8 @@ module MailSlurpClient
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'unsorted' => :'Boolean',
36
35
  :'sorted' => :'Boolean',
36
+ :'unsorted' => :'Boolean',
37
37
  :'empty' => :'Boolean'
38
38
  }
39
39
  end
@@ -59,14 +59,14 @@ module MailSlurpClient
59
59
  h[k.to_sym] = v
60
60
  }
61
61
 
62
- if attributes.key?(:'unsorted')
63
- self.unsorted = attributes[:'unsorted']
64
- end
65
-
66
62
  if attributes.key?(:'sorted')
67
63
  self.sorted = attributes[:'sorted']
68
64
  end
69
65
 
66
+ if attributes.key?(:'unsorted')
67
+ self.unsorted = attributes[:'unsorted']
68
+ end
69
+
70
70
  if attributes.key?(:'empty')
71
71
  self.empty = attributes[:'empty']
72
72
  end
@@ -90,8 +90,8 @@ module MailSlurpClient
90
90
  def ==(o)
91
91
  return true if self.equal?(o)
92
92
  self.class == o.class &&
93
- unsorted == o.unsorted &&
94
93
  sorted == o.sorted &&
94
+ unsorted == o.unsorted &&
95
95
  empty == o.empty
96
96
  end
97
97
 
@@ -104,7 +104,7 @@ module MailSlurpClient
104
104
  # Calculates hash code according to all attributes.
105
105
  # @return [Integer] Hash code
106
106
  def hash
107
- [unsorted, sorted, empty].hash
107
+ [sorted, unsorted, empty].hash
108
108
  end
109
109
 
110
110
  # Builds the object from hash
@@ -0,0 +1,231 @@
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 StructuredOutputSchemaValidation
17
+ attr_accessor :valid
18
+
19
+ attr_accessor :errors
20
+
21
+ attr_accessor :example_output
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'valid' => :'valid',
27
+ :'errors' => :'errors',
28
+ :'example_output' => :'exampleOutput'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'valid' => :'Boolean',
36
+ :'errors' => :'Array<String>',
37
+ :'example_output' => :'String'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::StructuredOutputSchemaValidation` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::StructuredOutputSchemaValidation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'valid')
63
+ self.valid = attributes[:'valid']
64
+ end
65
+
66
+ if attributes.key?(:'errors')
67
+ if (value = attributes[:'errors']).is_a?(Array)
68
+ self.errors = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'example_output')
73
+ self.example_output = attributes[:'example_output']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @valid.nil?
82
+ invalid_properties.push('invalid value for "valid", valid cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @valid.nil?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ valid == o.valid &&
101
+ errors == o.errors &&
102
+ example_output == o.example_output
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [valid, errors, example_output].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.openapi_types.each_pair do |key, type|
130
+ if type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :DateTime
151
+ DateTime.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :Boolean
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ MailSlurpClient.const_get(type).build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+ end
231
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '16.0.8'
14
+ VERSION = '16.1.1'
15
15
  end
@@ -321,6 +321,7 @@ require 'mailslurp_client/models/sort_object'
321
321
  require 'mailslurp_client/models/spelling_issue'
322
322
  require 'mailslurp_client/models/structured_content_result'
323
323
  require 'mailslurp_client/models/structured_output_schema'
324
+ require 'mailslurp_client/models/structured_output_schema_validation'
324
325
  require 'mailslurp_client/models/template_dto'
325
326
  require 'mailslurp_client/models/template_preview'
326
327
  require 'mailslurp_client/models/template_projection'
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: 16.0.8
4
+ version: 16.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-22 00:00:00.000000000 Z
11
+ date: 2025-05-24 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/ruby/ for full Ruby documentation. Get
@@ -364,6 +364,7 @@ files:
364
364
  - lib/mailslurp_client/models/spelling_issue.rb
365
365
  - lib/mailslurp_client/models/structured_content_result.rb
366
366
  - lib/mailslurp_client/models/structured_output_schema.rb
367
+ - lib/mailslurp_client/models/structured_output_schema_validation.rb
367
368
  - lib/mailslurp_client/models/template_dto.rb
368
369
  - lib/mailslurp_client/models/template_preview.rb
369
370
  - lib/mailslurp_client/models/template_projection.rb