moonlogs-ruby 1.7.17 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +114 -5
  3. data/docs/ActionRequest.md +13 -0
  4. data/docs/ActionResponse.md +14 -0
  5. data/docs/Condition.md +9 -0
  6. data/docs/DefaultApi.md +316 -0
  7. data/docs/InlineResponse20015.md +11 -0
  8. data/docs/InlineResponse20016.md +11 -0
  9. data/docs/InlineResponse20017.md +11 -0
  10. data/docs/InlineResponse20018.md +11 -0
  11. data/docs/InlineResponse20019.md +11 -0
  12. data/docs/RecordRequest.md +1 -0
  13. data/docs/RecordResponse.md +1 -0
  14. data/lib/moonlogs-ruby/api/default_api.rb +343 -1
  15. data/lib/moonlogs-ruby/api_client.rb +1 -1
  16. data/lib/moonlogs-ruby/api_error.rb +1 -1
  17. data/lib/moonlogs-ruby/configuration.rb +1 -1
  18. data/lib/moonlogs-ruby/models/action_request.rb +287 -0
  19. data/lib/moonlogs-ruby/models/action_response.rb +311 -0
  20. data/lib/moonlogs-ruby/models/api_token_request.rb +1 -1
  21. data/lib/moonlogs-ruby/models/api_token_response.rb +1 -1
  22. data/lib/moonlogs-ruby/models/condition.rb +239 -0
  23. data/lib/moonlogs-ruby/models/credentials.rb +1 -1
  24. data/lib/moonlogs-ruby/models/inline_response_200.rb +1 -1
  25. data/lib/moonlogs-ruby/models/inline_response_200_1.rb +1 -1
  26. data/lib/moonlogs-ruby/models/inline_response_200_10.rb +1 -1
  27. data/lib/moonlogs-ruby/models/inline_response_200_11.rb +1 -1
  28. data/lib/moonlogs-ruby/models/inline_response_200_12.rb +1 -1
  29. data/lib/moonlogs-ruby/models/inline_response_200_13.rb +1 -1
  30. data/lib/moonlogs-ruby/models/inline_response_200_14.rb +1 -1
  31. data/lib/moonlogs-ruby/models/inline_response_200_15.rb +267 -0
  32. data/lib/moonlogs-ruby/models/inline_response_200_16.rb +267 -0
  33. data/lib/moonlogs-ruby/models/inline_response_200_17.rb +269 -0
  34. data/lib/moonlogs-ruby/models/inline_response_200_18.rb +267 -0
  35. data/lib/moonlogs-ruby/models/inline_response_200_19.rb +268 -0
  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 +1 -1
  49. data/lib/moonlogs-ruby/models/one_of_user_response_role.rb +1 -1
  50. data/lib/moonlogs-ruby/models/record_request.rb +14 -5
  51. data/lib/moonlogs-ruby/models/record_response.rb +19 -5
  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 +1 -1
  56. data/lib/moonlogs-ruby/models/schema_response.rb +1 -1
  57. data/lib/moonlogs-ruby/models/session.rb +1 -1
  58. data/lib/moonlogs-ruby/models/tag_request.rb +1 -1
  59. data/lib/moonlogs-ruby/models/tag_response.rb +1 -1
  60. data/lib/moonlogs-ruby/models/user_request.rb +1 -1
  61. data/lib/moonlogs-ruby/models/user_response.rb +1 -1
  62. data/lib/moonlogs-ruby/version.rb +2 -2
  63. data/lib/moonlogs-ruby.rb +9 -1
  64. data/moonlogs-ruby.gemspec +1 -1
  65. data/spec/models/action_request_spec.rb +76 -0
  66. data/spec/models/action_response_spec.rb +82 -0
  67. data/spec/models/condition_spec.rb +52 -0
  68. data/spec/models/inline_response_200_15_spec.rb +64 -0
  69. data/spec/models/inline_response_200_16_spec.rb +64 -0
  70. data/spec/models/inline_response_200_17_spec.rb +64 -0
  71. data/spec/models/inline_response_200_18_spec.rb +64 -0
  72. data/spec/models/inline_response_200_19_spec.rb +64 -0
  73. metadata +34 -2
