mailslurp_client 15.17.6 → 15.17.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/mailslurp_client/api/connector_controller_api.rb +619 -0
- data/lib/mailslurp_client/api/sms_controller_api.rb +56 -0
- data/lib/mailslurp_client/models/attachment_projection.rb +15 -15
- data/lib/mailslurp_client/models/bounce_projection.rb +10 -10
- data/lib/mailslurp_client/models/connector_dto.rb +407 -0
- data/lib/mailslurp_client/models/connector_projection.rb +346 -0
- data/lib/mailslurp_client/models/connector_sync_event_dto.rb +310 -0
- data/lib/mailslurp_client/models/connector_sync_event_projection.rb +306 -0
- data/lib/mailslurp_client/models/connector_sync_request_result.rb +224 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception.rb +246 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause.rb +237 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause_stack_trace.rb +269 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause_suppressed.rb +226 -0
- data/lib/mailslurp_client/models/connector_sync_result.rb +222 -0
- data/lib/mailslurp_client/models/create_connector_imap_options.rb +267 -0
- data/lib/mailslurp_client/models/create_connector_options.rb +338 -0
- data/lib/mailslurp_client/models/email_projection.rb +19 -19
- data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +13 -13
- data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +1 -0
- data/lib/mailslurp_client/models/missed_email_projection.rb +11 -11
- data/lib/mailslurp_client/models/page_alias.rb +19 -19
- data/lib/mailslurp_client/models/page_attachment_entity.rb +19 -19
- data/lib/mailslurp_client/models/page_bounced_email.rb +19 -19
- data/lib/mailslurp_client/models/page_bounced_recipients.rb +19 -19
- data/lib/mailslurp_client/models/page_complaint.rb +19 -19
- data/lib/mailslurp_client/models/page_connector.rb +308 -0
- data/lib/mailslurp_client/models/page_connector_sync_events.rb +308 -0
- data/lib/mailslurp_client/models/page_contact_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_delivery_status.rb +19 -19
- data/lib/mailslurp_client/models/page_email_preview.rb +19 -19
- data/lib/mailslurp_client/models/page_email_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_email_validation_request.rb +19 -19
- data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_group_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_replier_dto.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_replier_events.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +19 -19
- data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +19 -19
- data/lib/mailslurp_client/models/page_missed_email_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_phone_number_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_scheduled_jobs.rb +19 -19
- data/lib/mailslurp_client/models/page_sms_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_template_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_thread_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_webhook_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_webhook_result.rb +19 -19
- data/lib/mailslurp_client/models/thread_projection.rb +11 -11
- data/lib/mailslurp_client/models/unread_count.rb +1 -1
- data/lib/mailslurp_client/version.rb +1 -1
- data/lib/mailslurp_client.rb +15 -0
- metadata +17 -2
@@ -282,5 +282,61 @@ module MailSlurpClient
|
|
282
282
|
end
|
283
283
|
return data, status_code, headers
|
284
284
|
end
|
285
|
+
|
286
|
+
# Get unread SMS count
|
287
|
+
# Get number of SMS unread. Unread means has not been viewed in dashboard or returned in an email API response
|
288
|
+
# @param [Hash] opts the optional parameters
|
289
|
+
# @return [UnreadCount]
|
290
|
+
def get_unread_sms_count(opts = {})
|
291
|
+
data, _status_code, _headers = get_unread_sms_count_with_http_info(opts)
|
292
|
+
data
|
293
|
+
end
|
294
|
+
|
295
|
+
# Get unread SMS count
|
296
|
+
# Get number of SMS unread. Unread means has not been viewed in dashboard or returned in an email API response
|
297
|
+
# @param [Hash] opts the optional parameters
|
298
|
+
# @return [Array<(UnreadCount, Integer, Hash)>] UnreadCount data, response status code and response headers
|
299
|
+
def get_unread_sms_count_with_http_info(opts = {})
|
300
|
+
if @api_client.config.debugging
|
301
|
+
@api_client.config.logger.debug 'Calling API: SmsControllerApi.get_unread_sms_count ...'
|
302
|
+
end
|
303
|
+
# resource path
|
304
|
+
local_var_path = '/sms/unreadCount'
|
305
|
+
|
306
|
+
# query parameters
|
307
|
+
query_params = opts[:query_params] || {}
|
308
|
+
|
309
|
+
# header parameters
|
310
|
+
header_params = opts[:header_params] || {}
|
311
|
+
# HTTP header 'Accept' (if needed)
|
312
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
313
|
+
|
314
|
+
# form parameters
|
315
|
+
form_params = opts[:form_params] || {}
|
316
|
+
|
317
|
+
# http body (model)
|
318
|
+
post_body = opts[:body]
|
319
|
+
|
320
|
+
# return_type
|
321
|
+
return_type = opts[:return_type] || 'UnreadCount'
|
322
|
+
|
323
|
+
# auth_names
|
324
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
325
|
+
|
326
|
+
new_options = opts.merge(
|
327
|
+
:header_params => header_params,
|
328
|
+
:query_params => query_params,
|
329
|
+
:form_params => form_params,
|
330
|
+
:body => post_body,
|
331
|
+
:auth_names => auth_names,
|
332
|
+
:return_type => return_type
|
333
|
+
)
|
334
|
+
|
335
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
336
|
+
if @api_client.config.debugging
|
337
|
+
@api_client.config.logger.debug "API called: SmsControllerApi#get_unread_sms_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
338
|
+
end
|
339
|
+
return data, status_code, headers
|
340
|
+
end
|
285
341
|
end
|
286
342
|
end
|
@@ -20,9 +20,6 @@ module MailSlurpClient
|
|
20
20
|
# Content length of attachment in bytes
|
21
21
|
attr_accessor :content_length
|
22
22
|
|
23
|
-
# Content type of attachment.
|
24
|
-
attr_accessor :content_type
|
25
|
-
|
26
23
|
attr_accessor :user_id
|
27
24
|
|
28
25
|
attr_accessor :created_at
|
@@ -32,16 +29,19 @@ module MailSlurpClient
|
|
32
29
|
# Attachment ID
|
33
30
|
attr_accessor :attachment_id
|
34
31
|
|
32
|
+
# Content type of attachment.
|
33
|
+
attr_accessor :content_type
|
34
|
+
|
35
35
|
# Attribute mapping from ruby-style variable name to JSON key.
|
36
36
|
def self.attribute_map
|
37
37
|
{
|
38
38
|
:'name' => :'name',
|
39
39
|
:'content_length' => :'contentLength',
|
40
|
-
:'content_type' => :'contentType',
|
41
40
|
:'user_id' => :'userId',
|
42
41
|
:'created_at' => :'createdAt',
|
43
42
|
:'updated_at' => :'updatedAt',
|
44
|
-
:'attachment_id' => :'attachmentId'
|
43
|
+
:'attachment_id' => :'attachmentId',
|
44
|
+
:'content_type' => :'contentType'
|
45
45
|
}
|
46
46
|
end
|
47
47
|
|
@@ -50,11 +50,11 @@ module MailSlurpClient
|
|
50
50
|
{
|
51
51
|
:'name' => :'String',
|
52
52
|
:'content_length' => :'Integer',
|
53
|
-
:'content_type' => :'String',
|
54
53
|
:'user_id' => :'String',
|
55
54
|
:'created_at' => :'DateTime',
|
56
55
|
:'updated_at' => :'DateTime',
|
57
|
-
:'attachment_id' => :'String'
|
56
|
+
:'attachment_id' => :'String',
|
57
|
+
:'content_type' => :'String'
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
@@ -63,7 +63,7 @@ module MailSlurpClient
|
|
63
63
|
Set.new([
|
64
64
|
:'name',
|
65
65
|
:'content_length',
|
66
|
-
:'content_type'
|
66
|
+
:'content_type'
|
67
67
|
])
|
68
68
|
end
|
69
69
|
|
@@ -90,10 +90,6 @@ module MailSlurpClient
|
|
90
90
|
self.content_length = attributes[:'content_length']
|
91
91
|
end
|
92
92
|
|
93
|
-
if attributes.key?(:'content_type')
|
94
|
-
self.content_type = attributes[:'content_type']
|
95
|
-
end
|
96
|
-
|
97
93
|
if attributes.key?(:'user_id')
|
98
94
|
self.user_id = attributes[:'user_id']
|
99
95
|
end
|
@@ -109,6 +105,10 @@ module MailSlurpClient
|
|
109
105
|
if attributes.key?(:'attachment_id')
|
110
106
|
self.attachment_id = attributes[:'attachment_id']
|
111
107
|
end
|
108
|
+
|
109
|
+
if attributes.key?(:'content_type')
|
110
|
+
self.content_type = attributes[:'content_type']
|
111
|
+
end
|
112
112
|
end
|
113
113
|
|
114
114
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -151,11 +151,11 @@ module MailSlurpClient
|
|
151
151
|
self.class == o.class &&
|
152
152
|
name == o.name &&
|
153
153
|
content_length == o.content_length &&
|
154
|
-
content_type == o.content_type &&
|
155
154
|
user_id == o.user_id &&
|
156
155
|
created_at == o.created_at &&
|
157
156
|
updated_at == o.updated_at &&
|
158
|
-
attachment_id == o.attachment_id
|
157
|
+
attachment_id == o.attachment_id &&
|
158
|
+
content_type == o.content_type
|
159
159
|
end
|
160
160
|
|
161
161
|
# @see the `==` method
|
@@ -167,7 +167,7 @@ module MailSlurpClient
|
|
167
167
|
# Calculates hash code according to all attributes.
|
168
168
|
# @return [Integer] Hash code
|
169
169
|
def hash
|
170
|
-
[name, content_length,
|
170
|
+
[name, content_length, user_id, created_at, updated_at, attachment_id, content_type].hash
|
171
171
|
end
|
172
172
|
|
173
173
|
# Builds the object from hash
|
@@ -17,10 +17,10 @@ module MailSlurpClient
|
|
17
17
|
class BounceProjection
|
18
18
|
attr_accessor :id
|
19
19
|
|
20
|
-
attr_accessor :sender
|
21
|
-
|
22
20
|
attr_accessor :subject
|
23
21
|
|
22
|
+
attr_accessor :sender
|
23
|
+
|
24
24
|
attr_accessor :created_at
|
25
25
|
|
26
26
|
attr_accessor :bounce_type
|
@@ -31,8 +31,8 @@ module MailSlurpClient
|
|
31
31
|
def self.attribute_map
|
32
32
|
{
|
33
33
|
:'id' => :'id',
|
34
|
-
:'sender' => :'sender',
|
35
34
|
:'subject' => :'subject',
|
35
|
+
:'sender' => :'sender',
|
36
36
|
:'created_at' => :'createdAt',
|
37
37
|
:'bounce_type' => :'bounceType',
|
38
38
|
:'bounce_mta' => :'bounceMta'
|
@@ -43,8 +43,8 @@ module MailSlurpClient
|
|
43
43
|
def self.openapi_types
|
44
44
|
{
|
45
45
|
:'id' => :'String',
|
46
|
-
:'sender' => :'String',
|
47
46
|
:'subject' => :'String',
|
47
|
+
:'sender' => :'String',
|
48
48
|
:'created_at' => :'DateTime',
|
49
49
|
:'bounce_type' => :'String',
|
50
50
|
:'bounce_mta' => :'String'
|
@@ -79,14 +79,14 @@ module MailSlurpClient
|
|
79
79
|
self.id = attributes[:'id']
|
80
80
|
end
|
81
81
|
|
82
|
-
if attributes.key?(:'sender')
|
83
|
-
self.sender = attributes[:'sender']
|
84
|
-
end
|
85
|
-
|
86
82
|
if attributes.key?(:'subject')
|
87
83
|
self.subject = attributes[:'subject']
|
88
84
|
end
|
89
85
|
|
86
|
+
if attributes.key?(:'sender')
|
87
|
+
self.sender = attributes[:'sender']
|
88
|
+
end
|
89
|
+
|
90
90
|
if attributes.key?(:'created_at')
|
91
91
|
self.created_at = attributes[:'created_at']
|
92
92
|
end
|
@@ -129,8 +129,8 @@ module MailSlurpClient
|
|
129
129
|
return true if self.equal?(o)
|
130
130
|
self.class == o.class &&
|
131
131
|
id == o.id &&
|
132
|
-
sender == o.sender &&
|
133
132
|
subject == o.subject &&
|
133
|
+
sender == o.sender &&
|
134
134
|
created_at == o.created_at &&
|
135
135
|
bounce_type == o.bounce_type &&
|
136
136
|
bounce_mta == o.bounce_mta
|
@@ -145,7 +145,7 @@ module MailSlurpClient
|
|
145
145
|
# Calculates hash code according to all attributes.
|
146
146
|
# @return [Integer] Hash code
|
147
147
|
def hash
|
148
|
-
[id,
|
148
|
+
[id, subject, sender, created_at, bounce_type, bounce_mta].hash
|
149
149
|
end
|
150
150
|
|
151
151
|
# Builds the object from hash
|
@@ -0,0 +1,407 @@
|
|
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
Contact: contact@mailslurp.dev
|
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 ConnectorDto
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
attr_accessor :user_id
|
20
|
+
|
21
|
+
attr_accessor :connector_type
|
22
|
+
|
23
|
+
attr_accessor :connector_auth_type
|
24
|
+
|
25
|
+
attr_accessor :sync_enabled
|
26
|
+
|
27
|
+
attr_accessor :sync_schedule_type
|
28
|
+
|
29
|
+
attr_accessor :sync_interval
|
30
|
+
|
31
|
+
attr_accessor :imap_host
|
32
|
+
|
33
|
+
attr_accessor :imap_port
|
34
|
+
|
35
|
+
attr_accessor :imap_username
|
36
|
+
|
37
|
+
attr_accessor :imap_password
|
38
|
+
|
39
|
+
attr_accessor :imap_ssl
|
40
|
+
|
41
|
+
attr_accessor :created_at
|
42
|
+
|
43
|
+
class EnumAttributeValidator
|
44
|
+
attr_reader :datatype
|
45
|
+
attr_reader :allowable_values
|
46
|
+
|
47
|
+
def initialize(datatype, allowable_values)
|
48
|
+
@allowable_values = allowable_values.map do |value|
|
49
|
+
case datatype.to_s
|
50
|
+
when /Integer/i
|
51
|
+
value.to_i
|
52
|
+
when /Float/i
|
53
|
+
value.to_f
|
54
|
+
else
|
55
|
+
value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def valid?(value)
|
61
|
+
!value || allowable_values.include?(value)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
66
|
+
def self.attribute_map
|
67
|
+
{
|
68
|
+
:'id' => :'id',
|
69
|
+
:'user_id' => :'userId',
|
70
|
+
:'connector_type' => :'connectorType',
|
71
|
+
:'connector_auth_type' => :'connectorAuthType',
|
72
|
+
:'sync_enabled' => :'syncEnabled',
|
73
|
+
:'sync_schedule_type' => :'syncScheduleType',
|
74
|
+
:'sync_interval' => :'syncInterval',
|
75
|
+
:'imap_host' => :'imapHost',
|
76
|
+
:'imap_port' => :'imapPort',
|
77
|
+
:'imap_username' => :'imapUsername',
|
78
|
+
:'imap_password' => :'imapPassword',
|
79
|
+
:'imap_ssl' => :'imapSsl',
|
80
|
+
:'created_at' => :'createdAt'
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# Attribute type mapping.
|
85
|
+
def self.openapi_types
|
86
|
+
{
|
87
|
+
:'id' => :'String',
|
88
|
+
:'user_id' => :'String',
|
89
|
+
:'connector_type' => :'String',
|
90
|
+
:'connector_auth_type' => :'String',
|
91
|
+
:'sync_enabled' => :'Boolean',
|
92
|
+
:'sync_schedule_type' => :'String',
|
93
|
+
:'sync_interval' => :'Integer',
|
94
|
+
:'imap_host' => :'String',
|
95
|
+
:'imap_port' => :'Integer',
|
96
|
+
:'imap_username' => :'String',
|
97
|
+
:'imap_password' => :'String',
|
98
|
+
:'imap_ssl' => :'Boolean',
|
99
|
+
:'created_at' => :'DateTime'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# List of attributes with nullable: true
|
104
|
+
def self.openapi_nullable
|
105
|
+
Set.new([
|
106
|
+
])
|
107
|
+
end
|
108
|
+
|
109
|
+
# Initializes the object
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
def initialize(attributes = {})
|
112
|
+
if (!attributes.is_a?(Hash))
|
113
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ConnectorDto` initialize method"
|
114
|
+
end
|
115
|
+
|
116
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
117
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
118
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
119
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ConnectorDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
120
|
+
end
|
121
|
+
h[k.to_sym] = v
|
122
|
+
}
|
123
|
+
|
124
|
+
if attributes.key?(:'id')
|
125
|
+
self.id = attributes[:'id']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'user_id')
|
129
|
+
self.user_id = attributes[:'user_id']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'connector_type')
|
133
|
+
self.connector_type = attributes[:'connector_type']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'connector_auth_type')
|
137
|
+
self.connector_auth_type = attributes[:'connector_auth_type']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'sync_enabled')
|
141
|
+
self.sync_enabled = attributes[:'sync_enabled']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'sync_schedule_type')
|
145
|
+
self.sync_schedule_type = attributes[:'sync_schedule_type']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'sync_interval')
|
149
|
+
self.sync_interval = attributes[:'sync_interval']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'imap_host')
|
153
|
+
self.imap_host = attributes[:'imap_host']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'imap_port')
|
157
|
+
self.imap_port = attributes[:'imap_port']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'imap_username')
|
161
|
+
self.imap_username = attributes[:'imap_username']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'imap_password')
|
165
|
+
self.imap_password = attributes[:'imap_password']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'imap_ssl')
|
169
|
+
self.imap_ssl = attributes[:'imap_ssl']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'created_at')
|
173
|
+
self.created_at = attributes[:'created_at']
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
178
|
+
# @return Array for valid properties with the reasons
|
179
|
+
def list_invalid_properties
|
180
|
+
invalid_properties = Array.new
|
181
|
+
if @id.nil?
|
182
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
183
|
+
end
|
184
|
+
|
185
|
+
if @user_id.nil?
|
186
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
187
|
+
end
|
188
|
+
|
189
|
+
if @connector_type.nil?
|
190
|
+
invalid_properties.push('invalid value for "connector_type", connector_type cannot be nil.')
|
191
|
+
end
|
192
|
+
|
193
|
+
if @connector_auth_type.nil?
|
194
|
+
invalid_properties.push('invalid value for "connector_auth_type", connector_auth_type cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
if @sync_enabled.nil?
|
198
|
+
invalid_properties.push('invalid value for "sync_enabled", sync_enabled cannot be nil.')
|
199
|
+
end
|
200
|
+
|
201
|
+
if @sync_schedule_type.nil?
|
202
|
+
invalid_properties.push('invalid value for "sync_schedule_type", sync_schedule_type cannot be nil.')
|
203
|
+
end
|
204
|
+
|
205
|
+
if @created_at.nil?
|
206
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
207
|
+
end
|
208
|
+
|
209
|
+
invalid_properties
|
210
|
+
end
|
211
|
+
|
212
|
+
# Check to see if the all the properties in the model are valid
|
213
|
+
# @return true if the model is valid
|
214
|
+
def valid?
|
215
|
+
return false if @id.nil?
|
216
|
+
return false if @user_id.nil?
|
217
|
+
return false if @connector_type.nil?
|
218
|
+
connector_type_validator = EnumAttributeValidator.new('String', ["IMAP"])
|
219
|
+
return false unless connector_type_validator.valid?(@connector_type)
|
220
|
+
return false if @connector_auth_type.nil?
|
221
|
+
connector_auth_type_validator = EnumAttributeValidator.new('String', ["PLAIN_TEXT"])
|
222
|
+
return false unless connector_auth_type_validator.valid?(@connector_auth_type)
|
223
|
+
return false if @sync_enabled.nil?
|
224
|
+
return false if @sync_schedule_type.nil?
|
225
|
+
sync_schedule_type_validator = EnumAttributeValidator.new('String', ["INTERVAL"])
|
226
|
+
return false unless sync_schedule_type_validator.valid?(@sync_schedule_type)
|
227
|
+
return false if @created_at.nil?
|
228
|
+
true
|
229
|
+
end
|
230
|
+
|
231
|
+
# Custom attribute writer method checking allowed values (enum).
|
232
|
+
# @param [Object] connector_type Object to be assigned
|
233
|
+
def connector_type=(connector_type)
|
234
|
+
validator = EnumAttributeValidator.new('String', ["IMAP"])
|
235
|
+
unless validator.valid?(connector_type)
|
236
|
+
fail ArgumentError, "invalid value for \"connector_type\", must be one of #{validator.allowable_values}."
|
237
|
+
end
|
238
|
+
@connector_type = connector_type
|
239
|
+
end
|
240
|
+
|
241
|
+
# Custom attribute writer method checking allowed values (enum).
|
242
|
+
# @param [Object] connector_auth_type Object to be assigned
|
243
|
+
def connector_auth_type=(connector_auth_type)
|
244
|
+
validator = EnumAttributeValidator.new('String', ["PLAIN_TEXT"])
|
245
|
+
unless validator.valid?(connector_auth_type)
|
246
|
+
fail ArgumentError, "invalid value for \"connector_auth_type\", must be one of #{validator.allowable_values}."
|
247
|
+
end
|
248
|
+
@connector_auth_type = connector_auth_type
|
249
|
+
end
|
250
|
+
|
251
|
+
# Custom attribute writer method checking allowed values (enum).
|
252
|
+
# @param [Object] sync_schedule_type Object to be assigned
|
253
|
+
def sync_schedule_type=(sync_schedule_type)
|
254
|
+
validator = EnumAttributeValidator.new('String', ["INTERVAL"])
|
255
|
+
unless validator.valid?(sync_schedule_type)
|
256
|
+
fail ArgumentError, "invalid value for \"sync_schedule_type\", must be one of #{validator.allowable_values}."
|
257
|
+
end
|
258
|
+
@sync_schedule_type = sync_schedule_type
|
259
|
+
end
|
260
|
+
|
261
|
+
# Checks equality by comparing each attribute.
|
262
|
+
# @param [Object] Object to be compared
|
263
|
+
def ==(o)
|
264
|
+
return true if self.equal?(o)
|
265
|
+
self.class == o.class &&
|
266
|
+
id == o.id &&
|
267
|
+
user_id == o.user_id &&
|
268
|
+
connector_type == o.connector_type &&
|
269
|
+
connector_auth_type == o.connector_auth_type &&
|
270
|
+
sync_enabled == o.sync_enabled &&
|
271
|
+
sync_schedule_type == o.sync_schedule_type &&
|
272
|
+
sync_interval == o.sync_interval &&
|
273
|
+
imap_host == o.imap_host &&
|
274
|
+
imap_port == o.imap_port &&
|
275
|
+
imap_username == o.imap_username &&
|
276
|
+
imap_password == o.imap_password &&
|
277
|
+
imap_ssl == o.imap_ssl &&
|
278
|
+
created_at == o.created_at
|
279
|
+
end
|
280
|
+
|
281
|
+
# @see the `==` method
|
282
|
+
# @param [Object] Object to be compared
|
283
|
+
def eql?(o)
|
284
|
+
self == o
|
285
|
+
end
|
286
|
+
|
287
|
+
# Calculates hash code according to all attributes.
|
288
|
+
# @return [Integer] Hash code
|
289
|
+
def hash
|
290
|
+
[id, user_id, connector_type, connector_auth_type, sync_enabled, sync_schedule_type, sync_interval, imap_host, imap_port, imap_username, imap_password, imap_ssl, created_at].hash
|
291
|
+
end
|
292
|
+
|
293
|
+
# Builds the object from hash
|
294
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
295
|
+
# @return [Object] Returns the model itself
|
296
|
+
def self.build_from_hash(attributes)
|
297
|
+
new.build_from_hash(attributes)
|
298
|
+
end
|
299
|
+
|
300
|
+
# Builds the object from hash
|
301
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
302
|
+
# @return [Object] Returns the model itself
|
303
|
+
def build_from_hash(attributes)
|
304
|
+
return nil unless attributes.is_a?(Hash)
|
305
|
+
self.class.openapi_types.each_pair do |key, type|
|
306
|
+
if type =~ /\AArray<(.*)>/i
|
307
|
+
# check to ensure the input is an array given that the attribute
|
308
|
+
# is documented as an array but the input is not
|
309
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
310
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
311
|
+
end
|
312
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
313
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
314
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
315
|
+
end
|
316
|
+
|
317
|
+
self
|
318
|
+
end
|
319
|
+
|
320
|
+
# Deserializes the data based on type
|
321
|
+
# @param string type Data type
|
322
|
+
# @param string value Value to be deserialized
|
323
|
+
# @return [Object] Deserialized data
|
324
|
+
def _deserialize(type, value)
|
325
|
+
case type.to_sym
|
326
|
+
when :DateTime
|
327
|
+
DateTime.parse(value)
|
328
|
+
when :Date
|
329
|
+
Date.parse(value)
|
330
|
+
when :String
|
331
|
+
value.to_s
|
332
|
+
when :Integer
|
333
|
+
value.to_i
|
334
|
+
when :Float
|
335
|
+
value.to_f
|
336
|
+
when :Boolean
|
337
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
338
|
+
true
|
339
|
+
else
|
340
|
+
false
|
341
|
+
end
|
342
|
+
when :Object
|
343
|
+
# generic object (usually a Hash), return directly
|
344
|
+
value
|
345
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
346
|
+
inner_type = Regexp.last_match[:inner_type]
|
347
|
+
value.map { |v| _deserialize(inner_type, v) }
|
348
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
349
|
+
k_type = Regexp.last_match[:k_type]
|
350
|
+
v_type = Regexp.last_match[:v_type]
|
351
|
+
{}.tap do |hash|
|
352
|
+
value.each do |k, v|
|
353
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
354
|
+
end
|
355
|
+
end
|
356
|
+
else # model
|
357
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
# Returns the string representation of the object
|
362
|
+
# @return [String] String presentation of the object
|
363
|
+
def to_s
|
364
|
+
to_hash.to_s
|
365
|
+
end
|
366
|
+
|
367
|
+
# to_body is an alias to to_hash (backward compatibility)
|
368
|
+
# @return [Hash] Returns the object in the form of hash
|
369
|
+
def to_body
|
370
|
+
to_hash
|
371
|
+
end
|
372
|
+
|
373
|
+
# Returns the object in the form of hash
|
374
|
+
# @return [Hash] Returns the object in the form of hash
|
375
|
+
def to_hash
|
376
|
+
hash = {}
|
377
|
+
self.class.attribute_map.each_pair do |attr, param|
|
378
|
+
value = self.send(attr)
|
379
|
+
if value.nil?
|
380
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
381
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
382
|
+
end
|
383
|
+
|
384
|
+
hash[param] = _to_hash(value)
|
385
|
+
end
|
386
|
+
hash
|
387
|
+
end
|
388
|
+
|
389
|
+
# Outputs non-array value in the form of hash
|
390
|
+
# For object, use to_hash. Otherwise, just return the value
|
391
|
+
# @param [Object] value Any valid value
|
392
|
+
# @return [Hash] Returns the value in the form of hash
|
393
|
+
def _to_hash(value)
|
394
|
+
if value.is_a?(Array)
|
395
|
+
value.compact.map { |v| _to_hash(v) }
|
396
|
+
elsif value.is_a?(Hash)
|
397
|
+
{}.tap do |hash|
|
398
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
399
|
+
end
|
400
|
+
elsif value.respond_to? :to_hash
|
401
|
+
value.to_hash
|
402
|
+
else
|
403
|
+
value
|
404
|
+
end
|
405
|
+
end
|
406
|
+
end
|
407
|
+
end
|