mailslurp_client 8.2.10 → 8.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailslurp_client.rb +3 -0
- data/lib/mailslurp_client/api/email_controller_api.rb +70 -0
- data/lib/mailslurp_client/api/inbox_controller_api.rb +68 -2
- data/lib/mailslurp_client/models/content_match_options.rb +208 -0
- data/lib/mailslurp_client/models/email_content_match_result.rb +228 -0
- data/lib/mailslurp_client/models/raw_email_json.rb +1 -0
- data/lib/mailslurp_client/models/sent_email.rb +360 -0
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a40608cc8ee70cfd122f80fababa6cad2e55bab5bcca6f96212bd63a13502961
|
4
|
+
data.tar.gz: 94ee3ff4be8b1d07e049ec5dccfcd47609c5b1767e22f14b3ce11f959b0909b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84c3e53059f5a0d9fab85eff31f7eb70b87f241c47be0cdb681f3b378f7975e277b5d973071d4a375733113aab280f50ffe851cc03c7b533a801f6c41a3f4086
|
7
|
+
data.tar.gz: b0279d78a93d3cf3692b99e04387e89239e18804fe8b2cbcb59ed216f72421705904571ecb8c7cab15e7a9781ce4c8feacfc8326251e3cc529fa0f20dda1b7b7
|
data/lib/mailslurp_client.rb
CHANGED
@@ -22,6 +22,7 @@ require 'mailslurp_client/models/basic_auth_options'
|
|
22
22
|
require 'mailslurp_client/models/bulk_send_email_options'
|
23
23
|
require 'mailslurp_client/models/contact_dto'
|
24
24
|
require 'mailslurp_client/models/contact_projection'
|
25
|
+
require 'mailslurp_client/models/content_match_options'
|
25
26
|
require 'mailslurp_client/models/create_anonymous_alias_options'
|
26
27
|
require 'mailslurp_client/models/create_contact_options'
|
27
28
|
require 'mailslurp_client/models/create_domain_options'
|
@@ -36,6 +37,7 @@ require 'mailslurp_client/models/domain_preview'
|
|
36
37
|
require 'mailslurp_client/models/download_attachment_dto'
|
37
38
|
require 'mailslurp_client/models/email'
|
38
39
|
require 'mailslurp_client/models/email_analysis'
|
40
|
+
require 'mailslurp_client/models/email_content_match_result'
|
39
41
|
require 'mailslurp_client/models/email_preview'
|
40
42
|
require 'mailslurp_client/models/email_projection'
|
41
43
|
require 'mailslurp_client/models/email_verification_result'
|
@@ -62,6 +64,7 @@ require 'mailslurp_client/models/page_webhook_projection'
|
|
62
64
|
require 'mailslurp_client/models/pageable'
|
63
65
|
require 'mailslurp_client/models/raw_email_json'
|
64
66
|
require 'mailslurp_client/models/send_email_options'
|
67
|
+
require 'mailslurp_client/models/sent_email'
|
65
68
|
require 'mailslurp_client/models/sent_email_dto'
|
66
69
|
require 'mailslurp_client/models/sent_email_projection'
|
67
70
|
require 'mailslurp_client/models/set_inbox_favourited_options'
|
@@ -535,6 +535,76 @@ module MailSlurpClient
|
|
535
535
|
return data, status_code, headers
|
536
536
|
end
|
537
537
|
|
538
|
+
# Get email content regex pattern match results. Runs regex against email body and returns match groups.
|
539
|
+
# Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
|
540
|
+
# @param email_id [String] ID of email to match against
|
541
|
+
# @param content_match_options [ContentMatchOptions] contentMatchOptions
|
542
|
+
# @param [Hash] opts the optional parameters
|
543
|
+
# @return [EmailContentMatchResult]
|
544
|
+
def get_email_content_match(email_id, content_match_options, opts = {})
|
545
|
+
data, _status_code, _headers = get_email_content_match_with_http_info(email_id, content_match_options, opts)
|
546
|
+
data
|
547
|
+
end
|
548
|
+
|
549
|
+
# Get email content regex pattern match results. Runs regex against email body and returns match groups.
|
550
|
+
# Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
|
551
|
+
# @param email_id [String] ID of email to match against
|
552
|
+
# @param content_match_options [ContentMatchOptions] contentMatchOptions
|
553
|
+
# @param [Hash] opts the optional parameters
|
554
|
+
# @return [Array<(EmailContentMatchResult, Integer, Hash)>] EmailContentMatchResult data, response status code and response headers
|
555
|
+
def get_email_content_match_with_http_info(email_id, content_match_options, opts = {})
|
556
|
+
if @api_client.config.debugging
|
557
|
+
@api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_content_match ...'
|
558
|
+
end
|
559
|
+
# verify the required parameter 'email_id' is set
|
560
|
+
if @api_client.config.client_side_validation && email_id.nil?
|
561
|
+
fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_content_match"
|
562
|
+
end
|
563
|
+
# verify the required parameter 'content_match_options' is set
|
564
|
+
if @api_client.config.client_side_validation && content_match_options.nil?
|
565
|
+
fail ArgumentError, "Missing the required parameter 'content_match_options' when calling EmailControllerApi.get_email_content_match"
|
566
|
+
end
|
567
|
+
# resource path
|
568
|
+
local_var_path = '/emails/{emailId}/contentMatch'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
|
569
|
+
|
570
|
+
# query parameters
|
571
|
+
query_params = opts[:query_params] || {}
|
572
|
+
|
573
|
+
# header parameters
|
574
|
+
header_params = opts[:header_params] || {}
|
575
|
+
# HTTP header 'Accept' (if needed)
|
576
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
577
|
+
# HTTP header 'Content-Type'
|
578
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
579
|
+
|
580
|
+
# form parameters
|
581
|
+
form_params = opts[:form_params] || {}
|
582
|
+
|
583
|
+
# http body (model)
|
584
|
+
post_body = opts[:body] || @api_client.object_to_http_body(content_match_options)
|
585
|
+
|
586
|
+
# return_type
|
587
|
+
return_type = opts[:return_type] || 'EmailContentMatchResult'
|
588
|
+
|
589
|
+
# auth_names
|
590
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
591
|
+
|
592
|
+
new_options = opts.merge(
|
593
|
+
:header_params => header_params,
|
594
|
+
:query_params => query_params,
|
595
|
+
:form_params => form_params,
|
596
|
+
:body => post_body,
|
597
|
+
:auth_names => auth_names,
|
598
|
+
:return_type => return_type
|
599
|
+
)
|
600
|
+
|
601
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
602
|
+
if @api_client.config.debugging
|
603
|
+
@api_client.config.logger.debug "API called: EmailControllerApi#get_email_content_match\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
604
|
+
end
|
605
|
+
return data, status_code, headers
|
606
|
+
end
|
607
|
+
|
538
608
|
# Get email content as HTML
|
539
609
|
# Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`
|
540
610
|
# @param email_id [String] emailId
|
@@ -691,7 +691,7 @@ module MailSlurpClient
|
|
691
691
|
end
|
692
692
|
|
693
693
|
# Send Email
|
694
|
-
# Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails.
|
694
|
+
# Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`.
|
695
695
|
# @param inbox_id [String] ID of the inbox you want to send the email from
|
696
696
|
# @param [Hash] opts the optional parameters
|
697
697
|
# @option opts [SendEmailOptions] :send_email_options Options for the email
|
@@ -702,7 +702,7 @@ module MailSlurpClient
|
|
702
702
|
end
|
703
703
|
|
704
704
|
# Send Email
|
705
|
-
# Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails.
|
705
|
+
# Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`.
|
706
706
|
# @param inbox_id [String] ID of the inbox you want to send the email from
|
707
707
|
# @param [Hash] opts the optional parameters
|
708
708
|
# @option opts [SendEmailOptions] :send_email_options Options for the email
|
@@ -754,6 +754,72 @@ module MailSlurpClient
|
|
754
754
|
return data, status_code, headers
|
755
755
|
end
|
756
756
|
|
757
|
+
# Send email and return sent confirmation
|
758
|
+
# Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with link the the sent object created for it.
|
759
|
+
# @param inbox_id [String] ID of the inbox you want to send the email from
|
760
|
+
# @param [Hash] opts the optional parameters
|
761
|
+
# @option opts [SendEmailOptions] :send_email_options Options for the email
|
762
|
+
# @return [SentEmail]
|
763
|
+
def send_email_and_confirm(inbox_id, opts = {})
|
764
|
+
data, _status_code, _headers = send_email_and_confirm_with_http_info(inbox_id, opts)
|
765
|
+
data
|
766
|
+
end
|
767
|
+
|
768
|
+
# Send email and return sent confirmation
|
769
|
+
# Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with link the the sent object created for it.
|
770
|
+
# @param inbox_id [String] ID of the inbox you want to send the email from
|
771
|
+
# @param [Hash] opts the optional parameters
|
772
|
+
# @option opts [SendEmailOptions] :send_email_options Options for the email
|
773
|
+
# @return [Array<(SentEmail, Integer, Hash)>] SentEmail data, response status code and response headers
|
774
|
+
def send_email_and_confirm_with_http_info(inbox_id, opts = {})
|
775
|
+
if @api_client.config.debugging
|
776
|
+
@api_client.config.logger.debug 'Calling API: InboxControllerApi.send_email_and_confirm ...'
|
777
|
+
end
|
778
|
+
# verify the required parameter 'inbox_id' is set
|
779
|
+
if @api_client.config.client_side_validation && inbox_id.nil?
|
780
|
+
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.send_email_and_confirm"
|
781
|
+
end
|
782
|
+
# resource path
|
783
|
+
local_var_path = '/inboxes/{inboxId}/confirm'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
|
784
|
+
|
785
|
+
# query parameters
|
786
|
+
query_params = opts[:query_params] || {}
|
787
|
+
|
788
|
+
# header parameters
|
789
|
+
header_params = opts[:header_params] || {}
|
790
|
+
# HTTP header 'Accept' (if needed)
|
791
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
792
|
+
# HTTP header 'Content-Type'
|
793
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
794
|
+
|
795
|
+
# form parameters
|
796
|
+
form_params = opts[:form_params] || {}
|
797
|
+
|
798
|
+
# http body (model)
|
799
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options'])
|
800
|
+
|
801
|
+
# return_type
|
802
|
+
return_type = opts[:return_type] || 'SentEmail'
|
803
|
+
|
804
|
+
# auth_names
|
805
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
806
|
+
|
807
|
+
new_options = opts.merge(
|
808
|
+
:header_params => header_params,
|
809
|
+
:query_params => query_params,
|
810
|
+
:form_params => form_params,
|
811
|
+
:body => post_body,
|
812
|
+
:auth_names => auth_names,
|
813
|
+
:return_type => return_type
|
814
|
+
)
|
815
|
+
|
816
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
817
|
+
if @api_client.config.debugging
|
818
|
+
@api_client.config.logger.debug "API called: InboxControllerApi#send_email_and_confirm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
819
|
+
end
|
820
|
+
return data, status_code, headers
|
821
|
+
end
|
822
|
+
|
757
823
|
# Set inbox favourited state
|
758
824
|
# Set and return new favourite state for an inbox
|
759
825
|
# @param inbox_id [String] inboxId
|
@@ -0,0 +1,208 @@
|
|
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: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
# Options for matching content using regex patterns based on Java Pattern syntax
|
17
|
+
class ContentMatchOptions
|
18
|
+
# Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
|
19
|
+
attr_accessor :pattern
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'pattern' => :'pattern'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'pattern' => :'String'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
if (!attributes.is_a?(Hash))
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ContentMatchOptions` initialize method"
|
46
|
+
end
|
47
|
+
|
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::ContentMatchOptions`. 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
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:'pattern')
|
57
|
+
self.pattern = attributes[:'pattern']
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properties with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
pattern == o.pattern
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Integer] Hash code
|
90
|
+
def hash
|
91
|
+
[pattern].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def self.build_from_hash(attributes)
|
98
|
+
new.build_from_hash(attributes)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def build_from_hash(attributes)
|
105
|
+
return nil unless attributes.is_a?(Hash)
|
106
|
+
self.class.openapi_types.each_pair do |key, type|
|
107
|
+
if type =~ /\AArray<(.*)>/i
|
108
|
+
# check to ensure the input is an array given that the attribute
|
109
|
+
# is documented as an array but the input is not
|
110
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
112
|
+
end
|
113
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
114
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
115
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
116
|
+
end
|
117
|
+
|
118
|
+
self
|
119
|
+
end
|
120
|
+
|
121
|
+
# Deserializes the data based on type
|
122
|
+
# @param string type Data type
|
123
|
+
# @param string value Value to be deserialized
|
124
|
+
# @return [Object] Deserialized data
|
125
|
+
def _deserialize(type, value)
|
126
|
+
case type.to_sym
|
127
|
+
when :DateTime
|
128
|
+
DateTime.parse(value)
|
129
|
+
when :Date
|
130
|
+
Date.parse(value)
|
131
|
+
when :String
|
132
|
+
value.to_s
|
133
|
+
when :Integer
|
134
|
+
value.to_i
|
135
|
+
when :Float
|
136
|
+
value.to_f
|
137
|
+
when :Boolean
|
138
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
139
|
+
true
|
140
|
+
else
|
141
|
+
false
|
142
|
+
end
|
143
|
+
when :Object
|
144
|
+
# generic object (usually a Hash), return directly
|
145
|
+
value
|
146
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
147
|
+
inner_type = Regexp.last_match[:inner_type]
|
148
|
+
value.map { |v| _deserialize(inner_type, v) }
|
149
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
150
|
+
k_type = Regexp.last_match[:k_type]
|
151
|
+
v_type = Regexp.last_match[:v_type]
|
152
|
+
{}.tap do |hash|
|
153
|
+
value.each do |k, v|
|
154
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
else # model
|
158
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the string representation of the object
|
163
|
+
# @return [String] String presentation of the object
|
164
|
+
def to_s
|
165
|
+
to_hash.to_s
|
166
|
+
end
|
167
|
+
|
168
|
+
# to_body is an alias to to_hash (backward compatibility)
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_body
|
171
|
+
to_hash
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the object in the form of hash
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
176
|
+
def to_hash
|
177
|
+
hash = {}
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
179
|
+
value = self.send(attr)
|
180
|
+
if value.nil?
|
181
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
182
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
183
|
+
end
|
184
|
+
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map { |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
@@ -0,0 +1,228 @@
|
|
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: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
# Matches for the given pattern
|
17
|
+
class EmailContentMatchResult
|
18
|
+
attr_accessor :matches
|
19
|
+
|
20
|
+
attr_accessor :pattern
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'matches' => :'matches',
|
26
|
+
:'pattern' => :'pattern'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.openapi_types
|
32
|
+
{
|
33
|
+
:'matches' => :'Array<String>',
|
34
|
+
:'pattern' => :'String'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.openapi_nullable
|
40
|
+
Set.new([
|
41
|
+
])
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
if (!attributes.is_a?(Hash))
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailContentMatchResult` initialize method"
|
49
|
+
end
|
50
|
+
|
51
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailContentMatchResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
|
+
end
|
56
|
+
h[k.to_sym] = v
|
57
|
+
}
|
58
|
+
|
59
|
+
if attributes.key?(:'matches')
|
60
|
+
if (value = attributes[:'matches']).is_a?(Array)
|
61
|
+
self.matches = value
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.key?(:'pattern')
|
66
|
+
self.pattern = attributes[:'pattern']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properties with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
if @matches.nil?
|
75
|
+
invalid_properties.push('invalid value for "matches", matches cannot be nil.')
|
76
|
+
end
|
77
|
+
|
78
|
+
if @pattern.nil?
|
79
|
+
invalid_properties.push('invalid value for "pattern", pattern cannot be nil.')
|
80
|
+
end
|
81
|
+
|
82
|
+
invalid_properties
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check to see if the all the properties in the model are valid
|
86
|
+
# @return true if the model is valid
|
87
|
+
def valid?
|
88
|
+
return false if @matches.nil?
|
89
|
+
return false if @pattern.nil?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
matches == o.matches &&
|
99
|
+
pattern == o.pattern
|
100
|
+
end
|
101
|
+
|
102
|
+
# @see the `==` method
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def eql?(o)
|
105
|
+
self == o
|
106
|
+
end
|
107
|
+
|
108
|
+
# Calculates hash code according to all attributes.
|
109
|
+
# @return [Integer] Hash code
|
110
|
+
def hash
|
111
|
+
[matches, pattern].hash
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def self.build_from_hash(attributes)
|
118
|
+
new.build_from_hash(attributes)
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.openapi_types.each_pair do |key, type|
|
127
|
+
if type =~ /\AArray<(.*)>/i
|
128
|
+
# check to ensure the input is an array given that the attribute
|
129
|
+
# is documented as an array but the input is not
|
130
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
131
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
132
|
+
end
|
133
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
134
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
135
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
136
|
+
end
|
137
|
+
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Deserializes the data based on type
|
142
|
+
# @param string type Data type
|
143
|
+
# @param string value Value to be deserialized
|
144
|
+
# @return [Object] Deserialized data
|
145
|
+
def _deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :DateTime
|
148
|
+
DateTime.parse(value)
|
149
|
+
when :Date
|
150
|
+
Date.parse(value)
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :Boolean
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
# generic object (usually a Hash), return directly
|
165
|
+
value
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
172
|
+
{}.tap do |hash|
|
173
|
+
value.each do |k, v|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
else # model
|
178
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# Returns the string representation of the object
|
183
|
+
# @return [String] String presentation of the object
|
184
|
+
def to_s
|
185
|
+
to_hash.to_s
|
186
|
+
end
|
187
|
+
|
188
|
+
# to_body is an alias to to_hash (backward compatibility)
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
190
|
+
def to_body
|
191
|
+
to_hash
|
192
|
+
end
|
193
|
+
|
194
|
+
# Returns the object in the form of hash
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
196
|
+
def to_hash
|
197
|
+
hash = {}
|
198
|
+
self.class.attribute_map.each_pair do |attr, param|
|
199
|
+
value = self.send(attr)
|
200
|
+
if value.nil?
|
201
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
202
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
203
|
+
end
|
204
|
+
|
205
|
+
hash[param] = _to_hash(value)
|
206
|
+
end
|
207
|
+
hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Outputs non-array value in the form of hash
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
212
|
+
# @param [Object] value Any valid value
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
214
|
+
def _to_hash(value)
|
215
|
+
if value.is_a?(Array)
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
217
|
+
elsif value.is_a?(Hash)
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
220
|
+
end
|
221
|
+
elsif value.respond_to? :to_hash
|
222
|
+
value.to_hash
|
223
|
+
else
|
224
|
+
value
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
@@ -0,0 +1,360 @@
|
|
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: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
class SentEmail
|
17
|
+
attr_accessor :attachments
|
18
|
+
|
19
|
+
attr_accessor :bcc
|
20
|
+
|
21
|
+
attr_accessor :body_md5_hash
|
22
|
+
|
23
|
+
attr_accessor :body_s3_key
|
24
|
+
|
25
|
+
attr_accessor :cc
|
26
|
+
|
27
|
+
attr_accessor :charset
|
28
|
+
|
29
|
+
attr_accessor :created_at
|
30
|
+
|
31
|
+
attr_accessor :from
|
32
|
+
|
33
|
+
attr_accessor :id
|
34
|
+
|
35
|
+
attr_accessor :inbox_id
|
36
|
+
|
37
|
+
attr_accessor :is_html
|
38
|
+
|
39
|
+
attr_accessor :subject
|
40
|
+
|
41
|
+
attr_accessor :to
|
42
|
+
|
43
|
+
attr_accessor :updated_at
|
44
|
+
|
45
|
+
attr_accessor :user_id
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'attachments' => :'attachments',
|
51
|
+
:'bcc' => :'bcc',
|
52
|
+
:'body_md5_hash' => :'bodyMD5Hash',
|
53
|
+
:'body_s3_key' => :'bodyS3Key',
|
54
|
+
:'cc' => :'cc',
|
55
|
+
:'charset' => :'charset',
|
56
|
+
:'created_at' => :'createdAt',
|
57
|
+
:'from' => :'from',
|
58
|
+
:'id' => :'id',
|
59
|
+
:'inbox_id' => :'inboxId',
|
60
|
+
:'is_html' => :'isHTML',
|
61
|
+
:'subject' => :'subject',
|
62
|
+
:'to' => :'to',
|
63
|
+
:'updated_at' => :'updatedAt',
|
64
|
+
:'user_id' => :'userId'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.openapi_types
|
70
|
+
{
|
71
|
+
:'attachments' => :'Array<String>',
|
72
|
+
:'bcc' => :'Array<String>',
|
73
|
+
:'body_md5_hash' => :'String',
|
74
|
+
:'body_s3_key' => :'String',
|
75
|
+
:'cc' => :'Array<String>',
|
76
|
+
:'charset' => :'String',
|
77
|
+
:'created_at' => :'DateTime',
|
78
|
+
:'from' => :'String',
|
79
|
+
:'id' => :'String',
|
80
|
+
:'inbox_id' => :'String',
|
81
|
+
:'is_html' => :'Boolean',
|
82
|
+
:'subject' => :'String',
|
83
|
+
:'to' => :'Array<String>',
|
84
|
+
:'updated_at' => :'DateTime',
|
85
|
+
:'user_id' => :'String'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# List of attributes with nullable: true
|
90
|
+
def self.openapi_nullable
|
91
|
+
Set.new([
|
92
|
+
])
|
93
|
+
end
|
94
|
+
|
95
|
+
# Initializes the object
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
def initialize(attributes = {})
|
98
|
+
if (!attributes.is_a?(Hash))
|
99
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::SentEmail` initialize method"
|
100
|
+
end
|
101
|
+
|
102
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
103
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
104
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::SentEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
106
|
+
end
|
107
|
+
h[k.to_sym] = v
|
108
|
+
}
|
109
|
+
|
110
|
+
if attributes.key?(:'attachments')
|
111
|
+
if (value = attributes[:'attachments']).is_a?(Array)
|
112
|
+
self.attachments = value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'bcc')
|
117
|
+
if (value = attributes[:'bcc']).is_a?(Array)
|
118
|
+
self.bcc = value
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'body_md5_hash')
|
123
|
+
self.body_md5_hash = attributes[:'body_md5_hash']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'body_s3_key')
|
127
|
+
self.body_s3_key = attributes[:'body_s3_key']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'cc')
|
131
|
+
if (value = attributes[:'cc']).is_a?(Array)
|
132
|
+
self.cc = value
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'charset')
|
137
|
+
self.charset = attributes[:'charset']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'created_at')
|
141
|
+
self.created_at = attributes[:'created_at']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'from')
|
145
|
+
self.from = attributes[:'from']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'id')
|
149
|
+
self.id = attributes[:'id']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'inbox_id')
|
153
|
+
self.inbox_id = attributes[:'inbox_id']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'is_html')
|
157
|
+
self.is_html = attributes[:'is_html']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'subject')
|
161
|
+
self.subject = attributes[:'subject']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'to')
|
165
|
+
if (value = attributes[:'to']).is_a?(Array)
|
166
|
+
self.to = value
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.key?(:'updated_at')
|
171
|
+
self.updated_at = attributes[:'updated_at']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.key?(:'user_id')
|
175
|
+
self.user_id = attributes[:'user_id']
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
180
|
+
# @return Array for valid properties with the reasons
|
181
|
+
def list_invalid_properties
|
182
|
+
invalid_properties = Array.new
|
183
|
+
if @created_at.nil?
|
184
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
185
|
+
end
|
186
|
+
|
187
|
+
if @inbox_id.nil?
|
188
|
+
invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
|
189
|
+
end
|
190
|
+
|
191
|
+
if @updated_at.nil?
|
192
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
193
|
+
end
|
194
|
+
|
195
|
+
if @user_id.nil?
|
196
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
197
|
+
end
|
198
|
+
|
199
|
+
invalid_properties
|
200
|
+
end
|
201
|
+
|
202
|
+
# Check to see if the all the properties in the model are valid
|
203
|
+
# @return true if the model is valid
|
204
|
+
def valid?
|
205
|
+
return false if @created_at.nil?
|
206
|
+
return false if @inbox_id.nil?
|
207
|
+
return false if @updated_at.nil?
|
208
|
+
return false if @user_id.nil?
|
209
|
+
true
|
210
|
+
end
|
211
|
+
|
212
|
+
# Checks equality by comparing each attribute.
|
213
|
+
# @param [Object] Object to be compared
|
214
|
+
def ==(o)
|
215
|
+
return true if self.equal?(o)
|
216
|
+
self.class == o.class &&
|
217
|
+
attachments == o.attachments &&
|
218
|
+
bcc == o.bcc &&
|
219
|
+
body_md5_hash == o.body_md5_hash &&
|
220
|
+
body_s3_key == o.body_s3_key &&
|
221
|
+
cc == o.cc &&
|
222
|
+
charset == o.charset &&
|
223
|
+
created_at == o.created_at &&
|
224
|
+
from == o.from &&
|
225
|
+
id == o.id &&
|
226
|
+
inbox_id == o.inbox_id &&
|
227
|
+
is_html == o.is_html &&
|
228
|
+
subject == o.subject &&
|
229
|
+
to == o.to &&
|
230
|
+
updated_at == o.updated_at &&
|
231
|
+
user_id == o.user_id
|
232
|
+
end
|
233
|
+
|
234
|
+
# @see the `==` method
|
235
|
+
# @param [Object] Object to be compared
|
236
|
+
def eql?(o)
|
237
|
+
self == o
|
238
|
+
end
|
239
|
+
|
240
|
+
# Calculates hash code according to all attributes.
|
241
|
+
# @return [Integer] Hash code
|
242
|
+
def hash
|
243
|
+
[attachments, bcc, body_md5_hash, body_s3_key, cc, charset, created_at, from, id, inbox_id, is_html, subject, to, updated_at, user_id].hash
|
244
|
+
end
|
245
|
+
|
246
|
+
# Builds the object from hash
|
247
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
248
|
+
# @return [Object] Returns the model itself
|
249
|
+
def self.build_from_hash(attributes)
|
250
|
+
new.build_from_hash(attributes)
|
251
|
+
end
|
252
|
+
|
253
|
+
# Builds the object from hash
|
254
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
255
|
+
# @return [Object] Returns the model itself
|
256
|
+
def build_from_hash(attributes)
|
257
|
+
return nil unless attributes.is_a?(Hash)
|
258
|
+
self.class.openapi_types.each_pair do |key, type|
|
259
|
+
if type =~ /\AArray<(.*)>/i
|
260
|
+
# check to ensure the input is an array given that the attribute
|
261
|
+
# is documented as an array but the input is not
|
262
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
263
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
264
|
+
end
|
265
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
266
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
267
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
268
|
+
end
|
269
|
+
|
270
|
+
self
|
271
|
+
end
|
272
|
+
|
273
|
+
# Deserializes the data based on type
|
274
|
+
# @param string type Data type
|
275
|
+
# @param string value Value to be deserialized
|
276
|
+
# @return [Object] Deserialized data
|
277
|
+
def _deserialize(type, value)
|
278
|
+
case type.to_sym
|
279
|
+
when :DateTime
|
280
|
+
DateTime.parse(value)
|
281
|
+
when :Date
|
282
|
+
Date.parse(value)
|
283
|
+
when :String
|
284
|
+
value.to_s
|
285
|
+
when :Integer
|
286
|
+
value.to_i
|
287
|
+
when :Float
|
288
|
+
value.to_f
|
289
|
+
when :Boolean
|
290
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
291
|
+
true
|
292
|
+
else
|
293
|
+
false
|
294
|
+
end
|
295
|
+
when :Object
|
296
|
+
# generic object (usually a Hash), return directly
|
297
|
+
value
|
298
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
299
|
+
inner_type = Regexp.last_match[:inner_type]
|
300
|
+
value.map { |v| _deserialize(inner_type, v) }
|
301
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
302
|
+
k_type = Regexp.last_match[:k_type]
|
303
|
+
v_type = Regexp.last_match[:v_type]
|
304
|
+
{}.tap do |hash|
|
305
|
+
value.each do |k, v|
|
306
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
307
|
+
end
|
308
|
+
end
|
309
|
+
else # model
|
310
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
# Returns the string representation of the object
|
315
|
+
# @return [String] String presentation of the object
|
316
|
+
def to_s
|
317
|
+
to_hash.to_s
|
318
|
+
end
|
319
|
+
|
320
|
+
# to_body is an alias to to_hash (backward compatibility)
|
321
|
+
# @return [Hash] Returns the object in the form of hash
|
322
|
+
def to_body
|
323
|
+
to_hash
|
324
|
+
end
|
325
|
+
|
326
|
+
# Returns the object in the form of hash
|
327
|
+
# @return [Hash] Returns the object in the form of hash
|
328
|
+
def to_hash
|
329
|
+
hash = {}
|
330
|
+
self.class.attribute_map.each_pair do |attr, param|
|
331
|
+
value = self.send(attr)
|
332
|
+
if value.nil?
|
333
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
334
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
335
|
+
end
|
336
|
+
|
337
|
+
hash[param] = _to_hash(value)
|
338
|
+
end
|
339
|
+
hash
|
340
|
+
end
|
341
|
+
|
342
|
+
# Outputs non-array value in the form of hash
|
343
|
+
# For object, use to_hash. Otherwise, just return the value
|
344
|
+
# @param [Object] value Any valid value
|
345
|
+
# @return [Hash] Returns the value in the form of hash
|
346
|
+
def _to_hash(value)
|
347
|
+
if value.is_a?(Array)
|
348
|
+
value.compact.map { |v| _to_hash(v) }
|
349
|
+
elsif value.is_a?(Hash)
|
350
|
+
{}.tap do |hash|
|
351
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
352
|
+
end
|
353
|
+
elsif value.respond_to? :to_hash
|
354
|
+
value.to_hash
|
355
|
+
else
|
356
|
+
value
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
360
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailslurp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.2.
|
4
|
+
version: 8.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mailslurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Create emails addresses in Ruby then send and receive real emails and
|
14
14
|
attachments. See https://www.mailslurp.com/docs/ruby/ for full Ruby documentation.
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- lib/mailslurp_client/models/bulk_send_email_options.rb
|
47
47
|
- lib/mailslurp_client/models/contact_dto.rb
|
48
48
|
- lib/mailslurp_client/models/contact_projection.rb
|
49
|
+
- lib/mailslurp_client/models/content_match_options.rb
|
49
50
|
- lib/mailslurp_client/models/create_anonymous_alias_options.rb
|
50
51
|
- lib/mailslurp_client/models/create_contact_options.rb
|
51
52
|
- lib/mailslurp_client/models/create_domain_options.rb
|
@@ -60,6 +61,7 @@ files:
|
|
60
61
|
- lib/mailslurp_client/models/download_attachment_dto.rb
|
61
62
|
- lib/mailslurp_client/models/email.rb
|
62
63
|
- lib/mailslurp_client/models/email_analysis.rb
|
64
|
+
- lib/mailslurp_client/models/email_content_match_result.rb
|
63
65
|
- lib/mailslurp_client/models/email_preview.rb
|
64
66
|
- lib/mailslurp_client/models/email_projection.rb
|
65
67
|
- lib/mailslurp_client/models/email_verification_result.rb
|
@@ -86,6 +88,7 @@ files:
|
|
86
88
|
- lib/mailslurp_client/models/pageable.rb
|
87
89
|
- lib/mailslurp_client/models/raw_email_json.rb
|
88
90
|
- lib/mailslurp_client/models/send_email_options.rb
|
91
|
+
- lib/mailslurp_client/models/sent_email.rb
|
89
92
|
- lib/mailslurp_client/models/sent_email_dto.rb
|
90
93
|
- lib/mailslurp_client/models/sent_email_projection.rb
|
91
94
|
- lib/mailslurp_client/models/set_inbox_favourited_options.rb
|