allq_rest 1.5.2 → 2.0.1

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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -97
  3. data/lib/allq_rest/client.rb +168 -0
  4. data/lib/allq_rest/configuration.rb +7 -192
  5. data/lib/allq_rest/errors.rb +17 -0
  6. data/lib/allq_rest/job.rb +10 -0
  7. data/lib/allq_rest/version.rb +2 -14
  8. data/lib/allq_rest.rb +21 -46
  9. data/swagger.yaml +706 -0
  10. metadata +32 -116
  11. data/Gemfile +0 -7
  12. data/Gemfile.lock +0 -42
  13. data/Rakefile +0 -8
  14. data/allq_rest-1.2.92.gem +0 -0
  15. data/allq_rest-1.2.93.gem +0 -0
  16. data/allq_rest-1.3.0.gem +0 -0
  17. data/allq_rest-1.4.0.gem +0 -0
  18. data/allq_rest-1.5.0.gem +0 -0
  19. data/allq_rest-1.5.1.gem +0 -0
  20. data/allq_rest.gemspec +0 -28
  21. data/deploy.sh +0 -4
  22. data/docs/ActionsApi.md +0 -544
  23. data/docs/AdminApi.md +0 -98
  24. data/docs/BasicPayload.md +0 -11
  25. data/docs/BasicResponse.md +0 -8
  26. data/docs/JobRef.md +0 -8
  27. data/docs/JobResponse.md +0 -12
  28. data/docs/NewJob.md +0 -13
  29. data/docs/NewParentJob.md +0 -16
  30. data/docs/StatsInfo.md +0 -9
  31. data/docs/StatsResults.md +0 -10
  32. data/docs/StatsTube.md +0 -14
  33. data/docs/Throttle.md +0 -9
  34. data/docs/TubeRef.md +0 -8
  35. data/git_push.sh +0 -55
  36. data/lib/.DS_Store +0 -0
  37. data/lib/allq_rest/.DS_Store +0 -0
  38. data/lib/allq_rest/api/actions_api.rb +0 -763
  39. data/lib/allq_rest/api/admin_api.rb +0 -181
  40. data/lib/allq_rest/api_client.rb +0 -395
  41. data/lib/allq_rest/api_error.rb +0 -38
  42. data/lib/allq_rest/models/basic_payload.rb +0 -218
  43. data/lib/allq_rest/models/basic_response.rb +0 -188
  44. data/lib/allq_rest/models/job_ref.rb +0 -190
  45. data/lib/allq_rest/models/job_response.rb +0 -260
  46. data/lib/allq_rest/models/multiple_job_response.rb +0 -187
  47. data/lib/allq_rest/models/new_job.rb +0 -281
  48. data/lib/allq_rest/models/new_parent_job.rb +0 -312
  49. data/lib/allq_rest/models/stats_info.rb +0 -204
  50. data/lib/allq_rest/models/stats_results.rb +0 -254
  51. data/lib/allq_rest/models/stats_tube.rb +0 -306
  52. data/lib/allq_rest/models/throttle.rb +0 -209
  53. data/lib/allq_rest/models/tube_ref.rb +0 -190
  54. data/spec/.DS_Store +0 -0
  55. data/spec/api/actions_api_spec.rb +0 -600
  56. data/spec/api/admin_api_spec.rb +0 -58
  57. data/spec/api_client_spec.rb +0 -226
  58. data/spec/configuration_spec.rb +0 -42
  59. data/spec/models/basic_payload_spec.rb +0 -60
  60. data/spec/models/basic_response_spec.rb +0 -42
  61. data/spec/models/job_ref_spec.rb +0 -42
  62. data/spec/models/job_response_spec.rb +0 -66
  63. data/spec/models/new_job_spec.rb +0 -72
  64. data/spec/models/new_parent_job_spec.rb +0 -90
  65. data/spec/models/stats_info_spec.rb +0 -48
  66. data/spec/models/stats_results_spec.rb +0 -54
  67. data/spec/models/stats_tube_spec.rb +0 -78
  68. data/spec/models/throttle_spec.rb +0 -48
  69. data/spec/models/tube_ref_spec.rb +0 -42
  70. data/spec/spec_helper.rb +0 -113
