moonlogs-ruby 0.6.0 → 0.7.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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +150 -145
  3. data/docs/ApiTokenRequest.md +7 -0
  4. data/docs/ApiTokenResponse.md +10 -0
  5. data/docs/DefaultApi.md +276 -276
  6. data/docs/InlineResponse200.md +1 -1
  7. data/docs/InlineResponse2001.md +1 -1
  8. data/docs/InlineResponse20010.md +1 -1
  9. data/docs/InlineResponse20012.md +1 -1
  10. data/docs/InlineResponse20013.md +1 -1
  11. data/docs/InlineResponse2005.md +1 -1
  12. data/docs/InlineResponse2006.md +1 -1
  13. data/docs/InlineResponse2009.md +1 -1
  14. data/docs/OneOfUserRequestRole.md +6 -0
  15. data/docs/OneOfUserResponseRole.md +6 -0
  16. data/docs/SchemaRequest.md +14 -0
  17. data/docs/SchemaResponse.md +14 -0
  18. data/docs/TagRequest.md +7 -0
  19. data/docs/TagResponse.md +8 -0
  20. data/docs/UserRequest.md +14 -0
  21. data/docs/UserResponse.md +15 -0
  22. data/lib/moonlogs-ruby/api/default_api.rb +384 -384
  23. data/lib/moonlogs-ruby/api_client.rb +1 -1
  24. data/lib/moonlogs-ruby/api_error.rb +1 -1
  25. data/lib/moonlogs-ruby/configuration.rb +1 -1
  26. data/lib/moonlogs-ruby/models/api_token.rb +1 -1
  27. data/lib/moonlogs-ruby/models/api_token_request.rb +211 -0
  28. data/lib/moonlogs-ruby/models/api_token_response.rb +253 -0
  29. data/lib/moonlogs-ruby/models/credentials.rb +1 -1
  30. data/lib/moonlogs-ruby/models/inline_response_200.rb +1 -1
  31. data/lib/moonlogs-ruby/models/inline_response_200_1.rb +1 -1
  32. data/lib/moonlogs-ruby/models/inline_response_200_10.rb +1 -1
  33. data/lib/moonlogs-ruby/models/inline_response_200_11.rb +1 -1
  34. data/lib/moonlogs-ruby/models/inline_response_200_12.rb +1 -1
  35. data/lib/moonlogs-ruby/models/inline_response_200_13.rb +1 -1
  36. data/lib/moonlogs-ruby/models/inline_response_200_2.rb +1 -1
  37. data/lib/moonlogs-ruby/models/inline_response_200_3.rb +1 -1
  38. data/lib/moonlogs-ruby/models/inline_response_200_4.rb +1 -1
  39. data/lib/moonlogs-ruby/models/inline_response_200_5.rb +1 -1
  40. data/lib/moonlogs-ruby/models/inline_response_200_6.rb +1 -1
  41. data/lib/moonlogs-ruby/models/inline_response_200_7.rb +1 -1
  42. data/lib/moonlogs-ruby/models/inline_response_200_8.rb +1 -1
  43. data/lib/moonlogs-ruby/models/inline_response_200_9.rb +1 -1
  44. data/lib/moonlogs-ruby/models/level.rb +1 -1
  45. data/lib/moonlogs-ruby/models/meta.rb +1 -1
  46. data/lib/moonlogs-ruby/models/one_of_record_request_level.rb +1 -1
  47. data/lib/moonlogs-ruby/models/one_of_record_response_level.rb +1 -1
  48. data/lib/moonlogs-ruby/models/one_of_user_request_role.rb +197 -0
  49. data/lib/moonlogs-ruby/models/one_of_user_response_role.rb +197 -0
  50. data/lib/moonlogs-ruby/models/record_request.rb +1 -1
  51. data/lib/moonlogs-ruby/models/record_response.rb +1 -1
  52. data/lib/moonlogs-ruby/models/role.rb +1 -1
  53. data/lib/moonlogs-ruby/models/schema_field.rb +1 -1
  54. data/lib/moonlogs-ruby/models/schema_kind.rb +1 -1
  55. data/lib/moonlogs-ruby/models/schema_request.rb +293 -0
  56. data/lib/moonlogs-ruby/models/schema_response.rb +298 -0
  57. data/lib/moonlogs-ruby/models/session.rb +1 -1
  58. data/lib/moonlogs-ruby/models/tag.rb +1 -1
  59. data/lib/moonlogs-ruby/models/tag_request.rb +211 -0
  60. data/lib/moonlogs-ruby/models/tag_response.rb +225 -0
  61. data/lib/moonlogs-ruby/models/user_request.rb +291 -0
  62. data/lib/moonlogs-ruby/models/user_response.rb +315 -0
  63. data/lib/moonlogs-ruby/version.rb +2 -2
  64. data/lib/moonlogs-ruby.rb +11 -6
  65. data/moonlogs-ruby.gemspec +1 -1
  66. data/spec/models/api_token_request_spec.rb +40 -0
  67. data/spec/models/api_token_response_spec.rb +58 -0
  68. data/spec/models/one_of_user_request_role_spec.rb +34 -0
  69. data/spec/models/one_of_user_response_role_spec.rb +34 -0
  70. data/spec/models/schema_request_spec.rb +76 -0
  71. data/spec/models/schema_response_spec.rb +82 -0
  72. data/spec/models/tag_request_spec.rb +40 -0
  73. data/spec/models/tag_response_spec.rb +46 -0
  74. data/spec/models/user_request_spec.rb +82 -0
  75. data/spec/models/user_response_spec.rb +88 -0
  76. metadata +42 -2
