mailslurp_client 15.17.6 → 15.17.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/mailslurp_client/api/connector_controller_api.rb +619 -0
- data/lib/mailslurp_client/models/bounce_projection.rb +15 -15
- data/lib/mailslurp_client/models/connector_dto.rb +407 -0
- data/lib/mailslurp_client/models/connector_projection.rb +346 -0
- data/lib/mailslurp_client/models/connector_sync_event_dto.rb +310 -0
- data/lib/mailslurp_client/models/connector_sync_event_projection.rb +306 -0
- data/lib/mailslurp_client/models/connector_sync_request_result.rb +224 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception.rb +246 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause.rb +237 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause_stack_trace.rb +269 -0
- data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause_suppressed.rb +226 -0
- data/lib/mailslurp_client/models/connector_sync_result.rb +222 -0
- data/lib/mailslurp_client/models/create_connector_imap_options.rb +267 -0
- data/lib/mailslurp_client/models/create_connector_options.rb +338 -0
- data/lib/mailslurp_client/models/email_projection.rb +10 -10
- data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +13 -13
- data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +1 -0
- data/lib/mailslurp_client/models/missed_email_projection.rb +11 -11
- data/lib/mailslurp_client/models/page_connector.rb +308 -0
- data/lib/mailslurp_client/models/page_connector_sync_events.rb +308 -0
- data/lib/mailslurp_client/models/thread_projection.rb +11 -11
- data/lib/mailslurp_client/version.rb +1 -1
- data/lib/mailslurp_client.rb +15 -0
- metadata +17 -2
@@ -0,0 +1,306 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
Contact: contact@mailslurp.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
# ConnectorSyncEventProjection
|
17
|
+
class ConnectorSyncEventProjection
|
18
|
+
attr_accessor :message
|
19
|
+
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
attr_accessor :created_at
|
23
|
+
|
24
|
+
attr_accessor :connector_id
|
25
|
+
|
26
|
+
attr_accessor :sync_count
|
27
|
+
|
28
|
+
attr_accessor :sync_status
|
29
|
+
|
30
|
+
class EnumAttributeValidator
|
31
|
+
attr_reader :datatype
|
32
|
+
attr_reader :allowable_values
|
33
|
+
|
34
|
+
def initialize(datatype, allowable_values)
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
36
|
+
case datatype.to_s
|
37
|
+
when /Integer/i
|
38
|
+
value.to_i
|
39
|
+
when /Float/i
|
40
|
+
value.to_f
|
41
|
+
else
|
42
|
+
value
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def valid?(value)
|
48
|
+
!value || allowable_values.include?(value)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
def self.attribute_map
|
54
|
+
{
|
55
|
+
:'message' => :'message',
|
56
|
+
:'id' => :'id',
|
57
|
+
:'created_at' => :'createdAt',
|
58
|
+
:'connector_id' => :'connectorId',
|
59
|
+
:'sync_count' => :'syncCount',
|
60
|
+
:'sync_status' => :'syncStatus'
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute type mapping.
|
65
|
+
def self.openapi_types
|
66
|
+
{
|
67
|
+
:'message' => :'String',
|
68
|
+
:'id' => :'String',
|
69
|
+
:'created_at' => :'DateTime',
|
70
|
+
:'connector_id' => :'String',
|
71
|
+
:'sync_count' => :'Integer',
|
72
|
+
:'sync_status' => :'String'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# List of attributes with nullable: true
|
77
|
+
def self.openapi_nullable
|
78
|
+
Set.new([
|
79
|
+
])
|
80
|
+
end
|
81
|
+
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
def initialize(attributes = {})
|
85
|
+
if (!attributes.is_a?(Hash))
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ConnectorSyncEventProjection` initialize method"
|
87
|
+
end
|
88
|
+
|
89
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ConnectorSyncEventProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
|
+
end
|
94
|
+
h[k.to_sym] = v
|
95
|
+
}
|
96
|
+
|
97
|
+
if attributes.key?(:'message')
|
98
|
+
self.message = attributes[:'message']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'id')
|
102
|
+
self.id = attributes[:'id']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'created_at')
|
106
|
+
self.created_at = attributes[:'created_at']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'connector_id')
|
110
|
+
self.connector_id = attributes[:'connector_id']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'sync_count')
|
114
|
+
self.sync_count = attributes[:'sync_count']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'sync_status')
|
118
|
+
self.sync_status = attributes[:'sync_status']
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
123
|
+
# @return Array for valid properties with the reasons
|
124
|
+
def list_invalid_properties
|
125
|
+
invalid_properties = Array.new
|
126
|
+
if @created_at.nil?
|
127
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
128
|
+
end
|
129
|
+
|
130
|
+
if @connector_id.nil?
|
131
|
+
invalid_properties.push('invalid value for "connector_id", connector_id cannot be nil.')
|
132
|
+
end
|
133
|
+
|
134
|
+
if @sync_count.nil?
|
135
|
+
invalid_properties.push('invalid value for "sync_count", sync_count cannot be nil.')
|
136
|
+
end
|
137
|
+
|
138
|
+
if @sync_status.nil?
|
139
|
+
invalid_properties.push('invalid value for "sync_status", sync_status cannot be nil.')
|
140
|
+
end
|
141
|
+
|
142
|
+
invalid_properties
|
143
|
+
end
|
144
|
+
|
145
|
+
# Check to see if the all the properties in the model are valid
|
146
|
+
# @return true if the model is valid
|
147
|
+
def valid?
|
148
|
+
return false if @created_at.nil?
|
149
|
+
return false if @connector_id.nil?
|
150
|
+
return false if @sync_count.nil?
|
151
|
+
return false if @sync_status.nil?
|
152
|
+
sync_status_validator = EnumAttributeValidator.new('String', ["SUCCESS", "INTERNAL_ERROR", "SUBSCRIPTION_ERROR", "CONNECTION_ERROR", "NOT_FOUND"])
|
153
|
+
return false unless sync_status_validator.valid?(@sync_status)
|
154
|
+
true
|
155
|
+
end
|
156
|
+
|
157
|
+
# Custom attribute writer method checking allowed values (enum).
|
158
|
+
# @param [Object] sync_status Object to be assigned
|
159
|
+
def sync_status=(sync_status)
|
160
|
+
validator = EnumAttributeValidator.new('String', ["SUCCESS", "INTERNAL_ERROR", "SUBSCRIPTION_ERROR", "CONNECTION_ERROR", "NOT_FOUND"])
|
161
|
+
unless validator.valid?(sync_status)
|
162
|
+
fail ArgumentError, "invalid value for \"sync_status\", must be one of #{validator.allowable_values}."
|
163
|
+
end
|
164
|
+
@sync_status = sync_status
|
165
|
+
end
|
166
|
+
|
167
|
+
# Checks equality by comparing each attribute.
|
168
|
+
# @param [Object] Object to be compared
|
169
|
+
def ==(o)
|
170
|
+
return true if self.equal?(o)
|
171
|
+
self.class == o.class &&
|
172
|
+
message == o.message &&
|
173
|
+
id == o.id &&
|
174
|
+
created_at == o.created_at &&
|
175
|
+
connector_id == o.connector_id &&
|
176
|
+
sync_count == o.sync_count &&
|
177
|
+
sync_status == o.sync_status
|
178
|
+
end
|
179
|
+
|
180
|
+
# @see the `==` method
|
181
|
+
# @param [Object] Object to be compared
|
182
|
+
def eql?(o)
|
183
|
+
self == o
|
184
|
+
end
|
185
|
+
|
186
|
+
# Calculates hash code according to all attributes.
|
187
|
+
# @return [Integer] Hash code
|
188
|
+
def hash
|
189
|
+
[message, id, created_at, connector_id, sync_count, sync_status].hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Builds the object from hash
|
193
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
194
|
+
# @return [Object] Returns the model itself
|
195
|
+
def self.build_from_hash(attributes)
|
196
|
+
new.build_from_hash(attributes)
|
197
|
+
end
|
198
|
+
|
199
|
+
# Builds the object from hash
|
200
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
201
|
+
# @return [Object] Returns the model itself
|
202
|
+
def build_from_hash(attributes)
|
203
|
+
return nil unless attributes.is_a?(Hash)
|
204
|
+
self.class.openapi_types.each_pair do |key, type|
|
205
|
+
if type =~ /\AArray<(.*)>/i
|
206
|
+
# check to ensure the input is an array given that the attribute
|
207
|
+
# is documented as an array but the input is not
|
208
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
209
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
210
|
+
end
|
211
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
212
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
213
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
214
|
+
end
|
215
|
+
|
216
|
+
self
|
217
|
+
end
|
218
|
+
|
219
|
+
# Deserializes the data based on type
|
220
|
+
# @param string type Data type
|
221
|
+
# @param string value Value to be deserialized
|
222
|
+
# @return [Object] Deserialized data
|
223
|
+
def _deserialize(type, value)
|
224
|
+
case type.to_sym
|
225
|
+
when :DateTime
|
226
|
+
DateTime.parse(value)
|
227
|
+
when :Date
|
228
|
+
Date.parse(value)
|
229
|
+
when :String
|
230
|
+
value.to_s
|
231
|
+
when :Integer
|
232
|
+
value.to_i
|
233
|
+
when :Float
|
234
|
+
value.to_f
|
235
|
+
when :Boolean
|
236
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
237
|
+
true
|
238
|
+
else
|
239
|
+
false
|
240
|
+
end
|
241
|
+
when :Object
|
242
|
+
# generic object (usually a Hash), return directly
|
243
|
+
value
|
244
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
245
|
+
inner_type = Regexp.last_match[:inner_type]
|
246
|
+
value.map { |v| _deserialize(inner_type, v) }
|
247
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
248
|
+
k_type = Regexp.last_match[:k_type]
|
249
|
+
v_type = Regexp.last_match[:v_type]
|
250
|
+
{}.tap do |hash|
|
251
|
+
value.each do |k, v|
|
252
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
else # model
|
256
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
# Returns the string representation of the object
|
261
|
+
# @return [String] String presentation of the object
|
262
|
+
def to_s
|
263
|
+
to_hash.to_s
|
264
|
+
end
|
265
|
+
|
266
|
+
# to_body is an alias to to_hash (backward compatibility)
|
267
|
+
# @return [Hash] Returns the object in the form of hash
|
268
|
+
def to_body
|
269
|
+
to_hash
|
270
|
+
end
|
271
|
+
|
272
|
+
# Returns the object in the form of hash
|
273
|
+
# @return [Hash] Returns the object in the form of hash
|
274
|
+
def to_hash
|
275
|
+
hash = {}
|
276
|
+
self.class.attribute_map.each_pair do |attr, param|
|
277
|
+
value = self.send(attr)
|
278
|
+
if value.nil?
|
279
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
280
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
281
|
+
end
|
282
|
+
|
283
|
+
hash[param] = _to_hash(value)
|
284
|
+
end
|
285
|
+
hash
|
286
|
+
end
|
287
|
+
|
288
|
+
# Outputs non-array value in the form of hash
|
289
|
+
# For object, use to_hash. Otherwise, just return the value
|
290
|
+
# @param [Object] value Any valid value
|
291
|
+
# @return [Hash] Returns the value in the form of hash
|
292
|
+
def _to_hash(value)
|
293
|
+
if value.is_a?(Array)
|
294
|
+
value.compact.map { |v| _to_hash(v) }
|
295
|
+
elsif value.is_a?(Hash)
|
296
|
+
{}.tap do |hash|
|
297
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
298
|
+
end
|
299
|
+
elsif value.respond_to? :to_hash
|
300
|
+
value.to_hash
|
301
|
+
else
|
302
|
+
value
|
303
|
+
end
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
Contact: contact@mailslurp.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
class ConnectorSyncRequestResult
|
17
|
+
attr_accessor :sync_result
|
18
|
+
|
19
|
+
attr_accessor :exception
|
20
|
+
|
21
|
+
attr_accessor :event_id
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'sync_result' => :'syncResult',
|
27
|
+
:'exception' => :'exception',
|
28
|
+
:'event_id' => :'eventId'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'sync_result' => :'ConnectorSyncResult',
|
36
|
+
:'exception' => :'ConnectorSyncRequestResultException',
|
37
|
+
:'event_id' => :'String'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# List of attributes with nullable: true
|
42
|
+
def self.openapi_nullable
|
43
|
+
Set.new([
|
44
|
+
])
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
if (!attributes.is_a?(Hash))
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ConnectorSyncRequestResult` initialize method"
|
52
|
+
end
|
53
|
+
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ConnectorSyncRequestResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
58
|
+
end
|
59
|
+
h[k.to_sym] = v
|
60
|
+
}
|
61
|
+
|
62
|
+
if attributes.key?(:'sync_result')
|
63
|
+
self.sync_result = attributes[:'sync_result']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'exception')
|
67
|
+
self.exception = attributes[:'exception']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'event_id')
|
71
|
+
self.event_id = attributes[:'event_id']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
sync_result == o.sync_result &&
|
94
|
+
exception == o.exception &&
|
95
|
+
event_id == o.event_id
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Integer] Hash code
|
106
|
+
def hash
|
107
|
+
[sync_result, exception, event_id].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def self.build_from_hash(attributes)
|
114
|
+
new.build_from_hash(attributes)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
self.class.openapi_types.each_pair do |key, type|
|
123
|
+
if type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :DateTime
|
144
|
+
DateTime.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :Boolean
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the string representation of the object
|
179
|
+
# @return [String] String presentation of the object
|
180
|
+
def to_s
|
181
|
+
to_hash.to_s
|
182
|
+
end
|
183
|
+
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_body
|
187
|
+
to_hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the object in the form of hash
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_hash
|
193
|
+
hash = {}
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
195
|
+
value = self.send(attr)
|
196
|
+
if value.nil?
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
199
|
+
end
|
200
|
+
|
201
|
+
hash[param] = _to_hash(value)
|
202
|
+
end
|
203
|
+
hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Outputs non-array value in the form of hash
|
207
|
+
# For object, use to_hash. Otherwise, just return the value
|
208
|
+
# @param [Object] value Any valid value
|
209
|
+
# @return [Hash] Returns the value in the form of hash
|
210
|
+
def _to_hash(value)
|
211
|
+
if value.is_a?(Array)
|
212
|
+
value.compact.map { |v| _to_hash(v) }
|
213
|
+
elsif value.is_a?(Hash)
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
216
|
+
end
|
217
|
+
elsif value.respond_to? :to_hash
|
218
|
+
value.to_hash
|
219
|
+
else
|
220
|
+
value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|