trakerr_client 1.0.0r

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 (53) hide show
  1. data/.gitignore +5 -0
  2. data/README.md +148 -0
  3. data/generated/.gitignore +50 -0
  4. data/generated/.rspec +2 -0
  5. data/generated/.swagger-codegen-ignore +23 -0
  6. data/generated/LICENSE +201 -0
  7. data/generated/README.md +97 -0
  8. data/generated/docs/AppEvent.md +30 -0
  9. data/generated/docs/CustomData.md +9 -0
  10. data/generated/docs/CustomDoubleData.md +17 -0
  11. data/generated/docs/CustomStringData.md +17 -0
  12. data/generated/docs/Error.md +10 -0
  13. data/generated/docs/EventsApi.md +55 -0
  14. data/generated/docs/InnerStackTrace.md +10 -0
  15. data/generated/docs/StackTraceLine.md +10 -0
  16. data/generated/docs/StackTraceLines.md +7 -0
  17. data/generated/docs/Stacktrace.md +7 -0
  18. data/generated/git_push.sh +67 -0
  19. data/generated/lib/trakerr_client/api/events_api.rb +90 -0
  20. data/generated/lib/trakerr_client/api_client.rb +378 -0
  21. data/generated/lib/trakerr_client/api_error.rb +47 -0
  22. data/generated/lib/trakerr_client/configuration.rb +207 -0
  23. data/generated/lib/trakerr_client/models/app_event.rb +454 -0
  24. data/generated/lib/trakerr_client/models/custom_data.rb +208 -0
  25. data/generated/lib/trakerr_client/models/custom_double_data.rb +280 -0
  26. data/generated/lib/trakerr_client/models/custom_string_data.rb +280 -0
  27. data/generated/lib/trakerr_client/models/error.rb +217 -0
  28. data/generated/lib/trakerr_client/models/inner_stack_trace.rb +217 -0
  29. data/generated/lib/trakerr_client/models/stack_trace_line.rb +217 -0
  30. data/generated/lib/trakerr_client/models/stack_trace_lines.rb +190 -0
  31. data/generated/lib/trakerr_client/models/stacktrace.rb +190 -0
  32. data/generated/lib/trakerr_client/version.rb +26 -0
  33. data/generated/lib/trakerr_client.rb +60 -0
  34. data/generated/spec/api/events_api_spec.rb +58 -0
  35. data/generated/spec/api_client_spec.rb +237 -0
  36. data/generated/spec/configuration_spec.rb +53 -0
  37. data/generated/spec/models/app_event_spec.rb +167 -0
  38. data/generated/spec/models/custom_data_spec.rb +59 -0
  39. data/generated/spec/models/custom_double_data_spec.rb +107 -0
  40. data/generated/spec/models/custom_string_data_spec.rb +107 -0
  41. data/generated/spec/models/error_spec.rb +65 -0
  42. data/generated/spec/models/inner_stack_trace_spec.rb +65 -0
  43. data/generated/spec/models/stack_trace_line_spec.rb +65 -0
  44. data/generated/spec/models/stack_trace_lines_spec.rb +47 -0
  45. data/generated/spec/models/stacktrace_spec.rb +47 -0
  46. data/generated/spec/spec_helper.rb +122 -0
  47. data/generated/trakerr_client.gemspec +55 -0
  48. data/mkgem.sh +6 -0
  49. data/test_app.rb +40 -0
  50. data/trakerr/lib/event_trace_builder.rb +163 -0
  51. data/trakerr/lib/trakerr.rb +235 -0
  52. data/trakerr_client.gemspec +58 -0
  53. metadata +313 -0
