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
@@ -1,12 +1,12 @@
|
|
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
|
|
@@ -15,21 +15,44 @@ require 'date'
|
|
15
15
|
module MailSlurpClient
|
16
16
|
# Representation of an inbox with an email address. Emails can be sent to or from this email address.
|
17
17
|
class Inbox
|
18
|
-
|
18
|
+
# When was the inbox created
|
19
|
+
attr_accessor :created_at
|
20
|
+
|
21
|
+
# Optional description of an inbox for labelling purposes
|
22
|
+
attr_accessor :description
|
19
23
|
|
20
|
-
# The inbox's email address. Send an email to this address and the inbox will receive it
|
24
|
+
# The inbox's email address. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints.
|
21
25
|
attr_accessor :email_address
|
22
26
|
|
27
|
+
# When, if ever, will the inbox expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted.
|
28
|
+
attr_accessor :expires_at
|
29
|
+
|
30
|
+
# Is the inbox favourited
|
31
|
+
attr_accessor :favourite
|
32
|
+
|
33
|
+
# ID of the inbox
|
23
34
|
attr_accessor :id
|
24
35
|
|
36
|
+
# Optional name of the inbox. Displayed in the dashboard for easier search
|
37
|
+
attr_accessor :name
|
38
|
+
|
39
|
+
# Tags that inbox has been tagged with
|
40
|
+
attr_accessor :tags
|
41
|
+
|
42
|
+
# ID of user that inbox belongs to
|
25
43
|
attr_accessor :user_id
|
26
44
|
|
27
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
28
46
|
def self.attribute_map
|
29
47
|
{
|
30
|
-
:'
|
48
|
+
:'created_at' => :'createdAt',
|
49
|
+
:'description' => :'description',
|
31
50
|
:'email_address' => :'emailAddress',
|
51
|
+
:'expires_at' => :'expiresAt',
|
52
|
+
:'favourite' => :'favourite',
|
32
53
|
:'id' => :'id',
|
54
|
+
:'name' => :'name',
|
55
|
+
:'tags' => :'tags',
|
33
56
|
:'user_id' => :'userId'
|
34
57
|
}
|
35
58
|
end
|
@@ -37,35 +60,75 @@ module MailSlurpClient
|
|
37
60
|
# Attribute type mapping.
|
38
61
|
def self.openapi_types
|
39
62
|
{
|
40
|
-
:'
|
63
|
+
:'created_at' => :'DateTime',
|
64
|
+
:'description' => :'String',
|
41
65
|
:'email_address' => :'String',
|
66
|
+
:'expires_at' => :'DateTime',
|
67
|
+
:'favourite' => :'Boolean',
|
42
68
|
:'id' => :'String',
|
69
|
+
:'name' => :'String',
|
70
|
+
:'tags' => :'Array<String>',
|
43
71
|
:'user_id' => :'String'
|
44
72
|
}
|
45
73
|
end
|
46
74
|
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.openapi_nullable
|
77
|
+
Set.new([
|
78
|
+
])
|
79
|
+
end
|
80
|
+
|
47
81
|
# Initializes the object
|
48
82
|
# @param [Hash] attributes Model attributes in the form of hash
|
49
83
|
def initialize(attributes = {})
|
50
|
-
|
84
|
+
if (!attributes.is_a?(Hash))
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::Inbox` initialize method"
|
86
|
+
end
|
87
|
+
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
90
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::Inbox`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
92
|
+
end
|
93
|
+
h[k.to_sym] = v
|
94
|
+
}
|
95
|
+
|
96
|
+
if attributes.key?(:'created_at')
|
97
|
+
self.created_at = attributes[:'created_at']
|
98
|
+
end
|
51
99
|
|
52
|
-
|
53
|
-
|
100
|
+
if attributes.key?(:'description')
|
101
|
+
self.description = attributes[:'description']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'email_address')
|
105
|
+
self.email_address = attributes[:'email_address']
|
106
|
+
end
|
54
107
|
|
55
|
-
if attributes.
|
56
|
-
self.
|
108
|
+
if attributes.key?(:'expires_at')
|
109
|
+
self.expires_at = attributes[:'expires_at']
|
57
110
|
end
|
58
111
|
|
59
|
-
if attributes.
|
60
|
-
self.
|
112
|
+
if attributes.key?(:'favourite')
|
113
|
+
self.favourite = attributes[:'favourite']
|
61
114
|
end
|
62
115
|
|
63
|
-
if attributes.
|
116
|
+
if attributes.key?(:'id')
|
64
117
|
self.id = attributes[:'id']
|
65
118
|
end
|
66
119
|
|
67
|
-
if attributes.
|
68
|
-
self.
|
120
|
+
if attributes.key?(:'name')
|
121
|
+
self.name = attributes[:'name']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'tags')
|
125
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
126
|
+
self.tags = value
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'user_id')
|
131
|
+
self.user_id = attributes[:'user_id']
|
69
132
|
end
|
70
133
|
end
|
71
134
|
|
@@ -87,9 +150,14 @@ module MailSlurpClient
|
|
87
150
|
def ==(o)
|
88
151
|
return true if self.equal?(o)
|
89
152
|
self.class == o.class &&
|
90
|
-
|
153
|
+
created_at == o.created_at &&
|
154
|
+
description == o.description &&
|
91
155
|
email_address == o.email_address &&
|
156
|
+
expires_at == o.expires_at &&
|
157
|
+
favourite == o.favourite &&
|
92
158
|
id == o.id &&
|
159
|
+
name == o.name &&
|
160
|
+
tags == o.tags &&
|
93
161
|
user_id == o.user_id
|
94
162
|
end
|
95
163
|
|
@@ -100,9 +168,16 @@ module MailSlurpClient
|
|
100
168
|
end
|
101
169
|
|
102
170
|
# Calculates hash code according to all attributes.
|
103
|
-
# @return [
|
171
|
+
# @return [Integer] Hash code
|
104
172
|
def hash
|
105
|
-
[
|
173
|
+
[created_at, description, email_address, expires_at, favourite, id, name, tags, user_id].hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Builds the object from hash
|
177
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
178
|
+
# @return [Object] Returns the model itself
|
179
|
+
def self.build_from_hash(attributes)
|
180
|
+
new.build_from_hash(attributes)
|
106
181
|
end
|
107
182
|
|
108
183
|
# Builds the object from hash
|
@@ -112,7 +187,7 @@ module MailSlurpClient
|
|
112
187
|
return nil unless attributes.is_a?(Hash)
|
113
188
|
self.class.openapi_types.each_pair do |key, type|
|
114
189
|
if type =~ /\AArray<(.*)>/i
|
115
|
-
# check to ensure the input is an array given that the
|
190
|
+
# check to ensure the input is an array given that the attribute
|
116
191
|
# is documented as an array but the input is not
|
117
192
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
193
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -141,7 +216,7 @@ module MailSlurpClient
|
|
141
216
|
value.to_i
|
142
217
|
when :Float
|
143
218
|
value.to_f
|
144
|
-
when :
|
219
|
+
when :Boolean
|
145
220
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
146
221
|
true
|
147
222
|
else
|
@@ -162,8 +237,7 @@ module MailSlurpClient
|
|
162
237
|
end
|
163
238
|
end
|
164
239
|
else # model
|
165
|
-
|
166
|
-
temp_model.build_from_hash(value)
|
240
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
167
241
|
end
|
168
242
|
end
|
169
243
|
|
@@ -185,7 +259,11 @@ module MailSlurpClient
|
|
185
259
|
hash = {}
|
186
260
|
self.class.attribute_map.each_pair do |attr, param|
|
187
261
|
value = self.send(attr)
|
188
|
-
|
262
|
+
if value.nil?
|
263
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
264
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
265
|
+
end
|
266
|
+
|
189
267
|
hash[param] = _to_hash(value)
|
190
268
|
end
|
191
269
|
hash
|
@@ -0,0 +1,272 @@
|
|
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 InboxProjection
|
17
|
+
attr_accessor :created_at
|
18
|
+
|
19
|
+
attr_accessor :email_address
|
20
|
+
|
21
|
+
attr_accessor :expires_at
|
22
|
+
|
23
|
+
attr_accessor :favourite
|
24
|
+
|
25
|
+
attr_accessor :id
|
26
|
+
|
27
|
+
attr_accessor :name
|
28
|
+
|
29
|
+
attr_accessor :tags
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'created_at' => :'createdAt',
|
35
|
+
:'email_address' => :'emailAddress',
|
36
|
+
:'expires_at' => :'expiresAt',
|
37
|
+
:'favourite' => :'favourite',
|
38
|
+
:'id' => :'id',
|
39
|
+
:'name' => :'name',
|
40
|
+
:'tags' => :'tags'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'created_at' => :'DateTime',
|
48
|
+
:'email_address' => :'String',
|
49
|
+
:'expires_at' => :'DateTime',
|
50
|
+
:'favourite' => :'Boolean',
|
51
|
+
:'id' => :'String',
|
52
|
+
:'name' => :'String',
|
53
|
+
:'tags' => :'Array<String>'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of attributes with nullable: true
|
58
|
+
def self.openapi_nullable
|
59
|
+
Set.new([
|
60
|
+
])
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
65
|
+
def initialize(attributes = {})
|
66
|
+
if (!attributes.is_a?(Hash))
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::InboxProjection` initialize method"
|
68
|
+
end
|
69
|
+
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
72
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::InboxProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
74
|
+
end
|
75
|
+
h[k.to_sym] = v
|
76
|
+
}
|
77
|
+
|
78
|
+
if attributes.key?(:'created_at')
|
79
|
+
self.created_at = attributes[:'created_at']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'email_address')
|
83
|
+
self.email_address = attributes[:'email_address']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'expires_at')
|
87
|
+
self.expires_at = attributes[:'expires_at']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'favourite')
|
91
|
+
self.favourite = attributes[:'favourite']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'id')
|
95
|
+
self.id = attributes[:'id']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'name')
|
99
|
+
self.name = attributes[:'name']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'tags')
|
103
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
104
|
+
self.tags = value
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
110
|
+
# @return Array for valid properties with the reasons
|
111
|
+
def list_invalid_properties
|
112
|
+
invalid_properties = Array.new
|
113
|
+
if @created_at.nil?
|
114
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
115
|
+
end
|
116
|
+
|
117
|
+
if @id.nil?
|
118
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
119
|
+
end
|
120
|
+
|
121
|
+
invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
return false if @created_at.nil?
|
128
|
+
return false if @id.nil?
|
129
|
+
true
|
130
|
+
end
|
131
|
+
|
132
|
+
# Checks equality by comparing each attribute.
|
133
|
+
# @param [Object] Object to be compared
|
134
|
+
def ==(o)
|
135
|
+
return true if self.equal?(o)
|
136
|
+
self.class == o.class &&
|
137
|
+
created_at == o.created_at &&
|
138
|
+
email_address == o.email_address &&
|
139
|
+
expires_at == o.expires_at &&
|
140
|
+
favourite == o.favourite &&
|
141
|
+
id == o.id &&
|
142
|
+
name == o.name &&
|
143
|
+
tags == o.tags
|
144
|
+
end
|
145
|
+
|
146
|
+
# @see the `==` method
|
147
|
+
# @param [Object] Object to be compared
|
148
|
+
def eql?(o)
|
149
|
+
self == o
|
150
|
+
end
|
151
|
+
|
152
|
+
# Calculates hash code according to all attributes.
|
153
|
+
# @return [Integer] Hash code
|
154
|
+
def hash
|
155
|
+
[created_at, email_address, expires_at, favourite, id, name, tags].hash
|
156
|
+
end
|
157
|
+
|
158
|
+
# Builds the object from hash
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
160
|
+
# @return [Object] Returns the model itself
|
161
|
+
def self.build_from_hash(attributes)
|
162
|
+
new.build_from_hash(attributes)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Builds the object from hash
|
166
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
167
|
+
# @return [Object] Returns the model itself
|
168
|
+
def build_from_hash(attributes)
|
169
|
+
return nil unless attributes.is_a?(Hash)
|
170
|
+
self.class.openapi_types.each_pair do |key, type|
|
171
|
+
if type =~ /\AArray<(.*)>/i
|
172
|
+
# check to ensure the input is an array given that the attribute
|
173
|
+
# is documented as an array but the input is not
|
174
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
175
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
176
|
+
end
|
177
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
178
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
179
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
180
|
+
end
|
181
|
+
|
182
|
+
self
|
183
|
+
end
|
184
|
+
|
185
|
+
# Deserializes the data based on type
|
186
|
+
# @param string type Data type
|
187
|
+
# @param string value Value to be deserialized
|
188
|
+
# @return [Object] Deserialized data
|
189
|
+
def _deserialize(type, value)
|
190
|
+
case type.to_sym
|
191
|
+
when :DateTime
|
192
|
+
DateTime.parse(value)
|
193
|
+
when :Date
|
194
|
+
Date.parse(value)
|
195
|
+
when :String
|
196
|
+
value.to_s
|
197
|
+
when :Integer
|
198
|
+
value.to_i
|
199
|
+
when :Float
|
200
|
+
value.to_f
|
201
|
+
when :Boolean
|
202
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
203
|
+
true
|
204
|
+
else
|
205
|
+
false
|
206
|
+
end
|
207
|
+
when :Object
|
208
|
+
# generic object (usually a Hash), return directly
|
209
|
+
value
|
210
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
211
|
+
inner_type = Regexp.last_match[:inner_type]
|
212
|
+
value.map { |v| _deserialize(inner_type, v) }
|
213
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
214
|
+
k_type = Regexp.last_match[:k_type]
|
215
|
+
v_type = Regexp.last_match[:v_type]
|
216
|
+
{}.tap do |hash|
|
217
|
+
value.each do |k, v|
|
218
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
else # model
|
222
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# Returns the string representation of the object
|
227
|
+
# @return [String] String presentation of the object
|
228
|
+
def to_s
|
229
|
+
to_hash.to_s
|
230
|
+
end
|
231
|
+
|
232
|
+
# to_body is an alias to to_hash (backward compatibility)
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
234
|
+
def to_body
|
235
|
+
to_hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Returns the object in the form of hash
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
240
|
+
def to_hash
|
241
|
+
hash = {}
|
242
|
+
self.class.attribute_map.each_pair do |attr, param|
|
243
|
+
value = self.send(attr)
|
244
|
+
if value.nil?
|
245
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
246
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
247
|
+
end
|
248
|
+
|
249
|
+
hash[param] = _to_hash(value)
|
250
|
+
end
|
251
|
+
hash
|
252
|
+
end
|
253
|
+
|
254
|
+
# Outputs non-array value in the form of hash
|
255
|
+
# For object, use to_hash. Otherwise, just return the value
|
256
|
+
# @param [Object] value Any valid value
|
257
|
+
# @return [Hash] Returns the value in the form of hash
|
258
|
+
def _to_hash(value)
|
259
|
+
if value.is_a?(Array)
|
260
|
+
value.compact.map { |v| _to_hash(v) }
|
261
|
+
elsif value.is_a?(Hash)
|
262
|
+
{}.tap do |hash|
|
263
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
264
|
+
end
|
265
|
+
elsif value.respond_to? :to_hash
|
266
|
+
value.to_hash
|
267
|
+
else
|
268
|
+
value
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|