sendmux-mailbox 2.0.0 → 2.0.2

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.
@@ -1,286 +0,0 @@
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 MailboxRawBodyResponseAllOfData < ApiModelBase
18
- attr_accessor :body
19
-
20
- # Message ID
21
- attr_accessor :id
22
-
23
- attr_accessor :part
24
-
25
- attr_accessor :states
26
-
27
- attr_accessor :thread_id
28
-
29
- class EnumAttributeValidator
30
- attr_reader :datatype
31
- attr_reader :allowable_values
32
-
33
- def initialize(datatype, allowable_values)
34
- @allowable_values = allowable_values.map do |value|
35
- case datatype.to_s
36
- when /Integer/i
37
- value.to_i
38
- when /Float/i
39
- value.to_f
40
- else
41
- value
42
- end
43
- end
44
- end
45
-
46
- def valid?(value)
47
- !value || allowable_values.include?(value)
48
- end
49
- end
50
-
51
- # Attribute mapping from ruby-style variable name to JSON key.
52
- def self.attribute_map
53
- {
54
- :'body' => :'body',
55
- :'id' => :'id',
56
- :'part' => :'part',
57
- :'states' => :'states',
58
- :'thread_id' => :'thread_id'
59
- }
60
- end
61
-
62
- # Returns attribute mapping this model knows about
63
- def self.acceptable_attribute_map
64
- attribute_map
65
- end
66
-
67
- # Returns all the JSON keys this model knows about
68
- def self.acceptable_attributes
69
- acceptable_attribute_map.values
70
- end
71
-
72
- # Attribute type mapping.
73
- def self.openapi_types
74
- {
75
- :'body' => :'MailboxRawBodyBody',
76
- :'id' => :'String',
77
- :'part' => :'String',
78
- :'states' => :'MailboxBatchGetResultStates',
79
- :'thread_id' => :'String'
80
- }
81
- end
82
-
83
- # List of attributes with nullable: true
84
- def self.openapi_nullable
85
- Set.new([
86
- :'thread_id'
87
- ])
88
- end
89
-
90
- # List of class defined in allOf (OpenAPI v3)
91
- def self.openapi_all_of
92
- [
93
- :'MailboxRawBody'
94
- ]
95
- end
96
-
97
- # Initializes the object
98
- # @param [Hash] attributes Model attributes in the form of hash
99
- def initialize(attributes = {})
100
- if (!attributes.is_a?(Hash))
101
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxRawBodyResponseAllOfData` initialize method"
102
- end
103
-
104
- # check to see if the attribute exists and convert string to symbol for hash key
105
- acceptable_attribute_map = self.class.acceptable_attribute_map
106
- attributes = attributes.each_with_object({}) { |(k, v), h|
107
- if (!acceptable_attribute_map.key?(k.to_sym))
108
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxRawBodyResponseAllOfData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
109
- end
110
- h[k.to_sym] = v
111
- }
112
-
113
- if attributes.key?(:'body')
114
- self.body = attributes[:'body']
115
- else
116
- self.body = nil
117
- end
118
-
119
- if attributes.key?(:'id')
120
- self.id = attributes[:'id']
121
- else
122
- self.id = nil
123
- end
124
-
125
- if attributes.key?(:'part')
126
- self.part = attributes[:'part']
127
- else
128
- self.part = nil
129
- end
130
-
131
- if attributes.key?(:'states')
132
- self.states = attributes[:'states']
133
- else
134
- self.states = nil
135
- end
136
-
137
- if attributes.key?(:'thread_id')
138
- self.thread_id = attributes[:'thread_id']
139
- else
140
- self.thread_id = nil
141
- end
142
- end
143
-
144
- # Show invalid properties with the reasons. Usually used together with valid?
145
- # @return Array for valid properties with the reasons
146
- def list_invalid_properties
147
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
148
- invalid_properties = Array.new
149
- if @body.nil?
150
- invalid_properties.push('invalid value for "body", body cannot be nil.')
151
- end
152
-
153
- if @id.nil?
154
- invalid_properties.push('invalid value for "id", id cannot be nil.')
155
- end
156
-
157
- if @part.nil?
158
- invalid_properties.push('invalid value for "part", part cannot be nil.')
159
- end
160
-
161
- if @states.nil?
162
- invalid_properties.push('invalid value for "states", states cannot be nil.')
163
- end
164
-
165
- invalid_properties
166
- end
167
-
168
- # Check to see if the all the properties in the model are valid
169
- # @return true if the model is valid
170
- def valid?
171
- warn '[DEPRECATED] the `valid?` method is obsolete'
172
- return false if @body.nil?
173
- return false if @id.nil?
174
- return false if @part.nil?
175
- part_validator = EnumAttributeValidator.new('String', ["text", "html", "both", "unknown_default_open_api"])
176
- return false unless part_validator.valid?(@part)
177
- return false if @states.nil?
178
- true
179
- end
180
-
181
- # Custom attribute writer method with validation
182
- # @param [Object] body Value to be assigned
183
- def body=(body)
184
- if body.nil?
185
- fail ArgumentError, 'body cannot be nil'
186
- end
187
-
188
- @body = body
189
- end
190
-
191
- # Custom attribute writer method with validation
192
- # @param [Object] id Value to be assigned
193
- def id=(id)
194
- if id.nil?
195
- fail ArgumentError, 'id cannot be nil'
196
- end
197
-
198
- @id = id
199
- end
200
-
201
- # Custom attribute writer method checking allowed values (enum).
202
- # @param [Object] part Object to be assigned
203
- def part=(part)
204
- validator = EnumAttributeValidator.new('String', ["text", "html", "both", "unknown_default_open_api"])
205
- unless validator.valid?(part)
206
- fail ArgumentError, "invalid value for \"part\", must be one of #{validator.allowable_values}."
207
- end
208
- @part = part
209
- end
210
-
211
- # Custom attribute writer method with validation
212
- # @param [Object] states Value to be assigned
213
- def states=(states)
214
- if states.nil?
215
- fail ArgumentError, 'states cannot be nil'
216
- end
217
-
218
- @states = states
219
- end
220
-
221
- # Checks equality by comparing each attribute.
222
- # @param [Object] Object to be compared
223
- def ==(o)
224
- return true if self.equal?(o)
225
- self.class == o.class &&
226
- body == o.body &&
227
- id == o.id &&
228
- part == o.part &&
229
- states == o.states &&
230
- thread_id == o.thread_id
231
- end
232
-
233
- # @see the `==` method
234
- # @param [Object] Object to be compared
235
- def eql?(o)
236
- self == o
237
- end
238
-
239
- # Calculates hash code according to all attributes.
240
- # @return [Integer] Hash code
241
- def hash
242
- [body, id, part, states, thread_id].hash
243
- end
244
-
245
- # Builds the object from hash
246
- # @param [Hash] attributes Model attributes in the form of hash
247
- # @return [Object] Returns the model itself
248
- def self.build_from_hash(attributes)
249
- return nil unless attributes.is_a?(Hash)
250
- attributes = attributes.transform_keys(&:to_sym)
251
- transformed_hash = {}
252
- openapi_types.each_pair do |key, type|
253
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
254
- transformed_hash["#{key}"] = nil
255
- elsif type =~ /\AArray<(.*)>/i
256
- # check to ensure the input is an array given that the attribute
257
- # is documented as an array but the input is not
258
- if attributes[attribute_map[key]].is_a?(Array)
259
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
260
- end
261
- elsif !attributes[attribute_map[key]].nil?
262
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
263
- end
264
- end
265
- new(transformed_hash)
266
- end
267
-
268
- # Returns the object in the form of hash
269
- # @return [Hash] Returns the object in the form of hash
270
- def to_hash
271
- hash = {}
272
- self.class.attribute_map.each_pair do |attr, param|
273
- value = self.send(attr)
274
- if value.nil?
275
- is_nullable = self.class.openapi_nullable.include?(attr)
276
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
277
- end
278
-
279
- hash[param] = _to_hash(value)
280
- end
281
- hash
282
- end
283
-
284
- end
285
-
286
- end
@@ -1,185 +0,0 @@
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 MailboxSubmissionEnvelopeRcptToInner < ApiModelBase
18
- attr_accessor :email
19
-
20
- attr_accessor :parameters
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'email' => :'email',
26
- :'parameters' => :'parameters'
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
- :'parameters' => :'Hash<String, String>'
45
- }
46
- end
47
-
48
- # List of attributes with nullable: true
49
- def self.openapi_nullable
50
- Set.new([
51
- :'parameters'
52
- ])
53
- end
54
-
55
- # List of class defined in allOf (OpenAPI v3)
56
- def self.openapi_all_of
57
- [
58
- :'MailboxSubmissionEnvelopeAddress'
59
- ]
60
- end
61
-
62
- # Initializes the object
63
- # @param [Hash] attributes Model attributes in the form of hash
64
- def initialize(attributes = {})
65
- if (!attributes.is_a?(Hash))
66
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxSubmissionEnvelopeRcptToInner` initialize method"
67
- end
68
-
69
- # check to see if the attribute exists and convert string to symbol for hash key
70
- acceptable_attribute_map = self.class.acceptable_attribute_map
71
- attributes = attributes.each_with_object({}) { |(k, v), h|
72
- if (!acceptable_attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxSubmissionEnvelopeRcptToInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
- end
75
- h[k.to_sym] = v
76
- }
77
-
78
- if attributes.key?(:'email')
79
- self.email = attributes[:'email']
80
- else
81
- self.email = nil
82
- end
83
-
84
- if attributes.key?(:'parameters')
85
- if (value = attributes[:'parameters']).is_a?(Hash)
86
- self.parameters = value
87
- end
88
- else
89
- self.parameters = nil
90
- end
91
- end
92
-
93
- # Show invalid properties with the reasons. Usually used together with valid?
94
- # @return Array for valid properties with the reasons
95
- def list_invalid_properties
96
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
- invalid_properties = Array.new
98
- if @email.nil?
99
- invalid_properties.push('invalid value for "email", email cannot be nil.')
100
- end
101
-
102
- invalid_properties
103
- end
104
-
105
- # Check to see if the all the properties in the model are valid
106
- # @return true if the model is valid
107
- def valid?
108
- warn '[DEPRECATED] the `valid?` method is obsolete'
109
- return false if @email.nil?
110
- true
111
- end
112
-
113
- # Custom attribute writer method with validation
114
- # @param [Object] email Value to be assigned
115
- def email=(email)
116
- if email.nil?
117
- fail ArgumentError, 'email cannot be nil'
118
- end
119
-
120
- @email = email
121
- end
122
-
123
- # Checks equality by comparing each attribute.
124
- # @param [Object] Object to be compared
125
- def ==(o)
126
- return true if self.equal?(o)
127
- self.class == o.class &&
128
- email == o.email &&
129
- parameters == o.parameters
130
- end
131
-
132
- # @see the `==` method
133
- # @param [Object] Object to be compared
134
- def eql?(o)
135
- self == o
136
- end
137
-
138
- # Calculates hash code according to all attributes.
139
- # @return [Integer] Hash code
140
- def hash
141
- [email, parameters].hash
142
- end
143
-
144
- # Builds the object from hash
145
- # @param [Hash] attributes Model attributes in the form of hash
146
- # @return [Object] Returns the model itself
147
- def self.build_from_hash(attributes)
148
- return nil unless attributes.is_a?(Hash)
149
- attributes = attributes.transform_keys(&:to_sym)
150
- transformed_hash = {}
151
- openapi_types.each_pair do |key, type|
152
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
153
- transformed_hash["#{key}"] = nil
154
- elsif type =~ /\AArray<(.*)>/i
155
- # check to ensure the input is an array given that the attribute
156
- # is documented as an array but the input is not
157
- if attributes[attribute_map[key]].is_a?(Array)
158
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
159
- end
160
- elsif !attributes[attribute_map[key]].nil?
161
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
162
- end
163
- end
164
- new(transformed_hash)
165
- end
166
-
167
- # Returns the object in the form of hash
168
- # @return [Hash] Returns the object in the form of hash
169
- def to_hash
170
- hash = {}
171
- self.class.attribute_map.each_pair do |attr, param|
172
- value = self.send(attr)
173
- if value.nil?
174
- is_nullable = self.class.openapi_nullable.include?(attr)
175
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
176
- end
177
-
178
- hash[param] = _to_hash(value)
179
- end
180
- hash
181
- end
182
-
183
- end
184
-
185
- end