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