sendmux-sending 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 +8 -0
- data/lib/sendmux/sending/version.rb +1 -1
- data/lib/sendmux_sending_generated/api/meta_api.rb +60 -0
- data/lib/sendmux_sending_generated/models/connection.rb +273 -0
- data/lib/sendmux_sending_generated/models/connection_credential.rb +226 -0
- data/lib/sendmux_sending_generated/models/connection_mailboxes_inner.rb +190 -0
- data/lib/sendmux_sending_generated/models/connection_response.rb +223 -0
- data/lib/sendmux_sending_generated/models/connection_team.rb +190 -0
- data/lib/sendmux_sending_generated/models/email_send_request.rb +12 -12
- data/lib/sendmux_sending_generated.rb +5 -0
- metadata +9 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93f7898501dac6b038c2b64530535627dd8b3178f2434a5e48cf1b99c4473561
|
|
4
|
+
data.tar.gz: 4eeb6992dd17fef37619abfec88e608d9d58ab1766d66c959ddd8fb4fddfef4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43ebf3cd892bbd8b1a0f888e91601f825c996792d4e0958574b70d0fcfc7f5879af8dcf6217f98b88c7758053c76d9e8e1ab31dcd47ab3229f5408d0df4012f6
|
|
7
|
+
data.tar.gz: 77cd109cdaa57e393ab4f607fa402cb2dc52c2cf7b1b4c51ca54e079c7f1116070ab5f6396947f173669494c69dfb70cb6c65aa79c5236ea147b024234345e47
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sending/v1.2.0...ruby-sending/v1.3.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
|
+
|
|
3
11
|
## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sending/v1.1.0...ruby-sending/v1.2.0) (2026-07-08)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -19,6 +19,66 @@ module Sendmux::Sending::Generated
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Get Sending connection
|
|
23
|
+
# Validate this Sending credential and return its team, connection label, permissions and authorised mailboxes. Requires email.send. Credits, provider readiness and mailbox storage are not checked. No user profile or secrets are returned.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :if_none_match Weak ETag from a previous response. When it matches the current resource, the server returns 304 Not Modified with no body.
|
|
26
|
+
# @return [ConnectionResponse]
|
|
27
|
+
def sending_get_connection(opts = {})
|
|
28
|
+
data, _status_code, _headers = sending_get_connection_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get Sending connection
|
|
33
|
+
# Validate this Sending credential and return its team, connection label, permissions and authorised mailboxes. Requires email.send. Credits, provider readiness and mailbox storage are not checked. No user profile or secrets are returned.
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @option opts [String] :if_none_match Weak ETag from a previous response. When it matches the current resource, the server returns 304 Not Modified with no body.
|
|
36
|
+
# @return [Array<(ConnectionResponse, Integer, Hash)>] ConnectionResponse data, response status code and response headers
|
|
37
|
+
def sending_get_connection_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: MetaApi.sending_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 => :"MetaApi.sending_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: MetaApi#sending_get_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
return data, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
|
|
22
82
|
# OpenAPI 3.1 specification
|
|
23
83
|
# Auto-generated OpenAPI 3.1 spec for the Sendmux Sending API. Public endpoint (no authentication). Emits a weak ETag; clients may send `If-None-Match` to receive 304 Not Modified.
|
|
24
84
|
# @param [Hash] opts the optional parameters
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux Sending API
|
|
3
|
+
|
|
4
|
+
#Send emails programmatically via the Sendmux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
|
|
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::Sending::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::Sending::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::Sending::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 Sending API
|
|
3
|
+
|
|
4
|
+
#Send emails programmatically via the Sendmux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
|
|
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::Sending::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::Sending::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::Sending::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 Sending API
|
|
3
|
+
|
|
4
|
+
#Send emails programmatically via the Sendmux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
|
|
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::Sending::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::Sending::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::Sending::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 Sending API
|
|
3
|
+
|
|
4
|
+
#Send emails programmatically via the Sendmux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
|
|
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::Sending::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' => :'Meta',
|
|
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::Sending::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::Sending::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 Sending API
|
|
3
|
+
|
|
4
|
+
#Send emails programmatically via the Sendmux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
|
|
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::Sending::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::Sending::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::Sending::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
|
|
@@ -18,10 +18,10 @@ module Sendmux::Sending::Generated
|
|
|
18
18
|
# File attachments (max 10). Use attachment_id refs for uploaded files.
|
|
19
19
|
attr_accessor :attachments
|
|
20
20
|
|
|
21
|
-
# BCC recipients (
|
|
21
|
+
# BCC recipients (subject to 50 total To, CC, and BCC recipients)
|
|
22
22
|
attr_accessor :bcc
|
|
23
23
|
|
|
24
|
-
# CC recipients (
|
|
24
|
+
# CC recipients (subject to 50 total To, CC, and BCC recipients)
|
|
25
25
|
attr_accessor :cc
|
|
26
26
|
|
|
27
27
|
# Custom X-* headers to include in the email
|
|
@@ -183,12 +183,12 @@ module Sendmux::Sending::Generated
|
|
|
183
183
|
invalid_properties.push('invalid value for "attachments", number of items must be less than or equal to 10.')
|
|
184
184
|
end
|
|
185
185
|
|
|
186
|
-
if !@bcc.nil? && @bcc.length >
|
|
187
|
-
invalid_properties.push('invalid value for "bcc", number of items must be less than or equal to
|
|
186
|
+
if !@bcc.nil? && @bcc.length > 49
|
|
187
|
+
invalid_properties.push('invalid value for "bcc", number of items must be less than or equal to 49.')
|
|
188
188
|
end
|
|
189
189
|
|
|
190
|
-
if !@cc.nil? && @cc.length >
|
|
191
|
-
invalid_properties.push('invalid value for "cc", number of items must be less than or equal to
|
|
190
|
+
if !@cc.nil? && @cc.length > 49
|
|
191
|
+
invalid_properties.push('invalid value for "cc", number of items must be less than or equal to 49.')
|
|
192
192
|
end
|
|
193
193
|
|
|
194
194
|
if @from.nil?
|
|
@@ -244,8 +244,8 @@ module Sendmux::Sending::Generated
|
|
|
244
244
|
def valid?
|
|
245
245
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
246
246
|
return false if !@attachments.nil? && @attachments.length > 10
|
|
247
|
-
return false if !@bcc.nil? && @bcc.length >
|
|
248
|
-
return false if !@cc.nil? && @cc.length >
|
|
247
|
+
return false if !@bcc.nil? && @bcc.length > 49
|
|
248
|
+
return false if !@cc.nil? && @cc.length > 49
|
|
249
249
|
return false if @from.nil?
|
|
250
250
|
return false if @html_body.nil?
|
|
251
251
|
return false if @html_body.to_s.length > 26214400
|
|
@@ -281,8 +281,8 @@ module Sendmux::Sending::Generated
|
|
|
281
281
|
fail ArgumentError, 'bcc cannot be nil'
|
|
282
282
|
end
|
|
283
283
|
|
|
284
|
-
if bcc.length >
|
|
285
|
-
fail ArgumentError, 'invalid value for "bcc", number of items must be less than or equal to
|
|
284
|
+
if bcc.length > 49
|
|
285
|
+
fail ArgumentError, 'invalid value for "bcc", number of items must be less than or equal to 49.'
|
|
286
286
|
end
|
|
287
287
|
|
|
288
288
|
@bcc = bcc
|
|
@@ -295,8 +295,8 @@ module Sendmux::Sending::Generated
|
|
|
295
295
|
fail ArgumentError, 'cc cannot be nil'
|
|
296
296
|
end
|
|
297
297
|
|
|
298
|
-
if cc.length >
|
|
299
|
-
fail ArgumentError, 'invalid value for "cc", number of items must be less than or equal to
|
|
298
|
+
if cc.length > 49
|
|
299
|
+
fail ArgumentError, 'invalid value for "cc", number of items must be less than or equal to 49.'
|
|
300
300
|
end
|
|
301
301
|
|
|
302
302
|
@cc = cc
|
|
@@ -30,6 +30,11 @@ require 'sendmux_sending_generated/models/batch_send_request'
|
|
|
30
30
|
require 'sendmux_sending_generated/models/batch_send_success_data'
|
|
31
31
|
require 'sendmux_sending_generated/models/batch_send_success_response'
|
|
32
32
|
require 'sendmux_sending_generated/models/batch_summary'
|
|
33
|
+
require 'sendmux_sending_generated/models/connection'
|
|
34
|
+
require 'sendmux_sending_generated/models/connection_credential'
|
|
35
|
+
require 'sendmux_sending_generated/models/connection_mailboxes_inner'
|
|
36
|
+
require 'sendmux_sending_generated/models/connection_response'
|
|
37
|
+
require 'sendmux_sending_generated/models/connection_team'
|
|
33
38
|
require 'sendmux_sending_generated/models/email_send_request'
|
|
34
39
|
require 'sendmux_sending_generated/models/error_detail'
|
|
35
40
|
require 'sendmux_sending_generated/models/error_issue'
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sendmux-sending
|
|
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
|
|
@@ -77,7 +77,7 @@ dependencies:
|
|
|
77
77
|
requirements:
|
|
78
78
|
- - ">="
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: 1.
|
|
80
|
+
version: 1.2.0
|
|
81
81
|
- - "<"
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
83
|
version: '2.0'
|
|
@@ -87,7 +87,7 @@ dependencies:
|
|
|
87
87
|
requirements:
|
|
88
88
|
- - ">="
|
|
89
89
|
- !ruby/object:Gem::Version
|
|
90
|
-
version: 1.
|
|
90
|
+
version: 1.2.0
|
|
91
91
|
- - "<"
|
|
92
92
|
- !ruby/object:Gem::Version
|
|
93
93
|
version: '2.0'
|
|
@@ -123,6 +123,11 @@ files:
|
|
|
123
123
|
- lib/sendmux_sending_generated/models/batch_send_success_data.rb
|
|
124
124
|
- lib/sendmux_sending_generated/models/batch_send_success_response.rb
|
|
125
125
|
- lib/sendmux_sending_generated/models/batch_summary.rb
|
|
126
|
+
- lib/sendmux_sending_generated/models/connection.rb
|
|
127
|
+
- lib/sendmux_sending_generated/models/connection_credential.rb
|
|
128
|
+
- lib/sendmux_sending_generated/models/connection_mailboxes_inner.rb
|
|
129
|
+
- lib/sendmux_sending_generated/models/connection_response.rb
|
|
130
|
+
- lib/sendmux_sending_generated/models/connection_team.rb
|
|
126
131
|
- lib/sendmux_sending_generated/models/email_send_request.rb
|
|
127
132
|
- lib/sendmux_sending_generated/models/error_detail.rb
|
|
128
133
|
- lib/sendmux_sending_generated/models/error_issue.rb
|