allq_client 1.0.0 → 1.1.1

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