moonlogs-ruby 0.0.1.pre.rc

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +524 -0
  4. data/Rakefile +8 -0
  5. data/docs/ApiToken.md +10 -0
  6. data/docs/Credentials.md +8 -0
  7. data/docs/DefaultApi.md +1318 -0
  8. data/docs/InlineResponse200.md +11 -0
  9. data/docs/InlineResponse2001.md +11 -0
  10. data/docs/InlineResponse20010.md +11 -0
  11. data/docs/InlineResponse20011.md +11 -0
  12. data/docs/InlineResponse20012.md +11 -0
  13. data/docs/InlineResponse20013.md +11 -0
  14. data/docs/InlineResponse2002.md +11 -0
  15. data/docs/InlineResponse2003.md +11 -0
  16. data/docs/InlineResponse2004.md +11 -0
  17. data/docs/InlineResponse2005.md +11 -0
  18. data/docs/InlineResponse2006.md +11 -0
  19. data/docs/InlineResponse2007.md +11 -0
  20. data/docs/InlineResponse2008.md +11 -0
  21. data/docs/InlineResponse2009.md +11 -0
  22. data/docs/Level.md +6 -0
  23. data/docs/Meta.md +9 -0
  24. data/docs/OneOfRecordLevel.md +6 -0
  25. data/docs/OneOfUserRole.md +6 -0
  26. data/docs/Record.md +15 -0
  27. data/docs/Role.md +6 -0
  28. data/docs/Schema.md +14 -0
  29. data/docs/SchemaField.md +8 -0
  30. data/docs/SchemaKind.md +8 -0
  31. data/docs/SchemaSearch.md +8 -0
  32. data/docs/Session.md +7 -0
  33. data/docs/Tag.md +8 -0
  34. data/docs/User.md +14 -0
  35. data/git_push.sh +55 -0
  36. data/lib/moonlogs-ruby/api/default_api.rb +1458 -0
  37. data/lib/moonlogs-ruby/api_client.rb +388 -0
  38. data/lib/moonlogs-ruby/api_error.rb +57 -0
  39. data/lib/moonlogs-ruby/configuration.rb +205 -0
  40. data/lib/moonlogs-ruby/models/api_token.rb +253 -0
  41. data/lib/moonlogs-ruby/models/credentials.rb +225 -0
  42. data/lib/moonlogs-ruby/models/inline_response_200.rb +269 -0
  43. data/lib/moonlogs-ruby/models/inline_response_200_1.rb +267 -0
  44. data/lib/moonlogs-ruby/models/inline_response_200_10.rb +267 -0
  45. data/lib/moonlogs-ruby/models/inline_response_200_11.rb +267 -0
  46. data/lib/moonlogs-ruby/models/inline_response_200_12.rb +269 -0
  47. data/lib/moonlogs-ruby/models/inline_response_200_13.rb +267 -0
  48. data/lib/moonlogs-ruby/models/inline_response_200_2.rb +267 -0
  49. data/lib/moonlogs-ruby/models/inline_response_200_3.rb +269 -0
  50. data/lib/moonlogs-ruby/models/inline_response_200_4.rb +267 -0
  51. data/lib/moonlogs-ruby/models/inline_response_200_5.rb +269 -0
  52. data/lib/moonlogs-ruby/models/inline_response_200_6.rb +267 -0
  53. data/lib/moonlogs-ruby/models/inline_response_200_7.rb +268 -0
  54. data/lib/moonlogs-ruby/models/inline_response_200_8.rb +267 -0
  55. data/lib/moonlogs-ruby/models/inline_response_200_9.rb +269 -0
  56. data/lib/moonlogs-ruby/models/level.rb +32 -0
  57. data/lib/moonlogs-ruby/models/meta.rb +239 -0
  58. data/lib/moonlogs-ruby/models/one_of_record_level.rb +197 -0
  59. data/lib/moonlogs-ruby/models/one_of_user_role.rb +197 -0
  60. data/lib/moonlogs-ruby/models/record.rb +303 -0
  61. data/lib/moonlogs-ruby/models/role.rb +28 -0
  62. data/lib/moonlogs-ruby/models/schema.rb +298 -0
  63. data/lib/moonlogs-ruby/models/schema_field.rb +225 -0
  64. data/lib/moonlogs-ruby/models/schema_kind.rb +225 -0
  65. data/lib/moonlogs-ruby/models/schema_search.rb +215 -0
  66. data/lib/moonlogs-ruby/models/session.rb +211 -0
  67. data/lib/moonlogs-ruby/models/tag.rb +225 -0
  68. data/lib/moonlogs-ruby/models/user.rb +301 -0
  69. data/lib/moonlogs-ruby/version.rb +14 -0
  70. data/lib/moonlogs-ruby.rb +68 -0
  71. data/moonlogs-ruby-0.0.1.0.gem +0 -0
  72. data/moonlogs-ruby-0.0.1.gem +0 -0
  73. data/moonlogs-ruby.gemspec +38 -0
  74. data/spec/api/default_api_spec.rb +317 -0
  75. data/spec/api_client_spec.rb +225 -0
  76. data/spec/base_object_spec.rb +109 -0
  77. data/spec/configuration_spec.rb +41 -0
  78. data/spec/models/api_token_spec.rb +58 -0
  79. data/spec/models/credentials_spec.rb +46 -0
  80. data/spec/models/inline_response_200_10_spec.rb +64 -0
  81. data/spec/models/inline_response_200_11_spec.rb +64 -0
  82. data/spec/models/inline_response_200_12_spec.rb +64 -0
  83. data/spec/models/inline_response_200_13_spec.rb +64 -0
  84. data/spec/models/inline_response_200_1_spec.rb +64 -0
  85. data/spec/models/inline_response_200_2_spec.rb +64 -0
  86. data/spec/models/inline_response_200_3_spec.rb +64 -0
  87. data/spec/models/inline_response_200_4_spec.rb +64 -0
  88. data/spec/models/inline_response_200_5_spec.rb +64 -0
  89. data/spec/models/inline_response_200_6_spec.rb +64 -0
  90. data/spec/models/inline_response_200_7_spec.rb +64 -0
  91. data/spec/models/inline_response_200_8_spec.rb +64 -0
  92. data/spec/models/inline_response_200_9_spec.rb +64 -0
  93. data/spec/models/inline_response_200_spec.rb +64 -0
  94. data/spec/models/level_spec.rb +34 -0
  95. data/spec/models/meta_spec.rb +52 -0
  96. data/spec/models/one_of_record_level_spec.rb +34 -0
  97. data/spec/models/one_of_user_role_spec.rb +34 -0
  98. data/spec/models/record_spec.rb +88 -0
  99. data/spec/models/role_spec.rb +34 -0
  100. data/spec/models/schema_field_spec.rb +46 -0
  101. data/spec/models/schema_kind_spec.rb +46 -0
  102. data/spec/models/schema_search_spec.rb +46 -0
  103. data/spec/models/schema_spec.rb +82 -0
  104. data/spec/models/session_spec.rb +40 -0
  105. data/spec/models/tag_spec.rb +46 -0
  106. data/spec/models/user_spec.rb +82 -0
  107. data/spec/spec_helper.rb +110 -0
  108. metadata +243 -0
