mailslurp_client 5.0.0 → 7.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +127 -40
- data/docs/AttachmentControllerApi.md +124 -0
- data/docs/AttachmentMetaData.md +23 -0
- data/docs/BasicAuthOptions.md +10 -0
- data/docs/BulkActionsControllerApi.md +165 -0
- data/docs/BulkSendEmailOptions.md +11 -1
- data/docs/CommonActionsControllerApi.md +167 -0
- data/docs/ContactControllerApi.md +274 -0
- data/docs/ContactDto.md +31 -0
- data/docs/ContactProjection.md +27 -0
- data/docs/CreateContactOptions.md +31 -0
- data/docs/CreateDomainOptions.md +17 -0
- data/docs/CreateGroupOptions.md +19 -0
- data/docs/CreateTemplateOptions.md +19 -0
- data/docs/CreateWebhookOptions.md +13 -2
- data/docs/DomainControllerApi.md +223 -0
- data/docs/DomainDto.md +29 -0
- data/docs/DomainPreview.md +21 -0
- data/docs/Email.md +40 -15
- data/docs/EmailAnalysis.md +18 -5
- data/docs/EmailControllerApi.md +740 -0
- data/docs/EmailPreview.md +24 -6
- data/docs/EmailProjection.md +33 -0
- data/docs/ForwardEmailOptions.md +12 -0
- data/docs/GroupContactsDto.md +19 -0
- data/docs/GroupControllerApi.md +437 -0
- data/docs/GroupDto.md +23 -0
- data/docs/GroupProjection.md +23 -0
- data/docs/HTMLValidationResult.md +21 -0
- data/docs/Inbox.md +26 -4
- data/docs/InboxControllerApi.md +652 -0
- data/docs/InboxProjection.md +29 -0
- data/docs/JsonNode.md +59 -0
- data/docs/MatchOption.md +13 -2
- data/docs/MatchOptions.md +9 -0
- data/docs/PageContactProjection.md +37 -0
- data/docs/PageEmailPreview.md +37 -0
- data/docs/PageEmailProjection.md +37 -0
- data/docs/PageGroupProjection.md +37 -0
- data/docs/PageInboxProjection.md +37 -0
- data/docs/PageTemplateProjection.md +37 -0
- data/docs/PageWebhookProjection.md +37 -0
- data/docs/Pageable.md +27 -0
- data/docs/RawEmailJson.md +17 -0
- data/docs/SendEmailOptions.md +33 -6
- data/docs/SetInboxFavouritedOptions.md +17 -0
- data/docs/Sort.md +21 -0
- data/docs/TemplateControllerApi.md +274 -0
- data/docs/TemplateDto.md +25 -0
- data/docs/TemplateProjection.md +25 -0
- data/docs/TemplateVariable.md +19 -0
- data/docs/UnreadCount.md +17 -0
- data/docs/UpdateGroupContacts.md +17 -0
- data/docs/UpdateInboxOptions.md +25 -0
- data/docs/UploadAttachmentOptions.md +12 -1
- data/docs/ValidationDto.md +19 -0
- data/docs/ValidationMessage.md +19 -0
- data/docs/WaitForConditions.md +29 -0
- data/docs/WaitForControllerApi.md +317 -0
- data/docs/WebhookControllerApi.md +339 -0
- data/docs/WebhookDto.md +33 -0
- data/docs/WebhookProjection.md +27 -0
- data/docs/WebhookTestRequest.md +23 -0
- data/docs/WebhookTestResponse.md +19 -0
- data/docs/WebhookTestResult.md +21 -0
- data/git_push.sh +10 -7
- data/lib/mailslurp_client.rb +56 -7
- data/lib/mailslurp_client/api/attachment_controller_api.rb +157 -0
- data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +203 -0
- data/lib/mailslurp_client/api/common_actions_controller_api.rb +201 -0
- data/lib/mailslurp_client/api/contact_controller_api.rb +323 -0
- data/lib/mailslurp_client/api/domain_controller_api.rb +264 -0
- data/lib/mailslurp_client/api/email_controller_api.rb +852 -0
- data/lib/mailslurp_client/api/group_controller_api.rb +519 -0
- data/lib/mailslurp_client/api/inbox_controller_api.rb +763 -0
- data/lib/mailslurp_client/api/template_controller_api.rb +323 -0
- data/lib/mailslurp_client/api/wait_for_controller_api.rb +359 -0
- data/lib/mailslurp_client/api/webhook_controller_api.rb +405 -0
- data/lib/mailslurp_client/api_client.rb +36 -39
- data/lib/mailslurp_client/api_error.rb +23 -4
- data/lib/mailslurp_client/configuration.rb +8 -11
- data/lib/mailslurp_client/models/attachment_meta_data.rb +253 -0
- data/lib/mailslurp_client/models/basic_auth_options.rb +39 -15
- data/lib/mailslurp_client/models/bulk_send_email_options.rb +42 -19
- data/lib/mailslurp_client/models/contact_dto.rb +288 -0
- data/lib/mailslurp_client/models/contact_projection.rb +261 -0
- data/lib/mailslurp_client/models/create_contact_options.rb +277 -0
- data/lib/mailslurp_client/models/create_domain_options.rb +208 -0
- data/lib/mailslurp_client/models/create_group_options.rb +220 -0
- data/lib/mailslurp_client/models/create_template_options.rb +225 -0
- data/lib/mailslurp_client/models/create_webhook_options.rb +54 -29
- data/lib/mailslurp_client/models/domain_dto.rb +296 -0
- data/lib/mailslurp_client/models/domain_preview.rb +240 -0
- data/lib/mailslurp_client/models/email.rb +86 -78
- data/lib/mailslurp_client/models/email_analysis.rb +46 -48
- data/lib/mailslurp_client/models/email_preview.rb +77 -41
- data/lib/mailslurp_client/models/email_projection.rb +306 -0
- data/lib/mailslurp_client/models/forward_email_options.rb +40 -17
- data/lib/mailslurp_client/models/group_contacts_dto.rb +227 -0
- data/lib/mailslurp_client/models/{webhook.rb → group_dto.rb} +60 -54
- data/lib/mailslurp_client/models/group_projection.rb +248 -0
- data/lib/mailslurp_client/models/html_validation_result.rb +243 -0
- data/lib/mailslurp_client/models/inbox.rb +104 -26
- data/lib/mailslurp_client/models/inbox_projection.rb +272 -0
- data/lib/mailslurp_client/models/json_node.rb +429 -0
- data/lib/mailslurp_client/models/match_option.rb +48 -24
- data/lib/mailslurp_client/models/match_options.rb +37 -14
- data/lib/mailslurp_client/models/page_contact_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_email_preview.rb +298 -0
- data/lib/mailslurp_client/models/page_email_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_group_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_inbox_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_template_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_webhook_projection.rb +298 -0
- data/lib/mailslurp_client/models/pageable.rb +251 -0
- data/lib/mailslurp_client/models/raw_email_json.rb +211 -0
- data/lib/mailslurp_client/models/send_email_options.rb +141 -46
- data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +208 -0
- data/lib/mailslurp_client/models/sort.rb +224 -0
- data/lib/mailslurp_client/models/template_dto.rb +269 -0
- data/lib/mailslurp_client/models/template_projection.rb +269 -0
- data/lib/mailslurp_client/models/template_variable.rb +259 -0
- data/lib/mailslurp_client/models/unread_count.rb +211 -0
- data/lib/mailslurp_client/models/update_group_contacts.rb +213 -0
- data/lib/mailslurp_client/models/update_inbox_options.rb +250 -0
- data/lib/mailslurp_client/models/upload_attachment_options.rb +43 -20
- data/lib/mailslurp_client/models/validation_dto.rb +225 -0
- data/lib/mailslurp_client/models/validation_message.rb +220 -0
- data/lib/mailslurp_client/models/wait_for_conditions.rb +315 -0
- data/lib/mailslurp_client/models/webhook_dto.rb +326 -0
- data/lib/mailslurp_client/models/webhook_projection.rb +277 -0
- data/lib/mailslurp_client/models/webhook_test_request.rb +284 -0
- data/lib/mailslurp_client/models/webhook_test_response.rb +215 -0
- data/lib/mailslurp_client/models/webhook_test_result.rb +235 -0
- data/lib/mailslurp_client/version.rb +5 -5
- data/mailslurp_client.gemspec +4 -10
- data/spec/api/attachment_controller_api_spec.rb +61 -0
- data/spec/api/bulk_actions_controller_api_spec.rb +68 -0
- data/spec/api/common_actions_controller_api_spec.rb +129 -0
- data/spec/api/contact_controller_api_spec.rb +91 -0
- data/spec/api/domain_controller_api_spec.rb +82 -0
- data/spec/api/email_controller_api_spec.rb +162 -0
- data/spec/api/group_controller_api_spec.rb +126 -0
- data/spec/api/inbox_controller_api_spec.rb +172 -0
- data/spec/api/template_controller_api_spec.rb +91 -0
- data/spec/api/wait_for_controller_api_spec.rb +107 -0
- data/spec/api/webhook_controller_api_spec.rb +107 -0
- data/spec/api_client_spec.rb +5 -5
- data/spec/configuration_spec.rb +4 -4
- data/spec/models/attachment_meta_data_spec.rb +59 -0
- data/spec/models/basic_auth_options_spec.rb +4 -4
- data/spec/models/bulk_send_email_options_spec.rb +4 -4
- data/spec/models/contact_dto_spec.rb +83 -0
- data/spec/models/contact_projection_spec.rb +71 -0
- data/spec/models/create_contact_options_spec.rb +83 -0
- data/spec/models/create_domain_options_spec.rb +41 -0
- data/spec/models/create_group_options_spec.rb +47 -0
- data/spec/models/create_template_options_spec.rb +47 -0
- data/spec/models/create_webhook_options_spec.rb +6 -6
- data/spec/models/domain_dto_spec.rb +77 -0
- data/spec/models/domain_preview_spec.rb +53 -0
- data/spec/models/email_analysis_spec.rb +4 -4
- data/spec/models/email_preview_spec.rb +41 -5
- data/spec/models/email_projection_spec.rb +89 -0
- data/spec/models/email_spec.rb +17 -5
- data/spec/models/forward_email_options_spec.rb +4 -4
- data/spec/models/group_contacts_dto_spec.rb +47 -0
- data/spec/models/group_dto_spec.rb +59 -0
- data/spec/models/group_projection_spec.rb +59 -0
- data/spec/models/html_validation_result_spec.rb +53 -0
- data/spec/models/inbox_projection_spec.rb +77 -0
- data/spec/models/inbox_spec.rb +35 -5
- data/spec/models/json_node_spec.rb +171 -0
- data/spec/models/match_option_spec.rb +4 -4
- data/spec/models/match_options_spec.rb +4 -4
- data/spec/models/page_contact_projection_spec.rb +101 -0
- data/spec/models/page_email_preview_spec.rb +101 -0
- data/spec/models/page_email_projection_spec.rb +101 -0
- data/spec/models/page_group_projection_spec.rb +101 -0
- data/spec/models/page_inbox_projection_spec.rb +101 -0
- data/spec/models/page_template_projection_spec.rb +101 -0
- data/spec/models/page_webhook_projection_spec.rb +101 -0
- data/spec/models/pageable_spec.rb +71 -0
- data/spec/models/raw_email_json_spec.rb +41 -0
- data/spec/models/send_email_options_spec.rb +45 -5
- data/spec/models/set_inbox_favourited_options_spec.rb +41 -0
- data/spec/models/sort_spec.rb +53 -0
- data/spec/models/template_dto_spec.rb +65 -0
- data/spec/models/template_projection_spec.rb +65 -0
- data/spec/models/template_variable_spec.rb +51 -0
- data/spec/models/unread_count_spec.rb +41 -0
- data/spec/models/update_group_contacts_spec.rb +41 -0
- data/spec/models/{webhook_spec.rb → update_inbox_options_spec.rb} +14 -20
- data/spec/models/upload_attachment_options_spec.rb +4 -4
- data/spec/models/validation_dto_spec.rb +47 -0
- data/spec/models/validation_message_spec.rb +47 -0
- data/spec/models/wait_for_conditions_spec.rb +85 -0
- data/spec/models/webhook_dto_spec.rb +93 -0
- data/spec/models/webhook_projection_spec.rb +71 -0
- data/spec/models/webhook_test_request_spec.rb +63 -0
- data/spec/models/webhook_test_response_spec.rb +47 -0
- data/spec/models/webhook_test_result_spec.rb +53 -0
- data/spec/spec_helper.rb +4 -4
- metadata +223 -149
- data/Gemfile.lock +0 -79
- data/docs/CommonOperationsApi.md +0 -499
- data/docs/ExtraOperationsApi.md +0 -1021
- data/docs/Webhook.md +0 -13
- data/lib/mailslurp_client/api/common_operations_api.rb +0 -502
- data/lib/mailslurp_client/api/extra_operations_api.rb +0 -1054
- data/spec/api/common_operations_api_spec.rb +0 -95
- data/spec/api/extra_operations_api_spec.rb +0 -231
@@ -0,0 +1,429 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
class JsonNode
|
17
|
+
attr_accessor :array
|
18
|
+
|
19
|
+
attr_accessor :big_decimal
|
20
|
+
|
21
|
+
attr_accessor :big_integer
|
22
|
+
|
23
|
+
attr_accessor :binary
|
24
|
+
|
25
|
+
attr_accessor :boolean
|
26
|
+
|
27
|
+
attr_accessor :container_node
|
28
|
+
|
29
|
+
attr_accessor :double
|
30
|
+
|
31
|
+
attr_accessor :empty
|
32
|
+
|
33
|
+
attr_accessor :float
|
34
|
+
|
35
|
+
attr_accessor :floating_point_number
|
36
|
+
|
37
|
+
attr_accessor :int
|
38
|
+
|
39
|
+
attr_accessor :integral_number
|
40
|
+
|
41
|
+
attr_accessor :long
|
42
|
+
|
43
|
+
attr_accessor :missing_node
|
44
|
+
|
45
|
+
attr_accessor :node_type
|
46
|
+
|
47
|
+
attr_accessor :null
|
48
|
+
|
49
|
+
attr_accessor :number
|
50
|
+
|
51
|
+
attr_accessor :object
|
52
|
+
|
53
|
+
attr_accessor :pojo
|
54
|
+
|
55
|
+
attr_accessor :short
|
56
|
+
|
57
|
+
attr_accessor :textual
|
58
|
+
|
59
|
+
attr_accessor :value_node
|
60
|
+
|
61
|
+
class EnumAttributeValidator
|
62
|
+
attr_reader :datatype
|
63
|
+
attr_reader :allowable_values
|
64
|
+
|
65
|
+
def initialize(datatype, allowable_values)
|
66
|
+
@allowable_values = allowable_values.map do |value|
|
67
|
+
case datatype.to_s
|
68
|
+
when /Integer/i
|
69
|
+
value.to_i
|
70
|
+
when /Float/i
|
71
|
+
value.to_f
|
72
|
+
else
|
73
|
+
value
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def valid?(value)
|
79
|
+
!value || allowable_values.include?(value)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
84
|
+
def self.attribute_map
|
85
|
+
{
|
86
|
+
:'array' => :'array',
|
87
|
+
:'big_decimal' => :'bigDecimal',
|
88
|
+
:'big_integer' => :'bigInteger',
|
89
|
+
:'binary' => :'binary',
|
90
|
+
:'boolean' => :'boolean',
|
91
|
+
:'container_node' => :'containerNode',
|
92
|
+
:'double' => :'double',
|
93
|
+
:'empty' => :'empty',
|
94
|
+
:'float' => :'float',
|
95
|
+
:'floating_point_number' => :'floatingPointNumber',
|
96
|
+
:'int' => :'int',
|
97
|
+
:'integral_number' => :'integralNumber',
|
98
|
+
:'long' => :'long',
|
99
|
+
:'missing_node' => :'missingNode',
|
100
|
+
:'node_type' => :'nodeType',
|
101
|
+
:'null' => :'null',
|
102
|
+
:'number' => :'number',
|
103
|
+
:'object' => :'object',
|
104
|
+
:'pojo' => :'pojo',
|
105
|
+
:'short' => :'short',
|
106
|
+
:'textual' => :'textual',
|
107
|
+
:'value_node' => :'valueNode'
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
# Attribute type mapping.
|
112
|
+
def self.openapi_types
|
113
|
+
{
|
114
|
+
:'array' => :'Boolean',
|
115
|
+
:'big_decimal' => :'Boolean',
|
116
|
+
:'big_integer' => :'Boolean',
|
117
|
+
:'binary' => :'Boolean',
|
118
|
+
:'boolean' => :'Boolean',
|
119
|
+
:'container_node' => :'Boolean',
|
120
|
+
:'double' => :'Boolean',
|
121
|
+
:'empty' => :'Boolean',
|
122
|
+
:'float' => :'Boolean',
|
123
|
+
:'floating_point_number' => :'Boolean',
|
124
|
+
:'int' => :'Boolean',
|
125
|
+
:'integral_number' => :'Boolean',
|
126
|
+
:'long' => :'Boolean',
|
127
|
+
:'missing_node' => :'Boolean',
|
128
|
+
:'node_type' => :'String',
|
129
|
+
:'null' => :'Boolean',
|
130
|
+
:'number' => :'Boolean',
|
131
|
+
:'object' => :'Boolean',
|
132
|
+
:'pojo' => :'Boolean',
|
133
|
+
:'short' => :'Boolean',
|
134
|
+
:'textual' => :'Boolean',
|
135
|
+
:'value_node' => :'Boolean'
|
136
|
+
}
|
137
|
+
end
|
138
|
+
|
139
|
+
# List of attributes with nullable: true
|
140
|
+
def self.openapi_nullable
|
141
|
+
Set.new([
|
142
|
+
])
|
143
|
+
end
|
144
|
+
|
145
|
+
# Initializes the object
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
def initialize(attributes = {})
|
148
|
+
if (!attributes.is_a?(Hash))
|
149
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::JsonNode` initialize method"
|
150
|
+
end
|
151
|
+
|
152
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
153
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
154
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
155
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::JsonNode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
156
|
+
end
|
157
|
+
h[k.to_sym] = v
|
158
|
+
}
|
159
|
+
|
160
|
+
if attributes.key?(:'array')
|
161
|
+
self.array = attributes[:'array']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'big_decimal')
|
165
|
+
self.big_decimal = attributes[:'big_decimal']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'big_integer')
|
169
|
+
self.big_integer = attributes[:'big_integer']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'binary')
|
173
|
+
self.binary = attributes[:'binary']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'boolean')
|
177
|
+
self.boolean = attributes[:'boolean']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'container_node')
|
181
|
+
self.container_node = attributes[:'container_node']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'double')
|
185
|
+
self.double = attributes[:'double']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.key?(:'empty')
|
189
|
+
self.empty = attributes[:'empty']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'float')
|
193
|
+
self.float = attributes[:'float']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'floating_point_number')
|
197
|
+
self.floating_point_number = attributes[:'floating_point_number']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'int')
|
201
|
+
self.int = attributes[:'int']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'integral_number')
|
205
|
+
self.integral_number = attributes[:'integral_number']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'long')
|
209
|
+
self.long = attributes[:'long']
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.key?(:'missing_node')
|
213
|
+
self.missing_node = attributes[:'missing_node']
|
214
|
+
end
|
215
|
+
|
216
|
+
if attributes.key?(:'node_type')
|
217
|
+
self.node_type = attributes[:'node_type']
|
218
|
+
end
|
219
|
+
|
220
|
+
if attributes.key?(:'null')
|
221
|
+
self.null = attributes[:'null']
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'number')
|
225
|
+
self.number = attributes[:'number']
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'object')
|
229
|
+
self.object = attributes[:'object']
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'pojo')
|
233
|
+
self.pojo = attributes[:'pojo']
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'short')
|
237
|
+
self.short = attributes[:'short']
|
238
|
+
end
|
239
|
+
|
240
|
+
if attributes.key?(:'textual')
|
241
|
+
self.textual = attributes[:'textual']
|
242
|
+
end
|
243
|
+
|
244
|
+
if attributes.key?(:'value_node')
|
245
|
+
self.value_node = attributes[:'value_node']
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
250
|
+
# @return Array for valid properties with the reasons
|
251
|
+
def list_invalid_properties
|
252
|
+
invalid_properties = Array.new
|
253
|
+
invalid_properties
|
254
|
+
end
|
255
|
+
|
256
|
+
# Check to see if the all the properties in the model are valid
|
257
|
+
# @return true if the model is valid
|
258
|
+
def valid?
|
259
|
+
node_type_validator = EnumAttributeValidator.new('String', ["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"])
|
260
|
+
return false unless node_type_validator.valid?(@node_type)
|
261
|
+
true
|
262
|
+
end
|
263
|
+
|
264
|
+
# Custom attribute writer method checking allowed values (enum).
|
265
|
+
# @param [Object] node_type Object to be assigned
|
266
|
+
def node_type=(node_type)
|
267
|
+
validator = EnumAttributeValidator.new('String', ["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"])
|
268
|
+
unless validator.valid?(node_type)
|
269
|
+
fail ArgumentError, "invalid value for \"node_type\", must be one of #{validator.allowable_values}."
|
270
|
+
end
|
271
|
+
@node_type = node_type
|
272
|
+
end
|
273
|
+
|
274
|
+
# Checks equality by comparing each attribute.
|
275
|
+
# @param [Object] Object to be compared
|
276
|
+
def ==(o)
|
277
|
+
return true if self.equal?(o)
|
278
|
+
self.class == o.class &&
|
279
|
+
array == o.array &&
|
280
|
+
big_decimal == o.big_decimal &&
|
281
|
+
big_integer == o.big_integer &&
|
282
|
+
binary == o.binary &&
|
283
|
+
boolean == o.boolean &&
|
284
|
+
container_node == o.container_node &&
|
285
|
+
double == o.double &&
|
286
|
+
empty == o.empty &&
|
287
|
+
float == o.float &&
|
288
|
+
floating_point_number == o.floating_point_number &&
|
289
|
+
int == o.int &&
|
290
|
+
integral_number == o.integral_number &&
|
291
|
+
long == o.long &&
|
292
|
+
missing_node == o.missing_node &&
|
293
|
+
node_type == o.node_type &&
|
294
|
+
null == o.null &&
|
295
|
+
number == o.number &&
|
296
|
+
object == o.object &&
|
297
|
+
pojo == o.pojo &&
|
298
|
+
short == o.short &&
|
299
|
+
textual == o.textual &&
|
300
|
+
value_node == o.value_node
|
301
|
+
end
|
302
|
+
|
303
|
+
# @see the `==` method
|
304
|
+
# @param [Object] Object to be compared
|
305
|
+
def eql?(o)
|
306
|
+
self == o
|
307
|
+
end
|
308
|
+
|
309
|
+
# Calculates hash code according to all attributes.
|
310
|
+
# @return [Integer] Hash code
|
311
|
+
def hash
|
312
|
+
[array, big_decimal, big_integer, binary, boolean, container_node, double, empty, float, floating_point_number, int, integral_number, long, missing_node, node_type, null, number, object, pojo, short, textual, value_node].hash
|
313
|
+
end
|
314
|
+
|
315
|
+
# Builds the object from hash
|
316
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
317
|
+
# @return [Object] Returns the model itself
|
318
|
+
def self.build_from_hash(attributes)
|
319
|
+
new.build_from_hash(attributes)
|
320
|
+
end
|
321
|
+
|
322
|
+
# Builds the object from hash
|
323
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
324
|
+
# @return [Object] Returns the model itself
|
325
|
+
def build_from_hash(attributes)
|
326
|
+
return nil unless attributes.is_a?(Hash)
|
327
|
+
self.class.openapi_types.each_pair do |key, type|
|
328
|
+
if type =~ /\AArray<(.*)>/i
|
329
|
+
# check to ensure the input is an array given that the attribute
|
330
|
+
# is documented as an array but the input is not
|
331
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
332
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
333
|
+
end
|
334
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
335
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
336
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
337
|
+
end
|
338
|
+
|
339
|
+
self
|
340
|
+
end
|
341
|
+
|
342
|
+
# Deserializes the data based on type
|
343
|
+
# @param string type Data type
|
344
|
+
# @param string value Value to be deserialized
|
345
|
+
# @return [Object] Deserialized data
|
346
|
+
def _deserialize(type, value)
|
347
|
+
case type.to_sym
|
348
|
+
when :DateTime
|
349
|
+
DateTime.parse(value)
|
350
|
+
when :Date
|
351
|
+
Date.parse(value)
|
352
|
+
when :String
|
353
|
+
value.to_s
|
354
|
+
when :Integer
|
355
|
+
value.to_i
|
356
|
+
when :Float
|
357
|
+
value.to_f
|
358
|
+
when :Boolean
|
359
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
360
|
+
true
|
361
|
+
else
|
362
|
+
false
|
363
|
+
end
|
364
|
+
when :Object
|
365
|
+
# generic object (usually a Hash), return directly
|
366
|
+
value
|
367
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
368
|
+
inner_type = Regexp.last_match[:inner_type]
|
369
|
+
value.map { |v| _deserialize(inner_type, v) }
|
370
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
371
|
+
k_type = Regexp.last_match[:k_type]
|
372
|
+
v_type = Regexp.last_match[:v_type]
|
373
|
+
{}.tap do |hash|
|
374
|
+
value.each do |k, v|
|
375
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
376
|
+
end
|
377
|
+
end
|
378
|
+
else # model
|
379
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
# Returns the string representation of the object
|
384
|
+
# @return [String] String presentation of the object
|
385
|
+
def to_s
|
386
|
+
to_hash.to_s
|
387
|
+
end
|
388
|
+
|
389
|
+
# to_body is an alias to to_hash (backward compatibility)
|
390
|
+
# @return [Hash] Returns the object in the form of hash
|
391
|
+
def to_body
|
392
|
+
to_hash
|
393
|
+
end
|
394
|
+
|
395
|
+
# Returns the object in the form of hash
|
396
|
+
# @return [Hash] Returns the object in the form of hash
|
397
|
+
def to_hash
|
398
|
+
hash = {}
|
399
|
+
self.class.attribute_map.each_pair do |attr, param|
|
400
|
+
value = self.send(attr)
|
401
|
+
if value.nil?
|
402
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
403
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
404
|
+
end
|
405
|
+
|
406
|
+
hash[param] = _to_hash(value)
|
407
|
+
end
|
408
|
+
hash
|
409
|
+
end
|
410
|
+
|
411
|
+
# Outputs non-array value in the form of hash
|
412
|
+
# For object, use to_hash. Otherwise, just return the value
|
413
|
+
# @param [Object] value Any valid value
|
414
|
+
# @return [Hash] Returns the value in the form of hash
|
415
|
+
def _to_hash(value)
|
416
|
+
if value.is_a?(Array)
|
417
|
+
value.compact.map { |v| _to_hash(v) }
|
418
|
+
elsif value.is_a?(Hash)
|
419
|
+
{}.tap do |hash|
|
420
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
421
|
+
end
|
422
|
+
elsif value.respond_to? :to_hash
|
423
|
+
value.to_hash
|
424
|
+
else
|
425
|
+
value
|
426
|
+
end
|
427
|
+
end
|
428
|
+
end
|
429
|
+
end
|
@@ -1,26 +1,27 @@
|
|
1
1
|
=begin
|
2
2
|
#MailSlurp API
|
3
3
|
|
4
|
-
#
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
|
5
7
|
|
6
|
-
OpenAPI spec version: 0.0.1-alpha
|
7
|
-
Contact: contact@mailslurp.dev
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module MailSlurpClient
|
16
|
+
# Options for matching emails in an inbox. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `SUBJECT` should `CONTAIN` value.
|
16
17
|
class MatchOption
|
17
18
|
# The email property to match on. One of SUBJECT, TO, BCC, CC or FROM
|
18
19
|
attr_accessor :field
|
19
20
|
|
20
|
-
# What criteria to apply. CONTAIN or EQUAL. Note CONTAIN is recommended due to some SMTP servers adding new lines
|
21
|
+
# What criteria to apply. CONTAIN or EQUAL. Note CONTAIN is recommended due to some SMTP servers adding new lines to fields and body content.
|
21
22
|
attr_accessor :should
|
22
23
|
|
23
|
-
# The value to compare
|
24
|
+
# The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.
|
24
25
|
attr_accessor :value
|
25
26
|
|
26
27
|
class EnumAttributeValidator
|
@@ -63,23 +64,36 @@ module MailSlurpClient
|
|
63
64
|
}
|
64
65
|
end
|
65
66
|
|
67
|
+
# List of attributes with nullable: true
|
68
|
+
def self.openapi_nullable
|
69
|
+
Set.new([
|
70
|
+
])
|
71
|
+
end
|
72
|
+
|
66
73
|
# Initializes the object
|
67
74
|
# @param [Hash] attributes Model attributes in the form of hash
|
68
75
|
def initialize(attributes = {})
|
69
|
-
|
76
|
+
if (!attributes.is_a?(Hash))
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::MatchOption` initialize method"
|
78
|
+
end
|
70
79
|
|
71
|
-
# convert string to symbol for hash key
|
72
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::MatchOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
84
|
+
end
|
85
|
+
h[k.to_sym] = v
|
86
|
+
}
|
73
87
|
|
74
|
-
if attributes.
|
88
|
+
if attributes.key?(:'field')
|
75
89
|
self.field = attributes[:'field']
|
76
90
|
end
|
77
91
|
|
78
|
-
if attributes.
|
92
|
+
if attributes.key?(:'should')
|
79
93
|
self.should = attributes[:'should']
|
80
94
|
end
|
81
95
|
|
82
|
-
if attributes.
|
96
|
+
if attributes.key?(:'value')
|
83
97
|
self.value = attributes[:'value']
|
84
98
|
end
|
85
99
|
end
|
@@ -94,9 +108,9 @@ module MailSlurpClient
|
|
94
108
|
# Check to see if the all the properties in the model are valid
|
95
109
|
# @return true if the model is valid
|
96
110
|
def valid?
|
97
|
-
field_validator = EnumAttributeValidator.new('String', [
|
111
|
+
field_validator = EnumAttributeValidator.new('String', ["SUBJECT", "TO", "BCC", "CC", "FROM"])
|
98
112
|
return false unless field_validator.valid?(@field)
|
99
|
-
should_validator = EnumAttributeValidator.new('String', [
|
113
|
+
should_validator = EnumAttributeValidator.new('String', ["CONTAIN", "EQUAL"])
|
100
114
|
return false unless should_validator.valid?(@should)
|
101
115
|
true
|
102
116
|
end
|
@@ -104,9 +118,9 @@ module MailSlurpClient
|
|
104
118
|
# Custom attribute writer method checking allowed values (enum).
|
105
119
|
# @param [Object] field Object to be assigned
|
106
120
|
def field=(field)
|
107
|
-
validator = EnumAttributeValidator.new('String', [
|
121
|
+
validator = EnumAttributeValidator.new('String', ["SUBJECT", "TO", "BCC", "CC", "FROM"])
|
108
122
|
unless validator.valid?(field)
|
109
|
-
fail ArgumentError,
|
123
|
+
fail ArgumentError, "invalid value for \"field\", must be one of #{validator.allowable_values}."
|
110
124
|
end
|
111
125
|
@field = field
|
112
126
|
end
|
@@ -114,9 +128,9 @@ module MailSlurpClient
|
|
114
128
|
# Custom attribute writer method checking allowed values (enum).
|
115
129
|
# @param [Object] should Object to be assigned
|
116
130
|
def should=(should)
|
117
|
-
validator = EnumAttributeValidator.new('String', [
|
131
|
+
validator = EnumAttributeValidator.new('String', ["CONTAIN", "EQUAL"])
|
118
132
|
unless validator.valid?(should)
|
119
|
-
fail ArgumentError,
|
133
|
+
fail ArgumentError, "invalid value for \"should\", must be one of #{validator.allowable_values}."
|
120
134
|
end
|
121
135
|
@should = should
|
122
136
|
end
|
@@ -138,11 +152,18 @@ module MailSlurpClient
|
|
138
152
|
end
|
139
153
|
|
140
154
|
# Calculates hash code according to all attributes.
|
141
|
-
# @return [
|
155
|
+
# @return [Integer] Hash code
|
142
156
|
def hash
|
143
157
|
[field, should, value].hash
|
144
158
|
end
|
145
159
|
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def self.build_from_hash(attributes)
|
164
|
+
new.build_from_hash(attributes)
|
165
|
+
end
|
166
|
+
|
146
167
|
# Builds the object from hash
|
147
168
|
# @param [Hash] attributes Model attributes in the form of hash
|
148
169
|
# @return [Object] Returns the model itself
|
@@ -150,7 +171,7 @@ module MailSlurpClient
|
|
150
171
|
return nil unless attributes.is_a?(Hash)
|
151
172
|
self.class.openapi_types.each_pair do |key, type|
|
152
173
|
if type =~ /\AArray<(.*)>/i
|
153
|
-
# check to ensure the input is an array given that the
|
174
|
+
# check to ensure the input is an array given that the attribute
|
154
175
|
# is documented as an array but the input is not
|
155
176
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
156
177
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -179,7 +200,7 @@ module MailSlurpClient
|
|
179
200
|
value.to_i
|
180
201
|
when :Float
|
181
202
|
value.to_f
|
182
|
-
when :
|
203
|
+
when :Boolean
|
183
204
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
184
205
|
true
|
185
206
|
else
|
@@ -200,8 +221,7 @@ module MailSlurpClient
|
|
200
221
|
end
|
201
222
|
end
|
202
223
|
else # model
|
203
|
-
|
204
|
-
temp_model.build_from_hash(value)
|
224
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
205
225
|
end
|
206
226
|
end
|
207
227
|
|
@@ -223,7 +243,11 @@ module MailSlurpClient
|
|
223
243
|
hash = {}
|
224
244
|
self.class.attribute_map.each_pair do |attr, param|
|
225
245
|
value = self.send(attr)
|
226
|
-
|
246
|
+
if value.nil?
|
247
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
248
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
249
|
+
end
|
250
|
+
|
227
251
|
hash[param] = _to_hash(value)
|
228
252
|
end
|
229
253
|
hash
|