sendmux-sending 1.4.0 → 2.0.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. metadata +11 -120
  3. data/CHANGELOG.md +0 -41
  4. data/LICENSE +0 -21
  5. data/README.md +0 -112
  6. data/lib/sendmux/sending/client.rb +0 -49
  7. data/lib/sendmux/sending/version.rb +0 -7
  8. data/lib/sendmux/sending.rb +0 -12
  9. data/lib/sendmux_sending_generated/api/attachments_api.rb +0 -370
  10. data/lib/sendmux_sending_generated/api/emails_api.rb +0 -172
  11. data/lib/sendmux_sending_generated/api/meta_api.rb +0 -142
  12. data/lib/sendmux_sending_generated/api_client.rb +0 -447
  13. data/lib/sendmux_sending_generated/api_error.rb +0 -58
  14. data/lib/sendmux_sending_generated/api_model_base.rb +0 -88
  15. data/lib/sendmux_sending_generated/configuration.rb +0 -399
  16. data/lib/sendmux_sending_generated/models/address.rb +0 -215
  17. data/lib/sendmux_sending_generated/models/attachment.rb +0 -103
  18. data/lib/sendmux_sending_generated/models/attachment_upload_data.rb +0 -284
  19. data/lib/sendmux_sending_generated/models/attachment_upload_intent_data.rb +0 -337
  20. data/lib/sendmux_sending_generated/models/attachment_upload_intent_request.rb +0 -279
  21. data/lib/sendmux_sending_generated/models/attachment_upload_intent_response.rb +0 -223
  22. data/lib/sendmux_sending_generated/models/attachment_upload_response.rb +0 -223
  23. data/lib/sendmux_sending_generated/models/batch_result_item.rb +0 -256
  24. data/lib/sendmux_sending_generated/models/batch_send_request.rb +0 -185
  25. data/lib/sendmux_sending_generated/models/batch_send_success_data.rb +0 -192
  26. data/lib/sendmux_sending_generated/models/batch_send_success_response.rb +0 -223
  27. data/lib/sendmux_sending_generated/models/batch_summary.rb +0 -219
  28. data/lib/sendmux_sending_generated/models/connection.rb +0 -273
  29. data/lib/sendmux_sending_generated/models/connection_credential.rb +0 -226
  30. data/lib/sendmux_sending_generated/models/connection_mailboxes_inner.rb +0 -190
  31. data/lib/sendmux_sending_generated/models/connection_response.rb +0 -223
  32. data/lib/sendmux_sending_generated/models/connection_team.rb +0 -190
  33. data/lib/sendmux_sending_generated/models/email_send_request.rb +0 -465
  34. data/lib/sendmux_sending_generated/models/error_detail.rb +0 -251
  35. data/lib/sendmux_sending_generated/models/error_issue.rb +0 -219
  36. data/lib/sendmux_sending_generated/models/error_response.rb +0 -216
  37. data/lib/sendmux_sending_generated/models/inline_attachment.rb +0 -274
  38. data/lib/sendmux_sending_generated/models/meta.rb +0 -165
  39. data/lib/sendmux_sending_generated/models/recipient.rb +0 -214
  40. data/lib/sendmux_sending_generated/models/send_success_data.rb +0 -227
  41. data/lib/sendmux_sending_generated/models/send_success_response.rb +0 -223
  42. data/lib/sendmux_sending_generated/models/success_envelope.rb +0 -190
  43. data/lib/sendmux_sending_generated/models/uploaded_attachment_ref.rb +0 -176
  44. data/lib/sendmux_sending_generated/version.rb +0 -15
  45. data/lib/sendmux_sending_generated.rb +0 -71
