mailslurp_client 11.2.0 → 11.4.24
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/domain_controller_api.rb +132 -0
- data/lib/mailslurp_client/api/email_controller_api.rb +118 -0
- data/lib/mailslurp_client/api/expired_controller_api.rb +271 -0
- data/lib/mailslurp_client/api/inbox_controller_api.rb +0 -193
- data/lib/mailslurp_client/models/create_domain_options.rb +23 -3
- data/lib/mailslurp_client/models/domain_dto.rb +11 -1
- data/lib/mailslurp_client/models/domain_preview.rb +10 -1
- data/lib/mailslurp_client/models/expiration_defaults.rb +239 -0
- data/lib/mailslurp_client/models/update_domain_options.rb +207 -0
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +5 -2
@@ -439,199 +439,6 @@ module MailSlurpClient
|
|
439
439
|
return data, status_code, headers
|
440
440
|
end
|
441
441
|
|
442
|
-
# Get an expired inbox record
|
443
|
-
# Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties
|
444
|
-
# @param expired_id [String] ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId)
|
445
|
-
# @param [Hash] opts the optional parameters
|
446
|
-
# @return [ExpiredInboxDto]
|
447
|
-
def get_expired_inbox_record_by_id(expired_id, opts = {})
|
448
|
-
data, _status_code, _headers = get_expired_inbox_record_by_id_with_http_info(expired_id, opts)
|
449
|
-
data
|
450
|
-
end
|
451
|
-
|
452
|
-
# Get an expired inbox record
|
453
|
-
# Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties
|
454
|
-
# @param expired_id [String] ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId)
|
455
|
-
# @param [Hash] opts the optional parameters
|
456
|
-
# @return [Array<(ExpiredInboxDto, Integer, Hash)>] ExpiredInboxDto data, response status code and response headers
|
457
|
-
def get_expired_inbox_record_by_id_with_http_info(expired_id, opts = {})
|
458
|
-
if @api_client.config.debugging
|
459
|
-
@api_client.config.logger.debug 'Calling API: InboxControllerApi.get_expired_inbox_record_by_id ...'
|
460
|
-
end
|
461
|
-
# verify the required parameter 'expired_id' is set
|
462
|
-
if @api_client.config.client_side_validation && expired_id.nil?
|
463
|
-
fail ArgumentError, "Missing the required parameter 'expired_id' when calling InboxControllerApi.get_expired_inbox_record_by_id"
|
464
|
-
end
|
465
|
-
# resource path
|
466
|
-
local_var_path = '/inboxes/expired-records/{expiredId}'.sub('{' + 'expiredId' + '}', CGI.escape(expired_id.to_s))
|
467
|
-
|
468
|
-
# query parameters
|
469
|
-
query_params = opts[:query_params] || {}
|
470
|
-
|
471
|
-
# header parameters
|
472
|
-
header_params = opts[:header_params] || {}
|
473
|
-
# HTTP header 'Accept' (if needed)
|
474
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
475
|
-
|
476
|
-
# form parameters
|
477
|
-
form_params = opts[:form_params] || {}
|
478
|
-
|
479
|
-
# http body (model)
|
480
|
-
post_body = opts[:body]
|
481
|
-
|
482
|
-
# return_type
|
483
|
-
return_type = opts[:return_type] || 'ExpiredInboxDto'
|
484
|
-
|
485
|
-
# auth_names
|
486
|
-
auth_names = opts[:auth_names] || ['API_KEY']
|
487
|
-
|
488
|
-
new_options = opts.merge(
|
489
|
-
:header_params => header_params,
|
490
|
-
:query_params => query_params,
|
491
|
-
:form_params => form_params,
|
492
|
-
:body => post_body,
|
493
|
-
:auth_names => auth_names,
|
494
|
-
:return_type => return_type
|
495
|
-
)
|
496
|
-
|
497
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
498
|
-
if @api_client.config.debugging
|
499
|
-
@api_client.config.logger.debug "API called: InboxControllerApi#get_expired_inbox_record_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
500
|
-
end
|
501
|
-
return data, status_code, headers
|
502
|
-
end
|
503
|
-
|
504
|
-
# Get expired inbox record for a previously existing inbox
|
505
|
-
# Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId
|
506
|
-
# @param inbox_id [String] ID of inbox you want to retrieve (not the inbox ID)
|
507
|
-
# @param [Hash] opts the optional parameters
|
508
|
-
# @return [ExpiredInboxDto]
|
509
|
-
def get_expired_inbox_record_by_inbox_id(inbox_id, opts = {})
|
510
|
-
data, _status_code, _headers = get_expired_inbox_record_by_inbox_id_with_http_info(inbox_id, opts)
|
511
|
-
data
|
512
|
-
end
|
513
|
-
|
514
|
-
# Get expired inbox record for a previously existing inbox
|
515
|
-
# Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId
|
516
|
-
# @param inbox_id [String] ID of inbox you want to retrieve (not the inbox ID)
|
517
|
-
# @param [Hash] opts the optional parameters
|
518
|
-
# @return [Array<(ExpiredInboxDto, Integer, Hash)>] ExpiredInboxDto data, response status code and response headers
|
519
|
-
def get_expired_inbox_record_by_inbox_id_with_http_info(inbox_id, opts = {})
|
520
|
-
if @api_client.config.debugging
|
521
|
-
@api_client.config.logger.debug 'Calling API: InboxControllerApi.get_expired_inbox_record_by_inbox_id ...'
|
522
|
-
end
|
523
|
-
# verify the required parameter 'inbox_id' is set
|
524
|
-
if @api_client.config.client_side_validation && inbox_id.nil?
|
525
|
-
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_expired_inbox_record_by_inbox_id"
|
526
|
-
end
|
527
|
-
# resource path
|
528
|
-
local_var_path = '/inboxes/{inboxId}/expired-record'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
|
529
|
-
|
530
|
-
# query parameters
|
531
|
-
query_params = opts[:query_params] || {}
|
532
|
-
|
533
|
-
# header parameters
|
534
|
-
header_params = opts[:header_params] || {}
|
535
|
-
# HTTP header 'Accept' (if needed)
|
536
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
537
|
-
|
538
|
-
# form parameters
|
539
|
-
form_params = opts[:form_params] || {}
|
540
|
-
|
541
|
-
# http body (model)
|
542
|
-
post_body = opts[:body]
|
543
|
-
|
544
|
-
# return_type
|
545
|
-
return_type = opts[:return_type] || 'ExpiredInboxDto'
|
546
|
-
|
547
|
-
# auth_names
|
548
|
-
auth_names = opts[:auth_names] || ['API_KEY']
|
549
|
-
|
550
|
-
new_options = opts.merge(
|
551
|
-
:header_params => header_params,
|
552
|
-
:query_params => query_params,
|
553
|
-
:form_params => form_params,
|
554
|
-
:body => post_body,
|
555
|
-
:auth_names => auth_names,
|
556
|
-
:return_type => return_type
|
557
|
-
)
|
558
|
-
|
559
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
560
|
-
if @api_client.config.debugging
|
561
|
-
@api_client.config.logger.debug "API called: InboxControllerApi#get_expired_inbox_record_by_inbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
562
|
-
end
|
563
|
-
return data, status_code, headers
|
564
|
-
end
|
565
|
-
|
566
|
-
# List records of expired inboxes
|
567
|
-
# Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties
|
568
|
-
# @param [Hash] opts the optional parameters
|
569
|
-
# @option opts [Integer] :page Optional page index in inbox sent email list pagination (default to 0)
|
570
|
-
# @option opts [Integer] :size Optional page size in inbox sent email list pagination (default to 20)
|
571
|
-
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
572
|
-
# @return [PageExpiredInboxRecordProjection]
|
573
|
-
def get_expired_inbox_records(opts = {})
|
574
|
-
data, _status_code, _headers = get_expired_inbox_records_with_http_info(opts)
|
575
|
-
data
|
576
|
-
end
|
577
|
-
|
578
|
-
# List records of expired inboxes
|
579
|
-
# Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties
|
580
|
-
# @param [Hash] opts the optional parameters
|
581
|
-
# @option opts [Integer] :page Optional page index in inbox sent email list pagination
|
582
|
-
# @option opts [Integer] :size Optional page size in inbox sent email list pagination
|
583
|
-
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
584
|
-
# @return [Array<(PageExpiredInboxRecordProjection, Integer, Hash)>] PageExpiredInboxRecordProjection data, response status code and response headers
|
585
|
-
def get_expired_inbox_records_with_http_info(opts = {})
|
586
|
-
if @api_client.config.debugging
|
587
|
-
@api_client.config.logger.debug 'Calling API: InboxControllerApi.get_expired_inbox_records ...'
|
588
|
-
end
|
589
|
-
allowable_values = ["ASC", "DESC"]
|
590
|
-
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
591
|
-
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
592
|
-
end
|
593
|
-
# resource path
|
594
|
-
local_var_path = '/inboxes/expired-records'
|
595
|
-
|
596
|
-
# query parameters
|
597
|
-
query_params = opts[:query_params] || {}
|
598
|
-
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
599
|
-
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
600
|
-
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
601
|
-
|
602
|
-
# header parameters
|
603
|
-
header_params = opts[:header_params] || {}
|
604
|
-
# HTTP header 'Accept' (if needed)
|
605
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
606
|
-
|
607
|
-
# form parameters
|
608
|
-
form_params = opts[:form_params] || {}
|
609
|
-
|
610
|
-
# http body (model)
|
611
|
-
post_body = opts[:body]
|
612
|
-
|
613
|
-
# return_type
|
614
|
-
return_type = opts[:return_type] || 'PageExpiredInboxRecordProjection'
|
615
|
-
|
616
|
-
# auth_names
|
617
|
-
auth_names = opts[:auth_names] || ['API_KEY']
|
618
|
-
|
619
|
-
new_options = opts.merge(
|
620
|
-
:header_params => header_params,
|
621
|
-
:query_params => query_params,
|
622
|
-
:form_params => form_params,
|
623
|
-
:body => post_body,
|
624
|
-
:auth_names => auth_names,
|
625
|
-
:return_type => return_type
|
626
|
-
)
|
627
|
-
|
628
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
629
|
-
if @api_client.config.debugging
|
630
|
-
@api_client.config.logger.debug "API called: InboxControllerApi#get_expired_inbox_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
631
|
-
end
|
632
|
-
return data, status_code, headers
|
633
|
-
end
|
634
|
-
|
635
442
|
# Get Inbox
|
636
443
|
# Returns an inbox's properties, including its email address and ID.
|
637
444
|
# @param inbox_id [String] inboxId
|
@@ -13,14 +13,22 @@ OpenAPI Generator version: 4.3.1
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module MailSlurpClient
|
16
|
-
# Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it.
|
16
|
+
# Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not functionally currently until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help.
|
17
17
|
class CreateDomainOptions
|
18
|
-
#
|
18
|
+
# Whether to create a catch all inbox for the domain. Any email sent to an address using your domain that cannot be matched to an existing inbox you created with the domain will be routed to the created catch all inbox. You can access emails using the regular methods on this inbox ID.
|
19
|
+
attr_accessor :created_catch_all_inbox
|
20
|
+
|
21
|
+
# Optional description of the domain.
|
22
|
+
attr_accessor :description
|
23
|
+
|
24
|
+
# The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain.
|
19
25
|
attr_accessor :domain
|
20
26
|
|
21
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
28
|
def self.attribute_map
|
23
29
|
{
|
30
|
+
:'created_catch_all_inbox' => :'createdCatchAllInbox',
|
31
|
+
:'description' => :'description',
|
24
32
|
:'domain' => :'domain'
|
25
33
|
}
|
26
34
|
end
|
@@ -28,6 +36,8 @@ module MailSlurpClient
|
|
28
36
|
# Attribute type mapping.
|
29
37
|
def self.openapi_types
|
30
38
|
{
|
39
|
+
:'created_catch_all_inbox' => :'Boolean',
|
40
|
+
:'description' => :'String',
|
31
41
|
:'domain' => :'String'
|
32
42
|
}
|
33
43
|
end
|
@@ -53,6 +63,14 @@ module MailSlurpClient
|
|
53
63
|
h[k.to_sym] = v
|
54
64
|
}
|
55
65
|
|
66
|
+
if attributes.key?(:'created_catch_all_inbox')
|
67
|
+
self.created_catch_all_inbox = attributes[:'created_catch_all_inbox']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'description')
|
71
|
+
self.description = attributes[:'description']
|
72
|
+
end
|
73
|
+
|
56
74
|
if attributes.key?(:'domain')
|
57
75
|
self.domain = attributes[:'domain']
|
58
76
|
end
|
@@ -76,6 +94,8 @@ module MailSlurpClient
|
|
76
94
|
def ==(o)
|
77
95
|
return true if self.equal?(o)
|
78
96
|
self.class == o.class &&
|
97
|
+
created_catch_all_inbox == o.created_catch_all_inbox &&
|
98
|
+
description == o.description &&
|
79
99
|
domain == o.domain
|
80
100
|
end
|
81
101
|
|
@@ -88,7 +108,7 @@ module MailSlurpClient
|
|
88
108
|
# Calculates hash code according to all attributes.
|
89
109
|
# @return [Integer] Hash code
|
90
110
|
def hash
|
91
|
-
[domain].hash
|
111
|
+
[created_catch_all_inbox, description, domain].hash
|
92
112
|
end
|
93
113
|
|
94
114
|
# Builds the object from hash
|
@@ -15,6 +15,9 @@ require 'date'
|
|
15
15
|
module MailSlurpClient
|
16
16
|
# Domain plus verification records and status
|
17
17
|
class DomainDto
|
18
|
+
# The optional catch all inbox that will receive emails sent to the domain that cannot be matched.
|
19
|
+
attr_accessor :catch_all_inbox_id
|
20
|
+
|
18
21
|
attr_accessor :created_at
|
19
22
|
|
20
23
|
# Unique token DKIM tokens
|
@@ -41,6 +44,7 @@ module MailSlurpClient
|
|
41
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
45
|
def self.attribute_map
|
43
46
|
{
|
47
|
+
:'catch_all_inbox_id' => :'catchAllInboxId',
|
44
48
|
:'created_at' => :'createdAt',
|
45
49
|
:'dkim_tokens' => :'dkimTokens',
|
46
50
|
:'domain' => :'domain',
|
@@ -56,6 +60,7 @@ module MailSlurpClient
|
|
56
60
|
# Attribute type mapping.
|
57
61
|
def self.openapi_types
|
58
62
|
{
|
63
|
+
:'catch_all_inbox_id' => :'String',
|
59
64
|
:'created_at' => :'DateTime',
|
60
65
|
:'dkim_tokens' => :'Array<String>',
|
61
66
|
:'domain' => :'String',
|
@@ -89,6 +94,10 @@ module MailSlurpClient
|
|
89
94
|
h[k.to_sym] = v
|
90
95
|
}
|
91
96
|
|
97
|
+
if attributes.key?(:'catch_all_inbox_id')
|
98
|
+
self.catch_all_inbox_id = attributes[:'catch_all_inbox_id']
|
99
|
+
end
|
100
|
+
|
92
101
|
if attributes.key?(:'created_at')
|
93
102
|
self.created_at = attributes[:'created_at']
|
94
103
|
end
|
@@ -168,6 +177,7 @@ module MailSlurpClient
|
|
168
177
|
def ==(o)
|
169
178
|
return true if self.equal?(o)
|
170
179
|
self.class == o.class &&
|
180
|
+
catch_all_inbox_id == o.catch_all_inbox_id &&
|
171
181
|
created_at == o.created_at &&
|
172
182
|
dkim_tokens == o.dkim_tokens &&
|
173
183
|
domain == o.domain &&
|
@@ -188,7 +198,7 @@ module MailSlurpClient
|
|
188
198
|
# Calculates hash code according to all attributes.
|
189
199
|
# @return [Integer] Hash code
|
190
200
|
def hash
|
191
|
-
[created_at, dkim_tokens, domain, domain_name_records, id, is_verified, updated_at, user_id, verification_token].hash
|
201
|
+
[catch_all_inbox_id, created_at, dkim_tokens, domain, domain_name_records, id, is_verified, updated_at, user_id, verification_token].hash
|
192
202
|
end
|
193
203
|
|
194
204
|
# Builds the object from hash
|
@@ -15,6 +15,8 @@ require 'date'
|
|
15
15
|
module MailSlurpClient
|
16
16
|
# Preview object for domain entity
|
17
17
|
class DomainPreview
|
18
|
+
attr_accessor :catch_all_inbox_id
|
19
|
+
|
18
20
|
attr_accessor :created_at
|
19
21
|
|
20
22
|
attr_accessor :domain
|
@@ -24,6 +26,7 @@ module MailSlurpClient
|
|
24
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
27
|
def self.attribute_map
|
26
28
|
{
|
29
|
+
:'catch_all_inbox_id' => :'catchAllInboxId',
|
27
30
|
:'created_at' => :'createdAt',
|
28
31
|
:'domain' => :'domain',
|
29
32
|
:'id' => :'id'
|
@@ -33,6 +36,7 @@ module MailSlurpClient
|
|
33
36
|
# Attribute type mapping.
|
34
37
|
def self.openapi_types
|
35
38
|
{
|
39
|
+
:'catch_all_inbox_id' => :'String',
|
36
40
|
:'created_at' => :'DateTime',
|
37
41
|
:'domain' => :'String',
|
38
42
|
:'id' => :'String'
|
@@ -60,6 +64,10 @@ module MailSlurpClient
|
|
60
64
|
h[k.to_sym] = v
|
61
65
|
}
|
62
66
|
|
67
|
+
if attributes.key?(:'catch_all_inbox_id')
|
68
|
+
self.catch_all_inbox_id = attributes[:'catch_all_inbox_id']
|
69
|
+
end
|
70
|
+
|
63
71
|
if attributes.key?(:'created_at')
|
64
72
|
self.created_at = attributes[:'created_at']
|
65
73
|
end
|
@@ -106,6 +114,7 @@ module MailSlurpClient
|
|
106
114
|
def ==(o)
|
107
115
|
return true if self.equal?(o)
|
108
116
|
self.class == o.class &&
|
117
|
+
catch_all_inbox_id == o.catch_all_inbox_id &&
|
109
118
|
created_at == o.created_at &&
|
110
119
|
domain == o.domain &&
|
111
120
|
id == o.id
|
@@ -120,7 +129,7 @@ module MailSlurpClient
|
|
120
129
|
# Calculates hash code according to all attributes.
|
121
130
|
# @return [Integer] Hash code
|
122
131
|
def hash
|
123
|
-
[created_at, domain, id].hash
|
132
|
+
[catch_all_inbox_id, created_at, domain, id].hash
|
124
133
|
end
|
125
134
|
|
126
135
|
# Builds the object from hash
|
@@ -0,0 +1,239 @@
|
|
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
|
+
# Expiration defaults for your account
|
17
|
+
class ExpirationDefaults
|
18
|
+
attr_accessor :can_permanent_inbox
|
19
|
+
|
20
|
+
attr_accessor :default_expiration_millis
|
21
|
+
|
22
|
+
attr_accessor :default_expires_at
|
23
|
+
|
24
|
+
attr_accessor :max_expiration_millis
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'can_permanent_inbox' => :'canPermanentInbox',
|
30
|
+
:'default_expiration_millis' => :'defaultExpirationMillis',
|
31
|
+
:'default_expires_at' => :'defaultExpiresAt',
|
32
|
+
:'max_expiration_millis' => :'maxExpirationMillis'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'can_permanent_inbox' => :'Boolean',
|
40
|
+
:'default_expiration_millis' => :'Integer',
|
41
|
+
:'default_expires_at' => :'DateTime',
|
42
|
+
:'max_expiration_millis' => :'Integer'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
])
|
50
|
+
end
|
51
|
+
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
|
+
def initialize(attributes = {})
|
55
|
+
if (!attributes.is_a?(Hash))
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ExpirationDefaults` initialize method"
|
57
|
+
end
|
58
|
+
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
61
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ExpirationDefaults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
|
+
end
|
64
|
+
h[k.to_sym] = v
|
65
|
+
}
|
66
|
+
|
67
|
+
if attributes.key?(:'can_permanent_inbox')
|
68
|
+
self.can_permanent_inbox = attributes[:'can_permanent_inbox']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'default_expiration_millis')
|
72
|
+
self.default_expiration_millis = attributes[:'default_expiration_millis']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'default_expires_at')
|
76
|
+
self.default_expires_at = attributes[:'default_expires_at']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'max_expiration_millis')
|
80
|
+
self.max_expiration_millis = attributes[:'max_expiration_millis']
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
+
# @return Array for valid properties with the reasons
|
86
|
+
def list_invalid_properties
|
87
|
+
invalid_properties = Array.new
|
88
|
+
if @can_permanent_inbox.nil?
|
89
|
+
invalid_properties.push('invalid value for "can_permanent_inbox", can_permanent_inbox cannot be nil.')
|
90
|
+
end
|
91
|
+
|
92
|
+
invalid_properties
|
93
|
+
end
|
94
|
+
|
95
|
+
# Check to see if the all the properties in the model are valid
|
96
|
+
# @return true if the model is valid
|
97
|
+
def valid?
|
98
|
+
return false if @can_permanent_inbox.nil?
|
99
|
+
true
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks equality by comparing each attribute.
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def ==(o)
|
105
|
+
return true if self.equal?(o)
|
106
|
+
self.class == o.class &&
|
107
|
+
can_permanent_inbox == o.can_permanent_inbox &&
|
108
|
+
default_expiration_millis == o.default_expiration_millis &&
|
109
|
+
default_expires_at == o.default_expires_at &&
|
110
|
+
max_expiration_millis == o.max_expiration_millis
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(o)
|
116
|
+
self == o
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Integer] Hash code
|
121
|
+
def hash
|
122
|
+
[can_permanent_inbox, default_expiration_millis, default_expires_at, max_expiration_millis].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def self.build_from_hash(attributes)
|
129
|
+
new.build_from_hash(attributes)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.openapi_types.each_pair do |key, type|
|
138
|
+
if type =~ /\AArray<(.*)>/i
|
139
|
+
# check to ensure the input is an array given that the attribute
|
140
|
+
# is documented as an array but the input is not
|
141
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
142
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
143
|
+
end
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
146
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
147
|
+
end
|
148
|
+
|
149
|
+
self
|
150
|
+
end
|
151
|
+
|
152
|
+
# Deserializes the data based on type
|
153
|
+
# @param string type Data type
|
154
|
+
# @param string value Value to be deserialized
|
155
|
+
# @return [Object] Deserialized data
|
156
|
+
def _deserialize(type, value)
|
157
|
+
case type.to_sym
|
158
|
+
when :DateTime
|
159
|
+
DateTime.parse(value)
|
160
|
+
when :Date
|
161
|
+
Date.parse(value)
|
162
|
+
when :String
|
163
|
+
value.to_s
|
164
|
+
when :Integer
|
165
|
+
value.to_i
|
166
|
+
when :Float
|
167
|
+
value.to_f
|
168
|
+
when :Boolean
|
169
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
170
|
+
true
|
171
|
+
else
|
172
|
+
false
|
173
|
+
end
|
174
|
+
when :Object
|
175
|
+
# generic object (usually a Hash), return directly
|
176
|
+
value
|
177
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
178
|
+
inner_type = Regexp.last_match[:inner_type]
|
179
|
+
value.map { |v| _deserialize(inner_type, v) }
|
180
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
181
|
+
k_type = Regexp.last_match[:k_type]
|
182
|
+
v_type = Regexp.last_match[:v_type]
|
183
|
+
{}.tap do |hash|
|
184
|
+
value.each do |k, v|
|
185
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
else # model
|
189
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the string representation of the object
|
194
|
+
# @return [String] String presentation of the object
|
195
|
+
def to_s
|
196
|
+
to_hash.to_s
|
197
|
+
end
|
198
|
+
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_body
|
202
|
+
to_hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Returns the object in the form of hash
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
207
|
+
def to_hash
|
208
|
+
hash = {}
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
210
|
+
value = self.send(attr)
|
211
|
+
if value.nil?
|
212
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
213
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
214
|
+
end
|
215
|
+
|
216
|
+
hash[param] = _to_hash(value)
|
217
|
+
end
|
218
|
+
hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Outputs non-array value in the form of hash
|
222
|
+
# For object, use to_hash. Otherwise, just return the value
|
223
|
+
# @param [Object] value Any valid value
|
224
|
+
# @return [Hash] Returns the value in the form of hash
|
225
|
+
def _to_hash(value)
|
226
|
+
if value.is_a?(Array)
|
227
|
+
value.compact.map { |v| _to_hash(v) }
|
228
|
+
elsif value.is_a?(Hash)
|
229
|
+
{}.tap do |hash|
|
230
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
231
|
+
end
|
232
|
+
elsif value.respond_to? :to_hash
|
233
|
+
value.to_hash
|
234
|
+
else
|
235
|
+
value
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|