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