@@ -1,281 +0,0 @@
1
- =begin
2
- #AllQ
3
-
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.2
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module Allq
16
- # Values for a job submission
17
- class NewJob
18
- # Tube name
19
- attr_accessor :tube
20
-
21
- # Text payload
22
- attr_accessor :body
23
-
24
- # Time to live when reserved (in seconds)
25
- attr_accessor :ttl
26
-
27
- # Delay before becoming available for processing in seconds
28
- attr_accessor :delay
29
-
30
- # Priority of job in tube
31
- attr_accessor :priority
32
-
33
- # Parent job id (if applicable)
34
- attr_accessor :parent_id
35
-
36
- # Shard key (if applicable)
37
- attr_accessor :shard_key
38
-
39
- # Attribute mapping from ruby-style variable name to JSON key.
40
- def self.attribute_map
41
- {
42
- :'tube' => :'tube',
43
- :'body' => :'body',
44
- :'ttl' => :'ttl',
45
- :'delay' => :'delay',
46
- :'priority' => :'priority',
47
- :'parent_id' => :'parent_id',
48
- :'shard_key' => :'shard_key'
49
- }
50
- end
51
-
52
- # Attribute type mapping.
53
- def self.swagger_types
54
- {
55
- :'tube' => :'String',
56
- :'body' => :'String',
57
- :'ttl' => :'Integer',
58
- :'delay' => :'Integer',
59
- :'priority' => :'Integer',
60
- :'parent_id' => :'String',
61
- :'shard_key' => :'String'
62
- }
63
- end
64
-
65
- # Initializes the object
66
- # @param [Hash] attributes Model attributes in the form of hash
67
- def initialize(attributes = {})
68
- return unless attributes.is_a?(Hash)
69
-
70
- # convert string to symbol for hash key
71
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
-
73
- if attributes.has_key?(:'tube')
74
- self.tube = attributes[:'tube']
75
- else
76
- self.tube = 'default'
77
- end
78
-
79
- if attributes.has_key?(:'body')
80
- self.body = attributes[:'body']
81
- else
82
- self.body = '<BODY_TEXT>'
83
- end
84
-
85
- if attributes.has_key?(:'ttl')
86
- self.ttl = attributes[:'ttl']
87
- else
88
- self.ttl = 1200
89
- end
90
-
91
- if attributes.has_key?(:'delay')
92
- self.delay = attributes[:'delay']
93
- else
94
- self.delay = 0
95
- end
96
-
97
- if attributes.has_key?(:'priority')
98
- self.priority = attributes[:'priority']
99
- else
100
- self.priority = 5
101
- end
102
-
103
- if attributes.has_key?(:'parent_id')
104
- self.parent_id = attributes[:'parent_id']
105
- end
106
-
107
- if attributes.has_key?(:'shard_key')
108
- self.shard_key = attributes[:'shard_key']
109
- end
110
-
111
- end
112
-
113
- # Show invalid properties with the reasons. Usually used together with valid?
114
- # @return Array for valid properties with the reasons
115
- def list_invalid_properties
116
- invalid_properties = Array.new
117
- if @tube.nil?
118
- invalid_properties.push('invalid value for "tube", tube cannot be nil.')
119
- end
120
-
121
- if @body.nil?
122
- invalid_properties.push('invalid value for "body", body cannot be nil.')
123
- end
124
-
125
- if @ttl.nil?
126
- invalid_properties.push('invalid value for "ttl", ttl cannot be nil.')
127
- end
128
-
129
- if @delay.nil?
130
- invalid_properties.push('invalid value for "delay", delay cannot be nil.')
131
- end
132
-
133
- if @priority.nil?
134
- invalid_properties.push('invalid value for "priority", priority cannot be nil.')
135
- end
136
-
137
- invalid_properties
138
- end
139
-
140
- # Check to see if the all the properties in the model are valid
141
- # @return true if the model is valid
142
- def valid?
143
- return false if @tube.nil?
144
- return false if @body.nil?
145
- return false if @ttl.nil?
146
- return false if @delay.nil?
147
- return false if @priority.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
- tube == o.tube &&
157
- body == o.body &&
158
- ttl == o.ttl &&
159
- delay == o.delay &&
160
- priority == o.priority &&
161
- parent_id == o.parent_id &&
162
- shard_key = o.shard_key
163
- end
164
-
165
- # @see the `==` method
166
- # @param [Object] Object to be compared
167
- def eql?(o)
168
- self == o
169
- end
170
-
171
- # Calculates hash code according to all attributes.
172
- # @return [Fixnum] Hash code
173
- def hash
174
- [tube, body, ttl, delay, priority, parent_id, shard_key].hash
175
- end
176
-
177
- # Builds the object from hash
178
- # @param [Hash] attributes Model attributes in the form of hash
179
- # @return [Object] Returns the model itself
180
- def build_from_hash(attributes)
181
- return nil unless attributes.is_a?(Hash)
182
- self.class.swagger_types.each_pair do |key, type|
183
- if type =~ /\AArray<(.*)>/i
184
- # check to ensure the input is an array given that the the attribute
185
- # is documented as an array but the input is not
186
- if attributes[self.class.attribute_map[key]].is_a?(Array)
187
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
- end
189
- elsif !attributes[self.class.attribute_map[key]].nil?
190
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
- end # or else data not found in attributes(hash), not an issue as the data can be optional
192
- end
193
-
194
- self
195
- end
196
-
197
- # Deserializes the data based on type
198
- # @param string type Data type
199
- # @param string value Value to be deserialized
200
- # @return [Object] Deserialized data
201
- def _deserialize(type, value)
202
- case type.to_sym
203
- when :DateTime
204
- DateTime.parse(value)
205
- when :Date
206
- Date.parse(value)
207
- when :String
208
- value.to_s
209
- when :Integer
210
- value.to_i
211
- when :Float
212
- value.to_f
213
- when :BOOLEAN
214
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
- true
216
- else
217
- false
218
- end
219
- when :Object
220
- # generic object (usually a Hash), return directly
221
- value
222
- when /\AArray<(?<inner_type>.+)>\z/
223
- inner_type = Regexp.last_match[:inner_type]
224
- value.map { |v| _deserialize(inner_type, v) }
225
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
- k_type = Regexp.last_match[:k_type]
227
- v_type = Regexp.last_match[:v_type]
228
- {}.tap do |hash|
229
- value.each do |k, v|
230
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
- end
232
- end
233
- else # model
234
- temp_model = Allq.const_get(type).new
235
- temp_model.build_from_hash(value)
236
- end
237
- end
238
-
239
- # Returns the string representation of the object
240
- # @return [String] String presentation of the object
241
- def to_s
242
- to_hash.to_s
243
- end
244
-
245
- # to_body is an alias to to_hash (backward compatibility)
246
- # @return [Hash] Returns the object in the form of hash
247
- def to_body
248
- to_hash
249
- end
250
-
251
- # Returns the object in the form of hash
252
- # @return [Hash] Returns the object in the form of hash
253
- def to_hash
254
- hash = {}
255
- self.class.attribute_map.each_pair do |attr, param|
256
- value = self.send(attr)
257
- next if value.nil?
258
- hash[param] = _to_hash(value)
259
- end
260
- hash
261
- end
262
-
263
- # Outputs non-array value in the form of hash
264
- # For object, use to_hash. Otherwise, just return the value
265
- # @param [Object] value Any valid value
266
- # @return [Hash] Returns the value in the form of hash
267
- def _to_hash(value)
268
- if value.is_a?(Array)
269
- value.compact.map { |v| _to_hash(v) }
270
- elsif value.is_a?(Hash)
271
- {}.tap do |hash|
272
- value.each { |k, v| hash[k] = _to_hash(v) }
273
- end
274
- elsif value.respond_to? :to_hash
275
- value.to_hash
276
- else
277
- value
278
- end
279
- end
280
- end
281
- end
@@ -1,312 +0,0 @@
1
- =begin
2
- #AllQ
3
-
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.2
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module Allq
16
- # Model for a parent job
17
- class NewParentJob
18
- # Tube name
19
- attr_accessor :tube
20
-
21
- # Text payload
22
- attr_accessor :body
23
-
24
- # Time to live when reserved (in seconds)
25
- attr_accessor :ttl
26
-
27
- # Delay before becoming available for processing in seconds
28
- attr_accessor :delay
29
-
30
- # Priority of job in tube
31
- attr_accessor :priority
32
-
33
- # Parent job id (if applicable)
34
- attr_accessor :parent_id
35
-
36
- # Timeout to run
37
- attr_accessor :timeout
38
-
39
- # Execute job after timeout
40
- attr_accessor :run_on_timeout
41
-
42
- # Execute job after timeout
43
- attr_accessor :shard_key
44
-
45
- # Number of children
46
- attr_accessor :limit
47
-
48
- # Attribute mapping from ruby-style variable name to JSON key.
49
- def self.attribute_map
50
- {
51
- :'tube' => :'tube',
52
- :'body' => :'body',
53
- :'ttl' => :'ttl',
54
- :'delay' => :'delay',
55
- :'priority' => :'priority',
56
- :'parent_id' => :'parent_id',
57
- :'timeout' => :'timeout',
58
- :'run_on_timeout' => :'run_on_timeout',
59
- :'shard_key' => :'shard_key',
60
- :'limit' => :'limit'
61
- }
62
- end
63
-
64
- # Attribute type mapping.
65
- def self.swagger_types
66
- {
67
- :'tube' => :'String',
68
- :'body' => :'String',
69
- :'ttl' => :'Integer',
70
- :'delay' => :'Integer',
71
- :'priority' => :'Integer',
72
- :'parent_id' => :'String',
73
- :'timeout' => :'Integer',
74
- :'run_on_timeout' => :'BOOLEAN',
75
- :'shard_key' => :'shard_key',
76
- :'limit' => :'Integer'
77
- }
78
- end
79
-
80
- # Initializes the object
81
- # @param [Hash] attributes Model attributes in the form of hash
82
- def initialize(attributes = {})
83
- return unless attributes.is_a?(Hash)
84
-
85
- # convert string to symbol for hash key
86
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
87
-
88
- if attributes.has_key?(:'tube')
89
- self.tube = attributes[:'tube']
90
- else
91
- self.tube = 'default'
92
- end
93
-
94
- if attributes.has_key?(:'body')
95
- self.body = attributes[:'body']
96
- else
97
- self.body = '<BODY_TEXT>'
98
- end
99
-
100
- if attributes.has_key?(:'ttl')
101
- self.ttl = attributes[:'ttl']
102
- else
103
- self.ttl = 1200
104
- end
105
-
106
- if attributes.has_key?(:'delay')
107
- self.delay = attributes[:'delay']
108
- else
109
- self.delay = 0
110
- end
111
-
112
- if attributes.has_key?(:'priority')
113
- self.priority = attributes[:'priority']
114
- else
115
- self.priority = 5
116
- end
117
-
118
- if attributes.has_key?(:'parent_id')
119
- self.parent_id = attributes[:'parent_id']
120
- end
121
-
122
- if attributes.has_key?(:'timeout')
123
- self.timeout = attributes[:'timeout']
124
- end
125
-
126
- if attributes.has_key?(:'run_on_timeout')
127
- self.run_on_timeout = attributes[:'run_on_timeout']
128
- else
129
- self.run_on_timeout = false
130
- end
131
-
132
- if attributes.has_key?(:'shard_key')
133
- self.shard_key = attributes[:'shard_key']
134
- end
135
-
136
- if attributes.has_key?(:'limit')
137
- self.limit = attributes[:'limit']
138
- end
139
- end
140
-
141
- # Show invalid properties with the reasons. Usually used together with valid?
142
- # @return Array for valid properties with the reasons
143
- def list_invalid_properties
144
- invalid_properties = Array.new
145
- if @tube.nil?
146
- invalid_properties.push('invalid value for "tube", tube cannot be nil.')
147
- end
148
-
149
- if @body.nil?
150
- invalid_properties.push('invalid value for "body", body cannot be nil.')
151
- end
152
-
153
- if @ttl.nil?
154
- invalid_properties.push('invalid value for "ttl", ttl cannot be nil.')
155
- end
156
-
157
- if @delay.nil?
158
- invalid_properties.push('invalid value for "delay", delay cannot be nil.')
159
- end
160
-
161
- if @priority.nil?
162
- invalid_properties.push('invalid value for "priority", priority cannot be nil.')
163
- end
164
-
165
- invalid_properties
166
- end
167
-
168
- # Check to see if the all the properties in the model are valid
169
- # @return true if the model is valid
170
- def valid?
171
- return false if @tube.nil?
172
- return false if @body.nil?
173
- return false if @ttl.nil?
174
- return false if @delay.nil?
175
- return false if @priority.nil?
176
- true
177
- end
178
-
179
- # Checks equality by comparing each attribute.
180
- # @param [Object] Object to be compared
181
- def ==(o)
182
- return true if self.equal?(o)
183
- self.class == o.class &&
184
- tube == o.tube &&
185
- body == o.body &&
186
- ttl == o.ttl &&
187
- delay == o.delay &&
188
- priority == o.priority &&
189
- parent_id == o.parent_id &&
190
- timeout == o.timeout &&
191
- run_on_timeout == o.run_on_timeout &&
192
- shard_key = o.shard_key &&
193
- limit == o.limit
194
- end
195
-
196
- # @see the `==` method
197
- # @param [Object] Object to be compared
198
- def eql?(o)
199
- self == o
200
- end
201
-
202
- # Calculates hash code according to all attributes.
203
- # @return [Fixnum] Hash code
204
- def hash
205
- [tube, body, ttl, delay, priority, parent_id, timeout, run_on_timeout, limit].hash
206
- end
207
-
208
- # Builds the object from hash
209
- # @param [Hash] attributes Model attributes in the form of hash
210
- # @return [Object] Returns the model itself
211
- def build_from_hash(attributes)
212
- return nil unless attributes.is_a?(Hash)
213
- self.class.swagger_types.each_pair do |key, type|
214
- if type =~ /\AArray<(.*)>/i
215
- # check to ensure the input is an array given that the the attribute
216
- # is documented as an array but the input is not
217
- if attributes[self.class.attribute_map[key]].is_a?(Array)
218
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
219
- end
220
- elsif !attributes[self.class.attribute_map[key]].nil?
221
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
222
- end # or else data not found in attributes(hash), not an issue as the data can be optional
223
- end
224
-
225
- self
226
- end
227
-
228
- # Deserializes the data based on type
229
- # @param string type Data type
230
- # @param string value Value to be deserialized
231
- # @return [Object] Deserialized data
232
- def _deserialize(type, value)
233
- case type.to_sym
234
- when :DateTime
235
- DateTime.parse(value)
236
- when :Date
237
- Date.parse(value)
238
- when :String
239
- value.to_s
240
- when :Integer
241
- value.to_i
242
- when :Float
243
- value.to_f
244
- when :BOOLEAN
245
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
246
- true
247
- else
248
- false
249
- end
250
- when :Object
251
- # generic object (usually a Hash), return directly
252
- value
253
- when /\AArray<(?<inner_type>.+)>\z/
254
- inner_type = Regexp.last_match[:inner_type]
255
- value.map { |v| _deserialize(inner_type, v) }
256
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
257
- k_type = Regexp.last_match[:k_type]
258
- v_type = Regexp.last_match[:v_type]
259
- {}.tap do |hash|
260
- value.each do |k, v|
261
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
262
- end
263
- end
264
- else # model
265
- temp_model = Allq.const_get(type).new
266
- temp_model.build_from_hash(value)
267
- end
268
- end
269
-
270
- # Returns the string representation of the object
271
- # @return [String] String presentation of the object
272
- def to_s
273
- to_hash.to_s
274
- end
275
-
276
- # to_body is an alias to to_hash (backward compatibility)
277
- # @return [Hash] Returns the object in the form of hash
278
- def to_body
279
- to_hash
280
- end
281
-
282
- # Returns the object in the form of hash
283
- # @return [Hash] Returns the object in the form of hash
284
- def to_hash
285
- hash = {}
286
- self.class.attribute_map.each_pair do |attr, param|
287
- value = self.send(attr)
288
- next if value.nil?
289
- hash[param] = _to_hash(value)
290
- end
291
- hash
292
- end
293
-
294
- # Outputs non-array value in the form of hash
295
- # For object, use to_hash. Otherwise, just return the value
296
- # @param [Object] value Any valid value
297
- # @return [Hash] Returns the value in the form of hash
298
- def _to_hash(value)
299
- if value.is_a?(Array)
300
- value.compact.map { |v| _to_hash(v) }
301
- elsif value.is_a?(Hash)
302
- {}.tap do |hash|
303
- value.each { |k, v| hash[k] = _to_hash(v) }
304
- end
305
- elsif value.respond_to? :to_hash
306
- value.to_hash
307
- else
308
- value
309
- end
310
- end
311
- end
312
- end