sendmux-management 1.1.0 → 1.2.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 +23 -0
- data/lib/sendmux/management/client.rb +4 -0
- data/lib/sendmux/management/version.rb +1 -1
- data/lib/sendmux_management_generated/api/billing_api.rb +2 -2
- data/lib/sendmux_management_generated/api/connection_api.rb +82 -0
- data/lib/sendmux_management_generated/api/domains_api.rb +2 -2
- data/lib/sendmux_management_generated/models/balance.rb +1 -1
- data/lib/sendmux_management_generated/models/connection.rb +273 -0
- data/lib/sendmux_management_generated/models/connection_credential.rb +226 -0
- data/lib/sendmux_management_generated/models/connection_mailboxes_inner.rb +190 -0
- data/lib/sendmux_management_generated/models/connection_response.rb +223 -0
- data/lib/sendmux_management_generated/models/connection_team.rb +190 -0
- data/lib/sendmux_management_generated/models/delivery_log_detail.rb +534 -0
- data/lib/sendmux_management_generated/models/delivery_log_item.rb +112 -1
- data/lib/sendmux_management_generated/models/delivery_log_item_response.rb +1 -1
- data/lib/sendmux_management_generated/models/delivery_log_recipient.rb +254 -0
- data/lib/sendmux_management_generated/models/mailbox_domain.rb +53 -1
- data/lib/sendmux_management_generated/models/mailbox_domain_verify_checks.rb +3 -3
- data/lib/sendmux_management_generated/models/mailbox_domain_verify_result.rb +111 -3
- data/lib/sendmux_management_generated/models/management_create_mailbox_request.rb +11 -0
- data/lib/sendmux_management_generated/models/provider_create_body.rb +1 -0
- data/lib/sendmux_management_generated/models/provider_item.rb +1 -1
- data/lib/sendmux_management_generated/models/provider_update_body.rb +1 -0
- data/lib/sendmux_management_generated.rb +8 -0
- metadata +20 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8ab49b5a6f27dd2850e8187038f471a974eb1b66b3fb6f90edaef2cbe95b965f
|
|
4
|
+
data.tar.gz: b41f60c71e0dccaa373d3449b7cd9d1d61d8025959a0422e0e5483b708479362
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f194649235b4571697b83f14397f1807c81a57a47fda866ee2b7ef8fcf696fcf18d26d324fb68d60065554edb7754e9bcfcdaa4881df9417668abd99cc2e5ee
|
|
7
|
+
data.tar.gz: ac25a55e6534189cdaac5b6892607d3b8ddd34f7a1e8e357315b27b4190ff2ac07c433c3f1ff4aa94f2002210e2178490be36ba8f27fb97f6b390d67c3863ba7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-management/v1.1.1...ruby-management/v1.2.0) (2026-09-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add connection checks across SDKs, CLI and MCP ([77f449e](https://github.com/Sendmux/sendmux-sdk/commit/77f449e2c8cba49bc8bc84c49c35baa61120866a))
|
|
9
|
+
* **sdk:** add connection checks across clients, CLI and MCP ([3e02c67](https://github.com/Sendmux/sendmux-sdk/commit/3e02c67dcab45e37dad7abbdd4c4e1bd0b1fbbe6))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* anchor generated Ruby email validation ([a87933b](https://github.com/Sendmux/sendmux-sdk/commit/a87933b507c572104b1832818e7db0587ad0352b))
|
|
15
|
+
* reject mailbox email line breaks in generated clients ([7934cbe](https://github.com/Sendmux/sendmux-sdk/commit/7934cbe13f1d966878239e7c1d9e75ba44927937))
|
|
16
|
+
* sync mailbox reliability clients ([fad78fa](https://github.com/Sendmux/sendmux-sdk/commit/fad78faf1d495c31bc0e0c40ef7d605f72727431))
|
|
17
|
+
* sync mailbox reliability clients ([e8e7148](https://github.com/Sendmux/sendmux-sdk/commit/e8e7148e21f8fdba790c89331e8a2e144f86be4b))
|
|
18
|
+
|
|
19
|
+
## [1.1.1](https://github.com/Sendmux/sendmux-sdk/compare/ruby-management/v1.1.0...ruby-management/v1.1.1) (2026-08-07)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **sdk:** regenerate management clients for the Amazon SES identity fields ([#137](https://github.com/Sendmux/sendmux-sdk/issues/137)) ([b0a3d63](https://github.com/Sendmux/sendmux-sdk/commit/b0a3d63f7d836d3d0e290a5b8c4e315a1a017e43))
|
|
25
|
+
|
|
3
26
|
## [1.1.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-management/v1.0.0...ruby-management/v1.1.0) (2026-07-08)
|
|
4
27
|
|
|
5
28
|
|
|
@@ -30,6 +30,10 @@ module Sendmux
|
|
|
30
30
|
@billing ||= Generated::BillingApi.new(@api_client)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
def connection
|
|
34
|
+
@connection ||= Generated::ConnectionApi.new(@api_client)
|
|
35
|
+
end
|
|
36
|
+
|
|
33
37
|
def domain_filters
|
|
34
38
|
@domain_filters ||= Generated::DomainFiltersApi.new(@api_client)
|
|
35
39
|
end
|
|
@@ -84,7 +84,7 @@ module Sendmux::Management::Generated
|
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
# Get current balance
|
|
87
|
-
# Returns the current
|
|
87
|
+
# Returns the current spendable balance.
|
|
88
88
|
# @param [Hash] opts the optional parameters
|
|
89
89
|
# @return [BalanceResponse]
|
|
90
90
|
def management_list_balance(opts = {})
|
|
@@ -93,7 +93,7 @@ module Sendmux::Management::Generated
|
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
# Get current balance
|
|
96
|
-
# Returns the current
|
|
96
|
+
# Returns the current spendable balance.
|
|
97
97
|
# @param [Hash] opts the optional parameters
|
|
98
98
|
# @return [Array<(BalanceResponse, Integer, Hash)>] BalanceResponse data, response status code and response headers
|
|
99
99
|
def management_list_balance_with_http_info(opts = {})
|
|
@@ -0,0 +1,82 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Sendmux::Management::Generated
|
|
16
|
+
class ConnectionApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get Management connection
|
|
23
|
+
# 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.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :if_none_match ETag from a previous response. A match returns 304 with no body after rechecking authentication.
|
|
26
|
+
# @return [ConnectionResponse]
|
|
27
|
+
def management_get_connection(opts = {})
|
|
28
|
+
data, _status_code, _headers = management_get_connection_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get Management connection
|
|
33
|
+
# 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.
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @option opts [String] :if_none_match ETag from a previous response. A match returns 304 with no body after rechecking authentication.
|
|
36
|
+
# @return [Array<(ConnectionResponse, Integer, Hash)>] ConnectionResponse data, response status code and response headers
|
|
37
|
+
def management_get_connection_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ConnectionApi.management_get_connection ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/me'
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
51
|
+
header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:debug_body]
|
|
58
|
+
|
|
59
|
+
# return_type
|
|
60
|
+
return_type = opts[:debug_return_type] || 'ConnectionResponse'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"ConnectionApi.management_get_connection",
|
|
67
|
+
:header_params => header_params,
|
|
68
|
+
:query_params => query_params,
|
|
69
|
+
:form_params => form_params,
|
|
70
|
+
:body => post_body,
|
|
71
|
+
:auth_names => auth_names,
|
|
72
|
+
:return_type => return_type
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
76
|
+
if @api_client.config.debugging
|
|
77
|
+
@api_client.config.logger.debug "API called: ConnectionApi#management_get_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
return data, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -427,7 +427,7 @@ module Sendmux::Management::Generated
|
|
|
427
427
|
end
|
|
428
428
|
|
|
429
429
|
# Verify a mailbox domain
|
|
430
|
-
#
|
|
430
|
+
# Checks the domain's published DNS records and latest Amazon SES DKIM and MAIL FROM statuses. If every required check passes, the domain is marked verified. A previously failed domain remains failed until a complete check succeeds. Domains automatically re-verify every 6 hours — this endpoint is only needed to trigger a check on demand.
|
|
431
431
|
# @param public_id [String]
|
|
432
432
|
# @param [Hash] opts the optional parameters
|
|
433
433
|
# @return [DomainVerifyResponse]
|
|
@@ -437,7 +437,7 @@ module Sendmux::Management::Generated
|
|
|
437
437
|
end
|
|
438
438
|
|
|
439
439
|
# Verify a mailbox domain
|
|
440
|
-
#
|
|
440
|
+
# Checks the domain's published DNS records and latest Amazon SES DKIM and MAIL FROM statuses. If every required check passes, the domain is marked verified. A previously failed domain remains failed until a complete check succeeds. Domains automatically re-verify every 6 hours — this endpoint is only needed to trigger a check on demand.
|
|
441
441
|
# @param public_id [String]
|
|
442
442
|
# @param [Hash] opts the optional parameters
|
|
443
443
|
# @return [Array<(DomainVerifyResponse, Integer, Hash)>] DomainVerifyResponse data, response status code and response headers
|
|
@@ -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::Management::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::Management::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::Management::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::Management::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::Management::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::Management::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
|