@@ -0,0 +1,293 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 0.7.0
7
+ Contact: shalpack@gmail.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.52
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module MoonlogsRuby
15
+ class SchemaRequest
16
+ attr_accessor :title
17
+
18
+ attr_accessor :description
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :fields
23
+
24
+ attr_accessor :kinds
25
+
26
+ attr_accessor :tag_id
27
+
28
+ attr_accessor :tag_name
29
+
30
+ attr_accessor :retention_days
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'title' => :'title',
36
+ :'description' => :'description',
37
+ :'name' => :'name',
38
+ :'fields' => :'fields',
39
+ :'kinds' => :'kinds',
40
+ :'tag_id' => :'tag_id',
41
+ :'tag_name' => :'tag_name',
42
+ :'retention_days' => :'retention_days'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'title' => :'Object',
50
+ :'description' => :'Object',
51
+ :'name' => :'Object',
52
+ :'fields' => :'Object',
53
+ :'kinds' => :'Object',
54
+ :'tag_id' => :'Object',
55
+ :'tag_name' => :'Object',
56
+ :'retention_days' => :'Object'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoonlogsRuby::SchemaRequest` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::SchemaRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'title')
82
+ self.title = attributes[:'title']
83
+ end
84
+
85
+ if attributes.key?(:'description')
86
+ self.description = attributes[:'description']
87
+ end
88
+
89
+ if attributes.key?(:'name')
90
+ self.name = attributes[:'name']
91
+ end
92
+
93
+ if attributes.key?(:'fields')
94
+ if (value = attributes[:'fields']).is_a?(Array)
95
+ self.fields = value
96
+ end
97
+ end
98
+
99
+ if attributes.key?(:'kinds')
100
+ if (value = attributes[:'kinds']).is_a?(Array)
101
+ self.kinds = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'tag_id')
106
+ self.tag_id = attributes[:'tag_id']
107
+ end
108
+
109
+ if attributes.key?(:'tag_name')
110
+ self.tag_name = attributes[:'tag_name']
111
+ end
112
+
113
+ if attributes.key?(:'retention_days')
114
+ self.retention_days = attributes[:'retention_days']
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
+ invalid_properties = Array.new
122
+ if @title.nil?
123
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
124
+ end
125
+
126
+ if @description.nil?
127
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
128
+ end
129
+
130
+ if @name.nil?
131
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
132
+ end
133
+
134
+ if @fields.nil?
135
+ invalid_properties.push('invalid value for "fields", fields cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return false if @title.nil?
145
+ return false if @description.nil?
146
+ return false if @name.nil?
147
+ return false if @fields.nil?
148
+ true
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ title == o.title &&
157
+ description == o.description &&
158
+ name == o.name &&
159
+ fields == o.fields &&
160
+ kinds == o.kinds &&
161
+ tag_id == o.tag_id &&
162
+ tag_name == o.tag_name &&
163
+ retention_days == o.retention_days
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
+ [title, description, name, fields, kinds, tag_id, tag_name, retention_days].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
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ self.class.openapi_types.each_pair do |key, type|
191
+ if type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
195
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ end
197
+ elsif !attributes[self.class.attribute_map[key]].nil?
198
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
200
+ self.send("#{key}=", nil)
201
+ end
202
+ end
203
+
204
+ self
205
+ end
206
+
207
+ # Deserializes the data based on type
208
+ # @param string type Data type
209
+ # @param string value Value to be deserialized
210
+ # @return [Object] Deserialized data
211
+ def _deserialize(type, value)
212
+ case type.to_sym
213
+ when :DateTime
214
+ DateTime.parse(value)
215
+ when :Date
216
+ Date.parse(value)
217
+ when :String
218
+ value.to_s
219
+ when :Integer
220
+ value.to_i
221
+ when :Float
222
+ value.to_f
223
+ when :Boolean
224
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
+ true
226
+ else
227
+ false
228
+ end
229
+ when :Object
230
+ # generic object (usually a Hash), return directly
231
+ value
232
+ when /\AArray<(?<inner_type>.+)>\z/
233
+ inner_type = Regexp.last_match[:inner_type]
234
+ value.map { |v| _deserialize(inner_type, v) }
235
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
236
+ k_type = Regexp.last_match[:k_type]
237
+ v_type = Regexp.last_match[:v_type]
238
+ {}.tap do |hash|
239
+ value.each do |k, v|
240
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
241
+ end
242
+ end
243
+ else # model
244
+ MoonlogsRuby.const_get(type).build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end end
293
+ end
@@ -0,0 +1,298 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 0.7.0
7
+ Contact: shalpack@gmail.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.52
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module MoonlogsRuby
15
+ class SchemaResponse
16
+ attr_accessor :id
17
+
18
+ attr_accessor :title
19
+
20
+ attr_accessor :description
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :fields
25
+
26
+ attr_accessor :kinds
27
+
28
+ attr_accessor :tag_id
29
+
30
+ attr_accessor :retention_days
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id' => :'id',
36
+ :'title' => :'title',
37
+ :'description' => :'description',
38
+ :'name' => :'name',
39
+ :'fields' => :'fields',
40
+ :'kinds' => :'kinds',
41
+ :'tag_id' => :'tag_id',
42
+ :'retention_days' => :'retention_days'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id' => :'Object',
50
+ :'title' => :'Object',
51
+ :'description' => :'Object',
52
+ :'name' => :'Object',
53
+ :'fields' => :'Object',
54
+ :'kinds' => :'Object',
55
+ :'tag_id' => :'Object',
56
+ :'retention_days' => :'Object'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoonlogsRuby::SchemaResponse` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::SchemaResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'id')
82
+ self.id = attributes[:'id']
83
+ end
84
+
85
+ if attributes.key?(:'title')
86
+ self.title = attributes[:'title']
87
+ end
88
+
89
+ if attributes.key?(:'description')
90
+ self.description = attributes[:'description']
91
+ end
92
+
93
+ if attributes.key?(:'name')
94
+ self.name = attributes[:'name']
95
+ end
96
+
97
+ if attributes.key?(:'fields')
98
+ if (value = attributes[:'fields']).is_a?(Array)
99
+ self.fields = value
100
+ end
101
+ end
102
+
103
+ if attributes.key?(:'kinds')
104
+ if (value = attributes[:'kinds']).is_a?(Array)
105
+ self.kinds = value
106
+ end
107
+ end
108
+
109
+ if attributes.key?(:'tag_id')
110
+ self.tag_id = attributes[:'tag_id']
111
+ end
112
+
113
+ if attributes.key?(:'retention_days')
114
+ self.retention_days = attributes[:'retention_days']
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
+ invalid_properties = Array.new
122
+ if @id.nil?
123
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
124
+ end
125
+
126
+ if @title.nil?
127
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
128
+ end
129
+
130
+ if @name.nil?
131
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
132
+ end
133
+
134
+ if @fields.nil?
135
+ invalid_properties.push('invalid value for "fields", fields cannot be nil.')
136
+ end
137
+
138
+ if @kinds.nil?
139
+ invalid_properties.push('invalid value for "kinds", kinds 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 @id.nil?
149
+ return false if @title.nil?
150
+ return false if @name.nil?
151
+ return false if @fields.nil?
152
+ return false if @kinds.nil?
153
+ true
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
+ id == o.id &&
162
+ title == o.title &&
163
+ description == o.description &&
164
+ name == o.name &&
165
+ fields == o.fields &&
166
+ kinds == o.kinds &&
167
+ tag_id == o.tag_id &&
168
+ retention_days == o.retention_days
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Integer] Hash code
179
+ def hash
180
+ [id, title, description, name, fields, kinds, tag_id, retention_days].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def self.build_from_hash(attributes)
187
+ new.build_from_hash(attributes)
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ self.class.openapi_types.each_pair do |key, type|
196
+ if type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
200
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ end
202
+ elsif !attributes[self.class.attribute_map[key]].nil?
203
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
205
+ self.send("#{key}=", nil)
206
+ end
207
+ end
208
+
209
+ self
210
+ end
211
+
212
+ # Deserializes the data based on type
213
+ # @param string type Data type
214
+ # @param string value Value to be deserialized
215
+ # @return [Object] Deserialized data
216
+ def _deserialize(type, value)
217
+ case type.to_sym
218
+ when :DateTime
219
+ DateTime.parse(value)
220
+ when :Date
221
+ Date.parse(value)
222
+ when :String
223
+ value.to_s
224
+ when :Integer
225
+ value.to_i
226
+ when :Float
227
+ value.to_f
228
+ when :Boolean
229
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
+ true
231
+ else
232
+ false
233
+ end
234
+ when :Object
235
+ # generic object (usually a Hash), return directly
236
+ value
237
+ when /\AArray<(?<inner_type>.+)>\z/
238
+ inner_type = Regexp.last_match[:inner_type]
239
+ value.map { |v| _deserialize(inner_type, v) }
240
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
+ k_type = Regexp.last_match[:k_type]
242
+ v_type = Regexp.last_match[:v_type]
243
+ {}.tap do |hash|
244
+ value.each do |k, v|
245
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
+ end
247
+ end
248
+ else # model
249
+ MoonlogsRuby.const_get(type).build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ # Outputs non-array value in the form of hash
282
+ # For object, use to_hash. Otherwise, just return the value
283
+ # @param [Object] value Any valid value
284
+ # @return [Hash] Returns the value in the form of hash
285
+ def _to_hash(value)
286
+ if value.is_a?(Array)
287
+ value.compact.map { |v| _to_hash(v) }
288
+ elsif value.is_a?(Hash)
289
+ {}.tap do |hash|
290
+ value.each { |k, v| hash[k] = _to_hash(v) }
291
+ end
292
+ elsif value.respond_to? :to_hash
293
+ value.to_hash
294
+ else
295
+ value
296
+ end
297
+ end end
298
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.6.0
6
+ OpenAPI spec version: 0.7.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.6.0
6
+ OpenAPI spec version: 0.6.1
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52