@@ -1,219 +0,0 @@
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 ErrorIssue < ApiModelBase
18
- # Issue code from the validator
19
- attr_accessor :code
20
-
21
- # Dot-path to the failing field
22
- attr_accessor :field
23
-
24
- # Human-readable issue message
25
- attr_accessor :message
26
-
27
- # Attribute mapping from ruby-style variable name to JSON key.
28
- def self.attribute_map
29
- {
30
- :'code' => :'code',
31
- :'field' => :'field',
32
- :'message' => :'message'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'code' => :'String',
50
- :'field' => :'String',
51
- :'message' => :'String'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
58
- ])
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Sending::Generated::ErrorIssue` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- acceptable_attribute_map = self.class.acceptable_attribute_map
70
- attributes = attributes.each_with_object({}) { |(k, v), h|
71
- if (!acceptable_attribute_map.key?(k.to_sym))
72
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Sending::Generated::ErrorIssue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
- end
74
- h[k.to_sym] = v
75
- }
76
-
77
- if attributes.key?(:'code')
78
- self.code = attributes[:'code']
79
- else
80
- self.code = nil
81
- end
82
-
83
- if attributes.key?(:'field')
84
- self.field = attributes[:'field']
85
- else
86
- self.field = nil
87
- end
88
-
89
- if attributes.key?(:'message')
90
- self.message = attributes[:'message']
91
- else
92
- self.message = nil
93
- end
94
- end
95
-
96
- # Show invalid properties with the reasons. Usually used together with valid?
97
- # @return Array for valid properties with the reasons
98
- def list_invalid_properties
99
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
- invalid_properties = Array.new
101
- if @code.nil?
102
- invalid_properties.push('invalid value for "code", code cannot be nil.')
103
- end
104
-
105
- if @field.nil?
106
- invalid_properties.push('invalid value for "field", field cannot be nil.')
107
- end
108
-
109
- if @message.nil?
110
- invalid_properties.push('invalid value for "message", message cannot be nil.')
111
- end
112
-
113
- invalid_properties
114
- end
115
-
116
- # Check to see if the all the properties in the model are valid
117
- # @return true if the model is valid
118
- def valid?
119
- warn '[DEPRECATED] the `valid?` method is obsolete'
120
- return false if @code.nil?
121
- return false if @field.nil?
122
- return false if @message.nil?
123
- true
124
- end
125
-
126
- # Custom attribute writer method with validation
127
- # @param [Object] code Value to be assigned
128
- def code=(code)
129
- if code.nil?
130
- fail ArgumentError, 'code cannot be nil'
131
- end
132
-
133
- @code = code
134
- end
135
-
136
- # Custom attribute writer method with validation
137
- # @param [Object] field Value to be assigned
138
- def field=(field)
139
- if field.nil?
140
- fail ArgumentError, 'field cannot be nil'
141
- end
142
-
143
- @field = field
144
- end
145
-
146
- # Custom attribute writer method with validation
147
- # @param [Object] message Value to be assigned
148
- def message=(message)
149
- if message.nil?
150
- fail ArgumentError, 'message cannot be nil'
151
- end
152
-
153
- @message = message
154
- end
155
-
156
- # Checks equality by comparing each attribute.
157
- # @param [Object] Object to be compared
158
- def ==(o)
159
- return true if self.equal?(o)
160
- self.class == o.class &&
161
- code == o.code &&
162
- field == o.field &&
163
- message == o.message
164
- end
165
-
166
- # @see the `==` method
167
- # @param [Object] Object to be compared
168
- def eql?(o)
169
- self == o
170
- end
171
-
172
- # Calculates hash code according to all attributes.
173
- # @return [Integer] Hash code
174
- def hash
175
- [code, field, message].hash
176
- end
177
-
178
- # Builds the object from hash
179
- # @param [Hash] attributes Model attributes in the form of hash
180
- # @return [Object] Returns the model itself
181
- def self.build_from_hash(attributes)
182
- return nil unless attributes.is_a?(Hash)
183
- attributes = attributes.transform_keys(&:to_sym)
184
- transformed_hash = {}
185
- openapi_types.each_pair do |key, type|
186
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
- transformed_hash["#{key}"] = nil
188
- elsif type =~ /\AArray<(.*)>/i
189
- # check to ensure the input is an array given that the attribute
190
- # is documented as an array but the input is not
191
- if attributes[attribute_map[key]].is_a?(Array)
192
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
- end
194
- elsif !attributes[attribute_map[key]].nil?
195
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
- end
197
- end
198
- new(transformed_hash)
199
- end
200
-
201
- # Returns the object in the form of hash
202
- # @return [Hash] Returns the object in the form of hash
203
- def to_hash
204
- hash = {}
205
- self.class.attribute_map.each_pair do |attr, param|
206
- value = self.send(attr)
207
- if value.nil?
208
- is_nullable = self.class.openapi_nullable.include?(attr)
209
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
- end
211
-
212
- hash[param] = _to_hash(value)
213
- end
214
- hash
215
- end
216
-
217
- end
218
-
219
- end
@@ -1,216 +0,0 @@
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 ErrorResponse < ApiModelBase
18
- attr_accessor :error
19
-
20
- attr_accessor :meta
21
-
22
- attr_accessor :ok
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'error' => :'error',
28
- :'meta' => :'meta',
29
- :'ok' => :'ok'
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
- :'error' => :'ErrorDetail',
47
- :'meta' => :'Meta',
48
- :'ok' => :'Boolean'
49
- }
50
- end
51
-
52
- # List of attributes with nullable: true
53
- def self.openapi_nullable
54
- Set.new([
55
- ])
56
- end
57
-
58
- # Initializes the object
59
- # @param [Hash] attributes Model attributes in the form of hash
60
- def initialize(attributes = {})
61
- if (!attributes.is_a?(Hash))
62
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Sending::Generated::ErrorResponse` initialize method"
63
- end
64
-
65
- # check to see if the attribute exists and convert string to symbol for hash key
66
- acceptable_attribute_map = self.class.acceptable_attribute_map
67
- attributes = attributes.each_with_object({}) { |(k, v), h|
68
- if (!acceptable_attribute_map.key?(k.to_sym))
69
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Sending::Generated::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
- end
71
- h[k.to_sym] = v
72
- }
73
-
74
- if attributes.key?(:'error')
75
- self.error = attributes[:'error']
76
- else
77
- self.error = nil
78
- end
79
-
80
- if attributes.key?(:'meta')
81
- self.meta = attributes[:'meta']
82
- else
83
- self.meta = nil
84
- end
85
-
86
- if attributes.key?(:'ok')
87
- self.ok = attributes[:'ok']
88
- else
89
- self.ok = 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 @error.nil?
99
- invalid_properties.push('invalid value for "error", error cannot be nil.')
100
- end
101
-
102
- if @meta.nil?
103
- invalid_properties.push('invalid value for "meta", meta cannot be nil.')
104
- end
105
-
106
- if @ok.nil?
107
- invalid_properties.push('invalid value for "ok", ok cannot be nil.')
108
- end
109
-
110
- invalid_properties
111
- end
112
-
113
- # Check to see if the all the properties in the model are valid
114
- # @return true if the model is valid
115
- def valid?
116
- warn '[DEPRECATED] the `valid?` method is obsolete'
117
- return false if @error.nil?
118
- return false if @meta.nil?
119
- return false if @ok.nil?
120
- true
121
- end
122
-
123
- # Custom attribute writer method with validation
124
- # @param [Object] error Value to be assigned
125
- def error=(error)
126
- if error.nil?
127
- fail ArgumentError, 'error cannot be nil'
128
- end
129
-
130
- @error = error
131
- end
132
-
133
- # Custom attribute writer method with validation
134
- # @param [Object] meta Value to be assigned
135
- def meta=(meta)
136
- if meta.nil?
137
- fail ArgumentError, 'meta cannot be nil'
138
- end
139
-
140
- @meta = meta
141
- end
142
-
143
- # Custom attribute writer method with validation
144
- # @param [Object] ok Value to be assigned
145
- def ok=(ok)
146
- if ok.nil?
147
- fail ArgumentError, 'ok cannot be nil'
148
- end
149
-
150
- @ok = ok
151
- end
152
-
153
- # Checks equality by comparing each attribute.
154
- # @param [Object] Object to be compared
155
- def ==(o)
156
- return true if self.equal?(o)
157
- self.class == o.class &&
158
- error == o.error &&
159
- meta == o.meta &&
160
- ok == o.ok
161
- end
162
-
163
- # @see the `==` method
164
- # @param [Object] Object to be compared
165
- def eql?(o)
166
- self == o
167
- end
168
-
169
- # Calculates hash code according to all attributes.
170
- # @return [Integer] Hash code
171
- def hash
172
- [error, meta, ok].hash
173
- end
174
-
175
- # Builds the object from hash
176
- # @param [Hash] attributes Model attributes in the form of hash
177
- # @return [Object] Returns the model itself
178
- def self.build_from_hash(attributes)
179
- return nil unless attributes.is_a?(Hash)
180
- attributes = attributes.transform_keys(&:to_sym)
181
- transformed_hash = {}
182
- openapi_types.each_pair do |key, type|
183
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
- transformed_hash["#{key}"] = nil
185
- elsif type =~ /\AArray<(.*)>/i
186
- # check to ensure the input is an array given that the attribute
187
- # is documented as an array but the input is not
188
- if attributes[attribute_map[key]].is_a?(Array)
189
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
- end
191
- elsif !attributes[attribute_map[key]].nil?
192
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
- end
194
- end
195
- new(transformed_hash)
196
- end
197
-
198
- # Returns the object in the form of hash
199
- # @return [Hash] Returns the object in the form of hash
200
- def to_hash
201
- hash = {}
202
- self.class.attribute_map.each_pair do |attr, param|
203
- value = self.send(attr)
204
- if value.nil?
205
- is_nullable = self.class.openapi_nullable.include?(attr)
206
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
- end
208
-
209
- hash[param] = _to_hash(value)
210
- end
211
- hash
212
- end
213
-
214
- end
215
-
216
- end
@@ -1,274 +0,0 @@
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 InlineAttachment < ApiModelBase
18
- # Base64-encoded file content
19
- attr_accessor :content
20
-
21
- attr_accessor :encoding
22
-
23
- # Filename with allowed extension
24
- attr_accessor :filename
25
-
26
- # MIME type override
27
- attr_accessor :type
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
- :'content' => :'content',
55
- :'encoding' => :'encoding',
56
- :'filename' => :'filename',
57
- :'type' => :'type'
58
- }
59
- end
60
-
61
- # Returns attribute mapping this model knows about
62
- def self.acceptable_attribute_map
63
- attribute_map
64
- end
65
-
66
- # Returns all the JSON keys this model knows about
67
- def self.acceptable_attributes
68
- acceptable_attribute_map.values
69
- end
70
-
71
- # Attribute type mapping.
72
- def self.openapi_types
73
- {
74
- :'content' => :'String',
75
- :'encoding' => :'String',
76
- :'filename' => :'String',
77
- :'type' => :'String'
78
- }
79
- end
80
-
81
- # List of attributes with nullable: true
82
- def self.openapi_nullable
83
- Set.new([
84
- ])
85
- end
86
-
87
- # Initializes the object
88
- # @param [Hash] attributes Model attributes in the form of hash
89
- def initialize(attributes = {})
90
- if (!attributes.is_a?(Hash))
91
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Sending::Generated::InlineAttachment` initialize method"
92
- end
93
-
94
- # check to see if the attribute exists and convert string to symbol for hash key
95
- acceptable_attribute_map = self.class.acceptable_attribute_map
96
- attributes = attributes.each_with_object({}) { |(k, v), h|
97
- if (!acceptable_attribute_map.key?(k.to_sym))
98
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Sending::Generated::InlineAttachment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
99
- end
100
- h[k.to_sym] = v
101
- }
102
-
103
- if attributes.key?(:'content')
104
- self.content = attributes[:'content']
105
- else
106
- self.content = nil
107
- end
108
-
109
- if attributes.key?(:'encoding')
110
- self.encoding = attributes[:'encoding']
111
- else
112
- self.encoding = 'base64'
113
- end
114
-
115
- if attributes.key?(:'filename')
116
- self.filename = attributes[:'filename']
117
- else
118
- self.filename = nil
119
- end
120
-
121
- if attributes.key?(:'type')
122
- self.type = attributes[:'type']
123
- end
124
- end
125
-
126
- # Show invalid properties with the reasons. Usually used together with valid?
127
- # @return Array for valid properties with the reasons
128
- def list_invalid_properties
129
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
- invalid_properties = Array.new
131
- if @content.nil?
132
- invalid_properties.push('invalid value for "content", content cannot be nil.')
133
- end
134
-
135
- if @content.to_s.length < 1
136
- invalid_properties.push('invalid value for "content", the character length must be greater than or equal to 1.')
137
- end
138
-
139
- if @filename.nil?
140
- invalid_properties.push('invalid value for "filename", filename cannot be nil.')
141
- end
142
-
143
- if @filename.to_s.length > 255
144
- invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 255.')
145
- end
146
-
147
- if @filename.to_s.length < 1
148
- invalid_properties.push('invalid value for "filename", the character length must be greater than or equal to 1.')
149
- end
150
-
151
- invalid_properties
152
- end
153
-
154
- # Check to see if the all the properties in the model are valid
155
- # @return true if the model is valid
156
- def valid?
157
- warn '[DEPRECATED] the `valid?` method is obsolete'
158
- return false if @content.nil?
159
- return false if @content.to_s.length < 1
160
- encoding_validator = EnumAttributeValidator.new('String', ["base64", "unknown_default_open_api"])
161
- return false unless encoding_validator.valid?(@encoding)
162
- return false if @filename.nil?
163
- return false if @filename.to_s.length > 255
164
- return false if @filename.to_s.length < 1
165
- true
166
- end
167
-
168
- # Custom attribute writer method with validation
169
- # @param [Object] content Value to be assigned
170
- def content=(content)
171
- if content.nil?
172
- fail ArgumentError, 'content cannot be nil'
173
- end
174
-
175
- if content.to_s.length < 1
176
- fail ArgumentError, 'invalid value for "content", the character length must be greater than or equal to 1.'
177
- end
178
-
179
- @content = content
180
- end
181
-
182
- # Custom attribute writer method checking allowed values (enum).
183
- # @param [Object] encoding Object to be assigned
184
- def encoding=(encoding)
185
- validator = EnumAttributeValidator.new('String', ["base64", "unknown_default_open_api"])
186
- unless validator.valid?(encoding)
187
- fail ArgumentError, "invalid value for \"encoding\", must be one of #{validator.allowable_values}."
188
- end
189
- @encoding = encoding
190
- end
191
-
192
- # Custom attribute writer method with validation
193
- # @param [Object] filename Value to be assigned
194
- def filename=(filename)
195
- if filename.nil?
196
- fail ArgumentError, 'filename cannot be nil'
197
- end
198
-
199
- if filename.to_s.length > 255
200
- fail ArgumentError, 'invalid value for "filename", the character length must be smaller than or equal to 255.'
201
- end
202
-
203
- if filename.to_s.length < 1
204
- fail ArgumentError, 'invalid value for "filename", the character length must be greater than or equal to 1.'
205
- end
206
-
207
- @filename = filename
208
- end
209
-
210
- # Checks equality by comparing each attribute.
211
- # @param [Object] Object to be compared
212
- def ==(o)
213
- return true if self.equal?(o)
214
- self.class == o.class &&
215
- content == o.content &&
216
- encoding == o.encoding &&
217
- filename == o.filename &&
218
- type == o.type
219
- end
220
-
221
- # @see the `==` method
222
- # @param [Object] Object to be compared
223
- def eql?(o)
224
- self == o
225
- end
226
-
227
- # Calculates hash code according to all attributes.
228
- # @return [Integer] Hash code
229
- def hash
230
- [content, encoding, filename, type].hash
231
- end
232
-
233
- # Builds the object from hash
234
- # @param [Hash] attributes Model attributes in the form of hash
235
- # @return [Object] Returns the model itself
236
- def self.build_from_hash(attributes)
237
- return nil unless attributes.is_a?(Hash)
238
- attributes = attributes.transform_keys(&:to_sym)
239
- transformed_hash = {}
240
- openapi_types.each_pair do |key, type|
241
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
242
- transformed_hash["#{key}"] = nil
243
- elsif type =~ /\AArray<(.*)>/i
244
- # check to ensure the input is an array given that the attribute
245
- # is documented as an array but the input is not
246
- if attributes[attribute_map[key]].is_a?(Array)
247
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
248
- end
249
- elsif !attributes[attribute_map[key]].nil?
250
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
251
- end
252
- end
253
- new(transformed_hash)
254
- end
255
-
256
- # Returns the object in the form of hash
257
- # @return [Hash] Returns the object in the form of hash
258
- def to_hash
259
- hash = {}
260
- self.class.attribute_map.each_pair do |attr, param|
261
- value = self.send(attr)
262
- if value.nil?
263
- is_nullable = self.class.openapi_nullable.include?(attr)
264
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
- end
266
-
267
- hash[param] = _to_hash(value)
268
- end
269
- hash
270
- end
271
-
272
- end
273
-
274
- end