@@ -0,0 +1,253 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 0.0.1
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 ApiToken
16
+ attr_accessor :id
17
+
18
+ attr_accessor :token
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :is_revoked
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'token' => :'token',
29
+ :'name' => :'name',
30
+ :'is_revoked' => :'is_revoked'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'id' => :'Object',
38
+ :'token' => :'Object',
39
+ :'name' => :'Object',
40
+ :'is_revoked' => :'Object'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoonlogsRuby::ApiToken` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::ApiToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'id')
66
+ self.id = attributes[:'id']
67
+ end
68
+
69
+ if attributes.key?(:'token')
70
+ self.token = attributes[:'token']
71
+ end
72
+
73
+ if attributes.key?(:'name')
74
+ self.name = attributes[:'name']
75
+ end
76
+
77
+ if attributes.key?(:'is_revoked')
78
+ self.is_revoked = attributes[:'is_revoked']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+ if @id.nil?
87
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
88
+ end
89
+
90
+ if @token.nil?
91
+ invalid_properties.push('invalid value for "token", token cannot be nil.')
92
+ end
93
+
94
+ if @name.nil?
95
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
96
+ end
97
+
98
+ if @is_revoked.nil?
99
+ invalid_properties.push('invalid value for "is_revoked", is_revoked 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
+ return false if @id.nil?
109
+ return false if @token.nil?
110
+ return false if @name.nil?
111
+ return false if @is_revoked.nil?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ id == o.id &&
121
+ token == o.token &&
122
+ name == o.name &&
123
+ is_revoked == o.is_revoked
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Integer] Hash code
134
+ def hash
135
+ [id, token, name, is_revoked].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ new.build_from_hash(attributes)
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.openapi_types.each_pair do |key, type|
151
+ if type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
160
+ self.send("#{key}=", nil)
161
+ end
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :DateTime
174
+ DateTime.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :Boolean
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else # model
204
+ MoonlogsRuby.const_get(type).build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end end
253
+ end
@@ -0,0 +1,225 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 0.0.1
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 Credentials
16
+ attr_accessor :email
17
+
18
+ attr_accessor :password
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'email' => :'email',
24
+ :'password' => :'password'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'email' => :'Object',
32
+ :'password' => :'Object'
33
+ }
34
+ end
35
+
36
+ # List of attributes with nullable: true
37
+ def self.openapi_nullable
38
+ Set.new([
39
+ ])
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ if (!attributes.is_a?(Hash))
46
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoonlogsRuby::Credentials` initialize method"
47
+ end
48
+
49
+ # check to see if the attribute exists and convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h|
51
+ if (!self.class.attribute_map.key?(k.to_sym))
52
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::Credentials`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ end
54
+ h[k.to_sym] = v
55
+ }
56
+
57
+ if attributes.key?(:'email')
58
+ self.email = attributes[:'email']
59
+ end
60
+
61
+ if attributes.key?(:'password')
62
+ self.password = attributes[:'password']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @email.nil?
71
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
72
+ end
73
+
74
+ if @password.nil?
75
+ invalid_properties.push('invalid value for "password", password cannot be nil.')
76
+ end
77
+
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ return false if @email.nil?
85
+ return false if @password.nil?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ email == o.email &&
95
+ password == o.password
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
+ [email, password].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
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ end
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ MoonlogsRuby.const_get(type).build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end end
225
+ end