sendmux-mailbox 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/lib/sendmux/mailbox/version.rb +1 -1
- data/lib/sendmux_mailbox_generated/api/mailbox_api_api.rb +60 -0
- data/lib/sendmux_mailbox_generated/models/connection.rb +273 -0
- data/lib/sendmux_mailbox_generated/models/connection_credential.rb +226 -0
- data/lib/sendmux_mailbox_generated/models/connection_mailboxes_inner.rb +190 -0
- data/lib/sendmux_mailbox_generated/models/connection_response.rb +223 -0
- data/lib/sendmux_mailbox_generated/models/connection_team.rb +190 -0
- data/lib/sendmux_mailbox_generated.rb +5 -0
- metadata +17 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 675f68429fdf2327e99af6d26ab121614d007af94ced51b8999f7f43159b2930
|
|
4
|
+
data.tar.gz: 2db336e1d9fcc409d78bf1c03c37135b6fec72a111cb465505a306676ea8395c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb250495dad7379c057540ca6ec091c55cc3cf921e46c9976200f49afcac27bdeb2b18ec8463016d89bb503da61bd2c931a1c0b3d4cff6b247c4ca7def1b9838
|
|
7
|
+
data.tar.gz: ddef890017700892d7e4cb3c09baba67e52f0958915182d9f283c5dadfceaf0b25e5078cd2464efde8647e3249cc53710fb7e4a26748ea35079c13c5f6888500
|
data/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## [1.3.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-mailbox/v1.2.0...ruby-mailbox/v1.3.0) (2026-09-08)
|
|
4
|
+
|
|
4
5
|
|
|
5
6
|
### Features
|
|
6
7
|
|
|
7
8
|
* regenerate mailbox models for short-lived attachment download URLs and upload intents
|
|
9
|
+
* add connection checks across SDKs, CLI and MCP ([77f449e](https://github.com/Sendmux/sendmux-sdk/commit/77f449e2c8cba49bc8bc84c49c35baa61120866a))
|
|
10
|
+
* **sdk:** add connection checks across clients, CLI and MCP ([3e02c67](https://github.com/Sendmux/sendmux-sdk/commit/3e02c67dcab45e37dad7abbdd4c4e1bd0b1fbbe6))
|
|
8
11
|
|
|
9
12
|
## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-mailbox/v1.1.0...ruby-mailbox/v1.2.0) (2026-07-08)
|
|
10
13
|
|
|
@@ -715,6 +715,66 @@ module Sendmux::Mailbox::Generated
|
|
|
715
715
|
return data, status_code, headers
|
|
716
716
|
end
|
|
717
717
|
|
|
718
|
+
# Get Mailbox connection
|
|
719
|
+
# Validate this credential and return its team, connection label, permissions and authorised mailboxes. No additional read permission or mailbox selection is required. Mailbox storage and sending availability are not checked. No user profile or secrets are returned.
|
|
720
|
+
# @param [Hash] opts the optional parameters
|
|
721
|
+
# @option opts [String] :if_none_match ETag from a previous response. A match returns 304 with no body after rechecking authentication.
|
|
722
|
+
# @return [ConnectionResponse]
|
|
723
|
+
def mailbox_get_connection(opts = {})
|
|
724
|
+
data, _status_code, _headers = mailbox_get_connection_with_http_info(opts)
|
|
725
|
+
data
|
|
726
|
+
end
|
|
727
|
+
|
|
728
|
+
# Get Mailbox connection
|
|
729
|
+
# Validate this credential and return its team, connection label, permissions and authorised mailboxes. No additional read permission or mailbox selection is required. Mailbox storage and sending availability are not checked. No user profile or secrets are returned.
|
|
730
|
+
# @param [Hash] opts the optional parameters
|
|
731
|
+
# @option opts [String] :if_none_match ETag from a previous response. A match returns 304 with no body after rechecking authentication.
|
|
732
|
+
# @return [Array<(ConnectionResponse, Integer, Hash)>] ConnectionResponse data, response status code and response headers
|
|
733
|
+
def mailbox_get_connection_with_http_info(opts = {})
|
|
734
|
+
if @api_client.config.debugging
|
|
735
|
+
@api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_connection ...'
|
|
736
|
+
end
|
|
737
|
+
# resource path
|
|
738
|
+
local_var_path = '/mailbox/connection'
|
|
739
|
+
|
|
740
|
+
# query parameters
|
|
741
|
+
query_params = opts[:query_params] || {}
|
|
742
|
+
|
|
743
|
+
# header parameters
|
|
744
|
+
header_params = opts[:header_params] || {}
|
|
745
|
+
# HTTP header 'Accept' (if needed)
|
|
746
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
747
|
+
header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
|
|
748
|
+
|
|
749
|
+
# form parameters
|
|
750
|
+
form_params = opts[:form_params] || {}
|
|
751
|
+
|
|
752
|
+
# http body (model)
|
|
753
|
+
post_body = opts[:debug_body]
|
|
754
|
+
|
|
755
|
+
# return_type
|
|
756
|
+
return_type = opts[:debug_return_type] || 'ConnectionResponse'
|
|
757
|
+
|
|
758
|
+
# auth_names
|
|
759
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
760
|
+
|
|
761
|
+
new_options = opts.merge(
|
|
762
|
+
:operation => :"MailboxAPIApi.mailbox_get_connection",
|
|
763
|
+
:header_params => header_params,
|
|
764
|
+
:query_params => query_params,
|
|
765
|
+
:form_params => form_params,
|
|
766
|
+
:body => post_body,
|
|
767
|
+
:auth_names => auth_names,
|
|
768
|
+
:return_type => return_type
|
|
769
|
+
)
|
|
770
|
+
|
|
771
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
772
|
+
if @api_client.config.debugging
|
|
773
|
+
@api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
774
|
+
end
|
|
775
|
+
return data, status_code, headers
|
|
776
|
+
end
|
|
777
|
+
|
|
718
778
|
# Get a mailbox folder
|
|
719
779
|
# Returns one folder from the authenticated mailbox. Responses include a weak `ETag` header.
|
|
720
780
|
# @param folder_id [String]
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Sendmux::Mailbox::Generated
|
|
17
|
+
class Connection < ApiModelBase
|
|
18
|
+
attr_accessor :credential
|
|
19
|
+
|
|
20
|
+
# Display label for this connection.
|
|
21
|
+
attr_accessor :label
|
|
22
|
+
|
|
23
|
+
attr_accessor :mailboxes
|
|
24
|
+
|
|
25
|
+
attr_accessor :permissions
|
|
26
|
+
|
|
27
|
+
attr_accessor :team
|
|
28
|
+
|
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
|
+
def self.attribute_map
|
|
31
|
+
{
|
|
32
|
+
:'credential' => :'credential',
|
|
33
|
+
:'label' => :'label',
|
|
34
|
+
:'mailboxes' => :'mailboxes',
|
|
35
|
+
:'permissions' => :'permissions',
|
|
36
|
+
:'team' => :'team'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'credential' => :'ConnectionCredential',
|
|
54
|
+
:'label' => :'String',
|
|
55
|
+
:'mailboxes' => :'Array<ConnectionMailboxesInner>',
|
|
56
|
+
:'permissions' => :'Array<String>',
|
|
57
|
+
:'team' => :'ConnectionTeam'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::Connection` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::Connection`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'credential')
|
|
84
|
+
self.credential = attributes[:'credential']
|
|
85
|
+
else
|
|
86
|
+
self.credential = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'label')
|
|
90
|
+
self.label = attributes[:'label']
|
|
91
|
+
else
|
|
92
|
+
self.label = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'mailboxes')
|
|
96
|
+
if (value = attributes[:'mailboxes']).is_a?(Array)
|
|
97
|
+
self.mailboxes = value
|
|
98
|
+
end
|
|
99
|
+
else
|
|
100
|
+
self.mailboxes = nil
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'permissions')
|
|
104
|
+
if (value = attributes[:'permissions']).is_a?(Array)
|
|
105
|
+
self.permissions = value
|
|
106
|
+
end
|
|
107
|
+
else
|
|
108
|
+
self.permissions = nil
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'team')
|
|
112
|
+
self.team = attributes[:'team']
|
|
113
|
+
else
|
|
114
|
+
self.team = nil
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
120
|
+
def list_invalid_properties
|
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
122
|
+
invalid_properties = Array.new
|
|
123
|
+
if @credential.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "credential", credential cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if @label.nil?
|
|
128
|
+
invalid_properties.push('invalid value for "label", label cannot be nil.')
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if @mailboxes.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "mailboxes", mailboxes cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if @permissions.nil?
|
|
136
|
+
invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if @team.nil?
|
|
140
|
+
invalid_properties.push('invalid value for "team", team cannot be nil.')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
invalid_properties
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Check to see if the all the properties in the model are valid
|
|
147
|
+
# @return true if the model is valid
|
|
148
|
+
def valid?
|
|
149
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
150
|
+
return false if @credential.nil?
|
|
151
|
+
return false if @label.nil?
|
|
152
|
+
return false if @mailboxes.nil?
|
|
153
|
+
return false if @permissions.nil?
|
|
154
|
+
return false if @team.nil?
|
|
155
|
+
true
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Custom attribute writer method with validation
|
|
159
|
+
# @param [Object] credential Value to be assigned
|
|
160
|
+
def credential=(credential)
|
|
161
|
+
if credential.nil?
|
|
162
|
+
fail ArgumentError, 'credential cannot be nil'
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
@credential = credential
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Custom attribute writer method with validation
|
|
169
|
+
# @param [Object] label Value to be assigned
|
|
170
|
+
def label=(label)
|
|
171
|
+
if label.nil?
|
|
172
|
+
fail ArgumentError, 'label cannot be nil'
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
@label = label
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Custom attribute writer method with validation
|
|
179
|
+
# @param [Object] mailboxes Value to be assigned
|
|
180
|
+
def mailboxes=(mailboxes)
|
|
181
|
+
if mailboxes.nil?
|
|
182
|
+
fail ArgumentError, 'mailboxes cannot be nil'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
@mailboxes = mailboxes
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Custom attribute writer method with validation
|
|
189
|
+
# @param [Object] permissions Value to be assigned
|
|
190
|
+
def permissions=(permissions)
|
|
191
|
+
if permissions.nil?
|
|
192
|
+
fail ArgumentError, 'permissions cannot be nil'
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
@permissions = permissions
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Custom attribute writer method with validation
|
|
199
|
+
# @param [Object] team Value to be assigned
|
|
200
|
+
def team=(team)
|
|
201
|
+
if team.nil?
|
|
202
|
+
fail ArgumentError, 'team cannot be nil'
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
@team = team
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Checks equality by comparing each attribute.
|
|
209
|
+
# @param [Object] Object to be compared
|
|
210
|
+
def ==(o)
|
|
211
|
+
return true if self.equal?(o)
|
|
212
|
+
self.class == o.class &&
|
|
213
|
+
credential == o.credential &&
|
|
214
|
+
label == o.label &&
|
|
215
|
+
mailboxes == o.mailboxes &&
|
|
216
|
+
permissions == o.permissions &&
|
|
217
|
+
team == o.team
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# @see the `==` method
|
|
221
|
+
# @param [Object] Object to be compared
|
|
222
|
+
def eql?(o)
|
|
223
|
+
self == o
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Calculates hash code according to all attributes.
|
|
227
|
+
# @return [Integer] Hash code
|
|
228
|
+
def hash
|
|
229
|
+
[credential, label, mailboxes, permissions, team].hash
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Builds the object from hash
|
|
233
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
234
|
+
# @return [Object] Returns the model itself
|
|
235
|
+
def self.build_from_hash(attributes)
|
|
236
|
+
return nil unless attributes.is_a?(Hash)
|
|
237
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
238
|
+
transformed_hash = {}
|
|
239
|
+
openapi_types.each_pair do |key, type|
|
|
240
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
241
|
+
transformed_hash["#{key}"] = nil
|
|
242
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
243
|
+
# check to ensure the input is an array given that the attribute
|
|
244
|
+
# is documented as an array but the input is not
|
|
245
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
246
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
247
|
+
end
|
|
248
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
249
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
new(transformed_hash)
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Returns the object in the form of hash
|
|
256
|
+
# @return [Hash] Returns the object in the form of hash
|
|
257
|
+
def to_hash
|
|
258
|
+
hash = {}
|
|
259
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
260
|
+
value = self.send(attr)
|
|
261
|
+
if value.nil?
|
|
262
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
263
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
hash[param] = _to_hash(value)
|
|
267
|
+
end
|
|
268
|
+
hash
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Sendmux::Mailbox::Generated
|
|
17
|
+
class ConnectionCredential < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'id' => :'id',
|
|
50
|
+
:'name' => :'name',
|
|
51
|
+
:'type' => :'type'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
|
61
|
+
def self.acceptable_attributes
|
|
62
|
+
acceptable_attribute_map.values
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.openapi_types
|
|
67
|
+
{
|
|
68
|
+
:'id' => :'String',
|
|
69
|
+
:'name' => :'String',
|
|
70
|
+
:'type' => :'String'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# List of attributes with nullable: true
|
|
75
|
+
def self.openapi_nullable
|
|
76
|
+
Set.new([
|
|
77
|
+
:'name',
|
|
78
|
+
])
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Initializes the object
|
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
83
|
+
def initialize(attributes = {})
|
|
84
|
+
if (!attributes.is_a?(Hash))
|
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::ConnectionCredential` initialize method"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::ConnectionCredential`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
|
+
end
|
|
94
|
+
h[k.to_sym] = v
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'id')
|
|
98
|
+
self.id = attributes[:'id']
|
|
99
|
+
else
|
|
100
|
+
self.id = nil
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'name')
|
|
104
|
+
self.name = attributes[:'name']
|
|
105
|
+
else
|
|
106
|
+
self.name = nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'type')
|
|
110
|
+
self.type = attributes[:'type']
|
|
111
|
+
else
|
|
112
|
+
self.type = nil
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
117
|
+
# @return Array for valid properties with the reasons
|
|
118
|
+
def list_invalid_properties
|
|
119
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
120
|
+
invalid_properties = Array.new
|
|
121
|
+
if @id.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if @type.nil?
|
|
126
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
invalid_properties
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Check to see if the all the properties in the model are valid
|
|
133
|
+
# @return true if the model is valid
|
|
134
|
+
def valid?
|
|
135
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
|
+
return false if @id.nil?
|
|
137
|
+
return false if @type.nil?
|
|
138
|
+
type_validator = EnumAttributeValidator.new('String', ["api_key", "oauth", "agent_token", "unknown_default_open_api"])
|
|
139
|
+
return false unless type_validator.valid?(@type)
|
|
140
|
+
true
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] id Value to be assigned
|
|
145
|
+
def id=(id)
|
|
146
|
+
if id.nil?
|
|
147
|
+
fail ArgumentError, 'id cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@id = id
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
154
|
+
# @param [Object] type Object to be assigned
|
|
155
|
+
def type=(type)
|
|
156
|
+
validator = EnumAttributeValidator.new('String', ["api_key", "oauth", "agent_token", "unknown_default_open_api"])
|
|
157
|
+
unless validator.valid?(type)
|
|
158
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
159
|
+
end
|
|
160
|
+
@type = type
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Checks equality by comparing each attribute.
|
|
164
|
+
# @param [Object] Object to be compared
|
|
165
|
+
def ==(o)
|
|
166
|
+
return true if self.equal?(o)
|
|
167
|
+
self.class == o.class &&
|
|
168
|
+
id == o.id &&
|
|
169
|
+
name == o.name &&
|
|
170
|
+
type == o.type
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# @see the `==` method
|
|
174
|
+
# @param [Object] Object to be compared
|
|
175
|
+
def eql?(o)
|
|
176
|
+
self == o
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Calculates hash code according to all attributes.
|
|
180
|
+
# @return [Integer] Hash code
|
|
181
|
+
def hash
|
|
182
|
+
[id, name, type].hash
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Builds the object from hash
|
|
186
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
187
|
+
# @return [Object] Returns the model itself
|
|
188
|
+
def self.build_from_hash(attributes)
|
|
189
|
+
return nil unless attributes.is_a?(Hash)
|
|
190
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
191
|
+
transformed_hash = {}
|
|
192
|
+
openapi_types.each_pair do |key, type|
|
|
193
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = nil
|
|
195
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
196
|
+
# check to ensure the input is an array given that the attribute
|
|
197
|
+
# is documented as an array but the input is not
|
|
198
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
199
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
200
|
+
end
|
|
201
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
202
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
new(transformed_hash)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Returns the object in the form of hash
|
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
|
210
|
+
def to_hash
|
|
211
|
+
hash = {}
|
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
213
|
+
value = self.send(attr)
|
|
214
|
+
if value.nil?
|
|
215
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
216
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
hash[param] = _to_hash(value)
|
|
220
|
+
end
|
|
221
|
+
hash
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
end
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Sendmux::Mailbox::Generated
|
|
17
|
+
class ConnectionMailboxesInner < ApiModelBase
|
|
18
|
+
attr_accessor :email
|
|
19
|
+
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'email' => :'email',
|
|
26
|
+
:'id' => :'id'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'email' => :'String',
|
|
44
|
+
:'id' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::ConnectionMailboxesInner` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::ConnectionMailboxesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'email')
|
|
71
|
+
self.email = attributes[:'email']
|
|
72
|
+
else
|
|
73
|
+
self.email = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'id')
|
|
77
|
+
self.id = attributes[:'id']
|
|
78
|
+
else
|
|
79
|
+
self.id = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @email.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @id.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @email.nil?
|
|
104
|
+
return false if @id.nil?
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Custom attribute writer method with validation
|
|
109
|
+
# @param [Object] email Value to be assigned
|
|
110
|
+
def email=(email)
|
|
111
|
+
if email.nil?
|
|
112
|
+
fail ArgumentError, 'email cannot be nil'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
@email = email
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] id Value to be assigned
|
|
120
|
+
def id=(id)
|
|
121
|
+
if id.nil?
|
|
122
|
+
fail ArgumentError, 'id cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@id = id
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
email == o.email &&
|
|
134
|
+
id == o.id
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[email, id].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Sendmux::Mailbox::Generated
|
|
17
|
+
class ConnectionResponse < ApiModelBase
|
|
18
|
+
attr_accessor :meta
|
|
19
|
+
|
|
20
|
+
attr_accessor :ok
|
|
21
|
+
|
|
22
|
+
attr_accessor :data
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'meta' => :'meta',
|
|
28
|
+
:'ok' => :'ok',
|
|
29
|
+
:'data' => :'data'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'meta' => :'ResponseMeta',
|
|
47
|
+
:'ok' => :'Boolean',
|
|
48
|
+
:'data' => :'Connection'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
59
|
+
def self.openapi_all_of
|
|
60
|
+
[
|
|
61
|
+
:'SuccessEnvelope'
|
|
62
|
+
]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Initializes the object
|
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
67
|
+
def initialize(attributes = {})
|
|
68
|
+
if (!attributes.is_a?(Hash))
|
|
69
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::ConnectionResponse` initialize method"
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
73
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::ConnectionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
77
|
+
end
|
|
78
|
+
h[k.to_sym] = v
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'meta')
|
|
82
|
+
self.meta = attributes[:'meta']
|
|
83
|
+
else
|
|
84
|
+
self.meta = nil
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'ok')
|
|
88
|
+
self.ok = attributes[:'ok']
|
|
89
|
+
else
|
|
90
|
+
self.ok = nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'data')
|
|
94
|
+
self.data = attributes[:'data']
|
|
95
|
+
else
|
|
96
|
+
self.data = nil
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
101
|
+
# @return Array for valid properties with the reasons
|
|
102
|
+
def list_invalid_properties
|
|
103
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
104
|
+
invalid_properties = Array.new
|
|
105
|
+
if @meta.nil?
|
|
106
|
+
invalid_properties.push('invalid value for "meta", meta cannot be nil.')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if @ok.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "ok", ok cannot be nil.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if @data.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
invalid_properties
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Check to see if the all the properties in the model are valid
|
|
121
|
+
# @return true if the model is valid
|
|
122
|
+
def valid?
|
|
123
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
124
|
+
return false if @meta.nil?
|
|
125
|
+
return false if @ok.nil?
|
|
126
|
+
return false if @data.nil?
|
|
127
|
+
true
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Custom attribute writer method with validation
|
|
131
|
+
# @param [Object] meta Value to be assigned
|
|
132
|
+
def meta=(meta)
|
|
133
|
+
if meta.nil?
|
|
134
|
+
fail ArgumentError, 'meta cannot be nil'
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
@meta = meta
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Custom attribute writer method with validation
|
|
141
|
+
# @param [Object] ok Value to be assigned
|
|
142
|
+
def ok=(ok)
|
|
143
|
+
if ok.nil?
|
|
144
|
+
fail ArgumentError, 'ok cannot be nil'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
@ok = ok
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Custom attribute writer method with validation
|
|
151
|
+
# @param [Object] data Value to be assigned
|
|
152
|
+
def data=(data)
|
|
153
|
+
if data.nil?
|
|
154
|
+
fail ArgumentError, 'data cannot be nil'
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
@data = data
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Checks equality by comparing each attribute.
|
|
161
|
+
# @param [Object] Object to be compared
|
|
162
|
+
def ==(o)
|
|
163
|
+
return true if self.equal?(o)
|
|
164
|
+
self.class == o.class &&
|
|
165
|
+
meta == o.meta &&
|
|
166
|
+
ok == o.ok &&
|
|
167
|
+
data == o.data
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# @see the `==` method
|
|
171
|
+
# @param [Object] Object to be compared
|
|
172
|
+
def eql?(o)
|
|
173
|
+
self == o
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Calculates hash code according to all attributes.
|
|
177
|
+
# @return [Integer] Hash code
|
|
178
|
+
def hash
|
|
179
|
+
[meta, ok, data].hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Builds the object from hash
|
|
183
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
184
|
+
# @return [Object] Returns the model itself
|
|
185
|
+
def self.build_from_hash(attributes)
|
|
186
|
+
return nil unless attributes.is_a?(Hash)
|
|
187
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
188
|
+
transformed_hash = {}
|
|
189
|
+
openapi_types.each_pair do |key, type|
|
|
190
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
191
|
+
transformed_hash["#{key}"] = nil
|
|
192
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
193
|
+
# check to ensure the input is an array given that the attribute
|
|
194
|
+
# is documented as an array but the input is not
|
|
195
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
196
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
197
|
+
end
|
|
198
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
199
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
new(transformed_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
|
+
end
|
|
222
|
+
|
|
223
|
+
end
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Sendmux::Mailbox::Generated
|
|
17
|
+
class ConnectionTeam < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'id' => :'id',
|
|
26
|
+
:'name' => :'name'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'id' => :'String',
|
|
44
|
+
:'name' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::ConnectionTeam` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::ConnectionTeam`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'id')
|
|
71
|
+
self.id = attributes[:'id']
|
|
72
|
+
else
|
|
73
|
+
self.id = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'name')
|
|
77
|
+
self.name = attributes[:'name']
|
|
78
|
+
else
|
|
79
|
+
self.name = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @id.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @name.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @id.nil?
|
|
104
|
+
return false if @name.nil?
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Custom attribute writer method with validation
|
|
109
|
+
# @param [Object] id Value to be assigned
|
|
110
|
+
def id=(id)
|
|
111
|
+
if id.nil?
|
|
112
|
+
fail ArgumentError, 'id cannot be nil'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
@id = id
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] name Value to be assigned
|
|
120
|
+
def name=(name)
|
|
121
|
+
if name.nil?
|
|
122
|
+
fail ArgumentError, 'name cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@name = name
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
id == o.id &&
|
|
134
|
+
name == o.name
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[id, name].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -24,6 +24,11 @@ require 'sendmux_mailbox_generated/models/api_error_meta'
|
|
|
24
24
|
require 'sendmux_mailbox_generated/models/api_error_response'
|
|
25
25
|
require 'sendmux_mailbox_generated/models/batch_delete_mailbox_messages_body'
|
|
26
26
|
require 'sendmux_mailbox_generated/models/batch_update_mailbox_messages_body'
|
|
27
|
+
require 'sendmux_mailbox_generated/models/connection'
|
|
28
|
+
require 'sendmux_mailbox_generated/models/connection_credential'
|
|
29
|
+
require 'sendmux_mailbox_generated/models/connection_mailboxes_inner'
|
|
30
|
+
require 'sendmux_mailbox_generated/models/connection_response'
|
|
31
|
+
require 'sendmux_mailbox_generated/models/connection_team'
|
|
27
32
|
require 'sendmux_mailbox_generated/models/create_mailbox_folder_body'
|
|
28
33
|
require 'sendmux_mailbox_generated/models/cursor_pagination'
|
|
29
34
|
require 'sendmux_mailbox_generated/models/granted_mailbox'
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sendmux-mailbox
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sendmux
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-09-08 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: faraday
|
|
@@ -75,16 +75,22 @@ dependencies:
|
|
|
75
75
|
name: sendmux-core
|
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
|
77
77
|
requirements:
|
|
78
|
-
- - "
|
|
78
|
+
- - ">="
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
|
-
version:
|
|
80
|
+
version: 1.2.0
|
|
81
|
+
- - "<"
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: '2.0'
|
|
81
84
|
type: :runtime
|
|
82
85
|
prerelease: false
|
|
83
86
|
version_requirements: !ruby/object:Gem::Requirement
|
|
84
87
|
requirements:
|
|
85
|
-
- - "
|
|
88
|
+
- - ">="
|
|
86
89
|
- !ruby/object:Gem::Version
|
|
87
|
-
version:
|
|
90
|
+
version: 1.2.0
|
|
91
|
+
- - "<"
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '2.0'
|
|
88
94
|
email:
|
|
89
95
|
- contact@sendmux.ai
|
|
90
96
|
executables: []
|
|
@@ -109,6 +115,11 @@ files:
|
|
|
109
115
|
- lib/sendmux_mailbox_generated/models/api_error_response.rb
|
|
110
116
|
- lib/sendmux_mailbox_generated/models/batch_delete_mailbox_messages_body.rb
|
|
111
117
|
- lib/sendmux_mailbox_generated/models/batch_update_mailbox_messages_body.rb
|
|
118
|
+
- lib/sendmux_mailbox_generated/models/connection.rb
|
|
119
|
+
- lib/sendmux_mailbox_generated/models/connection_credential.rb
|
|
120
|
+
- lib/sendmux_mailbox_generated/models/connection_mailboxes_inner.rb
|
|
121
|
+
- lib/sendmux_mailbox_generated/models/connection_response.rb
|
|
122
|
+
- lib/sendmux_mailbox_generated/models/connection_team.rb
|
|
112
123
|
- lib/sendmux_mailbox_generated/models/create_mailbox_folder_body.rb
|
|
113
124
|
- lib/sendmux_mailbox_generated/models/cursor_pagination.rb
|
|
114
125
|
- lib/sendmux_mailbox_generated/models/granted_mailbox.rb
|