@@ -0,0 +1,208 @@
1
+ =begin
2
+ #Trakerr API
3
+
4
+ #Get your application events and errors to Trakerr via the *Trakerr API*.
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module Trakerr
27
+ # (optional) Custom string or double data to submit along with the event. This data can then be used in the Trakerr UI to view segmented data.
28
+ class CustomData
29
+ attr_accessor :string_data
30
+
31
+ attr_accessor :double_data
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'string_data' => :'stringData',
38
+ :'double_data' => :'doubleData'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'string_data' => :'CustomStringData',
46
+ :'double_data' => :'CustomDoubleData'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
+
58
+ if attributes.has_key?(:'stringData')
59
+ self.string_data = attributes[:'stringData']
60
+ end
61
+
62
+ if attributes.has_key?(:'doubleData')
63
+ self.double_data = attributes[:'doubleData']
64
+ end
65
+
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properies with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ return invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ string_data == o.string_data &&
87
+ double_data == o.double_data
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [string_data, double_data].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.swagger_types.each_pair do |key, type|
108
+ if type =~ /^Array<(.*)>/i
109
+ # check to ensure the input is an array given that the the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ temp_model = Trakerr.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map{ |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+
206
+ end
207
+
208
+ end
@@ -0,0 +1,280 @@
1
+ =begin
2
+ #Trakerr API
3
+
4
+ #Get your application events and errors to Trakerr via the *Trakerr API*.
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module Trakerr
27
+
28
+ class CustomDoubleData
29
+ attr_accessor :custom_data1
30
+
31
+ attr_accessor :custom_data2
32
+
33
+ attr_accessor :custom_data3
34
+
35
+ attr_accessor :custom_data4
36
+
37
+ attr_accessor :custom_data5
38
+
39
+ attr_accessor :custom_data6
40
+
41
+ attr_accessor :custom_data7
42
+
43
+ attr_accessor :custom_data8
44
+
45
+ attr_accessor :custom_data9
46
+
47
+ attr_accessor :custom_data10
48
+
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'custom_data1' => :'customData1',
54
+ :'custom_data2' => :'customData2',
55
+ :'custom_data3' => :'customData3',
56
+ :'custom_data4' => :'customData4',
57
+ :'custom_data5' => :'customData5',
58
+ :'custom_data6' => :'customData6',
59
+ :'custom_data7' => :'customData7',
60
+ :'custom_data8' => :'customData8',
61
+ :'custom_data9' => :'customData9',
62
+ :'custom_data10' => :'customData10'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'custom_data1' => :'Float',
70
+ :'custom_data2' => :'Float',
71
+ :'custom_data3' => :'Float',
72
+ :'custom_data4' => :'Float',
73
+ :'custom_data5' => :'Float',
74
+ :'custom_data6' => :'Float',
75
+ :'custom_data7' => :'Float',
76
+ :'custom_data8' => :'Float',
77
+ :'custom_data9' => :'Float',
78
+ :'custom_data10' => :'Float'
79
+ }
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ return unless attributes.is_a?(Hash)
86
+
87
+ # convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
89
+
90
+ if attributes.has_key?(:'customData1')
91
+ self.custom_data1 = attributes[:'customData1']
92
+ end
93
+
94
+ if attributes.has_key?(:'customData2')
95
+ self.custom_data2 = attributes[:'customData2']
96
+ end
97
+
98
+ if attributes.has_key?(:'customData3')
99
+ self.custom_data3 = attributes[:'customData3']
100
+ end
101
+
102
+ if attributes.has_key?(:'customData4')
103
+ self.custom_data4 = attributes[:'customData4']
104
+ end
105
+
106
+ if attributes.has_key?(:'customData5')
107
+ self.custom_data5 = attributes[:'customData5']
108
+ end
109
+
110
+ if attributes.has_key?(:'customData6')
111
+ self.custom_data6 = attributes[:'customData6']
112
+ end
113
+
114
+ if attributes.has_key?(:'customData7')
115
+ self.custom_data7 = attributes[:'customData7']
116
+ end
117
+
118
+ if attributes.has_key?(:'customData8')
119
+ self.custom_data8 = attributes[:'customData8']
120
+ end
121
+
122
+ if attributes.has_key?(:'customData9')
123
+ self.custom_data9 = attributes[:'customData9']
124
+ end
125
+
126
+ if attributes.has_key?(:'customData10')
127
+ self.custom_data10 = attributes[:'customData10']
128
+ end
129
+
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properies with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+ return invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ return true
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ custom_data1 == o.custom_data1 &&
151
+ custom_data2 == o.custom_data2 &&
152
+ custom_data3 == o.custom_data3 &&
153
+ custom_data4 == o.custom_data4 &&
154
+ custom_data5 == o.custom_data5 &&
155
+ custom_data6 == o.custom_data6 &&
156
+ custom_data7 == o.custom_data7 &&
157
+ custom_data8 == o.custom_data8 &&
158
+ custom_data9 == o.custom_data9 &&
159
+ custom_data10 == o.custom_data10
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Fixnum] Hash code
170
+ def hash
171
+ [custom_data1, custom_data2, custom_data3, custom_data4, custom_data5, custom_data6, custom_data7, custom_data8, custom_data9, custom_data10].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.swagger_types.each_pair do |key, type|
180
+ if type =~ /^Array<(.*)>/i
181
+ # check to ensure the input is an array given that the the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ DateTime.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ temp_model = Trakerr.const_get(type).new
232
+ temp_model.build_from_hash(value)
233
+ end
234
+ end
235
+
236
+ # Returns the string representation of the object
237
+ # @return [String] String presentation of the object
238
+ def to_s
239
+ to_hash.to_s
240
+ end
241
+
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_body
245
+ to_hash
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ next if value.nil?
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map{ |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end