@@ -0,0 +1,267 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 1.8.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 InlineResponse20015
16
+ attr_accessor :success
17
+
18
+ attr_accessor :code
19
+
20
+ attr_accessor :error
21
+
22
+ attr_accessor :data
23
+
24
+ attr_accessor :meta
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'success' => :'success',
30
+ :'code' => :'code',
31
+ :'error' => :'error',
32
+ :'data' => :'data',
33
+ :'meta' => :'meta'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'success' => :'Object',
41
+ :'code' => :'Object',
42
+ :'error' => :'Object',
43
+ :'data' => :'Object',
44
+ :'meta' => :'Object'
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 `MoonlogsRuby::InlineResponse20015` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::InlineResponse20015`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'success')
70
+ self.success = attributes[:'success']
71
+ end
72
+
73
+ if attributes.key?(:'code')
74
+ self.code = attributes[:'code']
75
+ end
76
+
77
+ if attributes.key?(:'error')
78
+ self.error = attributes[:'error']
79
+ end
80
+
81
+ if attributes.key?(:'data')
82
+ self.data = attributes[:'data']
83
+ end
84
+
85
+ if attributes.key?(:'meta')
86
+ self.meta = attributes[:'meta']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ if @success.nil?
95
+ invalid_properties.push('invalid value for "success", success cannot be nil.')
96
+ end
97
+
98
+ if @code.nil?
99
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
100
+ end
101
+
102
+ if @error.nil?
103
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
104
+ end
105
+
106
+ if @data.nil?
107
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
108
+ end
109
+
110
+ if @meta.nil?
111
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return false if @success.nil?
121
+ return false if @code.nil?
122
+ return false if @error.nil?
123
+ return false if @data.nil?
124
+ return false if @meta.nil?
125
+ true
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
+ success == o.success &&
134
+ code == o.code &&
135
+ error == o.error &&
136
+ data == o.data &&
137
+ meta == o.meta
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [success, code, error, data, meta].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ new.build_from_hash(attributes)
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ self.class.openapi_types.each_pair do |key, type|
165
+ if type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ end
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ MoonlogsRuby.const_get(type).build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ # Outputs non-array value in the form of hash
251
+ # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
254
+ def _to_hash(value)
255
+ if value.is_a?(Array)
256
+ value.compact.map { |v| _to_hash(v) }
257
+ elsif value.is_a?(Hash)
258
+ {}.tap do |hash|
259
+ value.each { |k, v| hash[k] = _to_hash(v) }
260
+ end
261
+ elsif value.respond_to? :to_hash
262
+ value.to_hash
263
+ else
264
+ value
265
+ end
266
+ end end
267
+ end
@@ -0,0 +1,267 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 1.8.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 InlineResponse20016
16
+ attr_accessor :success
17
+
18
+ attr_accessor :code
19
+
20
+ attr_accessor :error
21
+
22
+ attr_accessor :data
23
+
24
+ attr_accessor :meta
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'success' => :'success',
30
+ :'code' => :'code',
31
+ :'error' => :'error',
32
+ :'data' => :'data',
33
+ :'meta' => :'meta'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'success' => :'Object',
41
+ :'code' => :'Object',
42
+ :'error' => :'Object',
43
+ :'data' => :'Object',
44
+ :'meta' => :'Object'
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 `MoonlogsRuby::InlineResponse20016` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::InlineResponse20016`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'success')
70
+ self.success = attributes[:'success']
71
+ end
72
+
73
+ if attributes.key?(:'code')
74
+ self.code = attributes[:'code']
75
+ end
76
+
77
+ if attributes.key?(:'error')
78
+ self.error = attributes[:'error']
79
+ end
80
+
81
+ if attributes.key?(:'data')
82
+ self.data = attributes[:'data']
83
+ end
84
+
85
+ if attributes.key?(:'meta')
86
+ self.meta = attributes[:'meta']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ if @success.nil?
95
+ invalid_properties.push('invalid value for "success", success cannot be nil.')
96
+ end
97
+
98
+ if @code.nil?
99
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
100
+ end
101
+
102
+ if @error.nil?
103
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
104
+ end
105
+
106
+ if @data.nil?
107
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
108
+ end
109
+
110
+ if @meta.nil?
111
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return false if @success.nil?
121
+ return false if @code.nil?
122
+ return false if @error.nil?
123
+ return false if @data.nil?
124
+ return false if @meta.nil?
125
+ true
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
+ success == o.success &&
134
+ code == o.code &&
135
+ error == o.error &&
136
+ data == o.data &&
137
+ meta == o.meta
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [success, code, error, data, meta].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ new.build_from_hash(attributes)
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ self.class.openapi_types.each_pair do |key, type|
165
+ if type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ end
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ MoonlogsRuby.const_get(type).build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ # Outputs non-array value in the form of hash
251
+ # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
254
+ def _to_hash(value)
255
+ if value.is_a?(Array)
256
+ value.compact.map { |v| _to_hash(v) }
257
+ elsif value.is_a?(Hash)
258
+ {}.tap do |hash|
259
+ value.each { |k, v| hash[k] = _to_hash(v) }
260
+ end
261
+ elsif value.respond_to? :to_hash
262
+ value.to_hash
263
+ else
264
+ value
265
+ end
266
+ end end
267
+ end