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,204 +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
- # Individual Server Info
17
- class StatsInfo
18
- # Name of tube
19
- attr_accessor :tube_name
20
-
21
- attr_accessor :info
22
-
23
- # Attribute mapping from ruby-style variable name to JSON key.
24
- def self.attribute_map
25
- {
26
- :'tube_name' => :'tube_name',
27
- :'info' => :'info'
28
- }
29
- end
30
-
31
- # Attribute type mapping.
32
- def self.swagger_types
33
- {
34
- :'tube_name' => :'String',
35
- :'info' => :'StatsTube'
36
- }
37
- end
38
-
39
- # Initializes the object
40
- # @param [Hash] attributes Model attributes in the form of hash
41
- def initialize(attributes = {})
42
- return unless attributes.is_a?(Hash)
43
-
44
- # convert string to symbol for hash key
45
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
-
47
- if attributes.has_key?(:'tube_name')
48
- self.tube_name = attributes[:'tube_name']
49
- end
50
-
51
- if attributes.has_key?(:'info')
52
- self.info = attributes[:'info']
53
- end
54
- end
55
-
56
- # Show invalid properties with the reasons. Usually used together with valid?
57
- # @return Array for valid properties with the reasons
58
- def list_invalid_properties
59
- invalid_properties = Array.new
60
- if @tube_name.nil?
61
- invalid_properties.push('invalid value for "tube_name", tube_name cannot be nil.')
62
- end
63
-
64
- if @info.nil?
65
- invalid_properties.push('invalid value for "info", info cannot be nil.')
66
- end
67
-
68
- invalid_properties
69
- end
70
-
71
- # Check to see if the all the properties in the model are valid
72
- # @return true if the model is valid
73
- def valid?
74
- return false if @tube_name.nil?
75
- return false if @info.nil?
76
- true
77
- end
78
-
79
- # Checks equality by comparing each attribute.
80
- # @param [Object] Object to be compared
81
- def ==(o)
82
- return true if self.equal?(o)
83
- self.class == o.class &&
84
- tube_name == o.tube_name &&
85
- info == o.info
86
- end
87
-
88
- # @see the `==` method
89
- # @param [Object] Object to be compared
90
- def eql?(o)
91
- self == o
92
- end
93
-
94
- # Calculates hash code according to all attributes.
95
- # @return [Fixnum] Hash code
96
- def hash
97
- [tube_name, info].hash
98
- end
99
-
100
- # Builds the object from hash
101
- # @param [Hash] attributes Model attributes in the form of hash
102
- # @return [Object] Returns the model itself
103
- def build_from_hash(attributes)
104
- return nil unless attributes.is_a?(Hash)
105
- self.class.swagger_types.each_pair do |key, type|
106
- if type =~ /\AArray<(.*)>/i
107
- # check to ensure the input is an array given that the the attribute
108
- # is documented as an array but the input is not
109
- if attributes[self.class.attribute_map[key]].is_a?(Array)
110
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
111
- end
112
- elsif !attributes[self.class.attribute_map[key]].nil?
113
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
- end # or else data not found in attributes(hash), not an issue as the data can be optional
115
- end
116
-
117
- self
118
- end
119
-
120
- # Deserializes the data based on type
121
- # @param string type Data type
122
- # @param string value Value to be deserialized
123
- # @return [Object] Deserialized data
124
- def _deserialize(type, value)
125
- case type.to_sym
126
- when :DateTime
127
- DateTime.parse(value)
128
- when :Date
129
- Date.parse(value)
130
- when :String
131
- value.to_s
132
- when :Integer
133
- value.to_i
134
- when :Float
135
- value.to_f
136
- when :BOOLEAN
137
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
138
- true
139
- else
140
- false
141
- end
142
- when :Object
143
- # generic object (usually a Hash), return directly
144
- value
145
- when /\AArray<(?<inner_type>.+)>\z/
146
- inner_type = Regexp.last_match[:inner_type]
147
- value.map { |v| _deserialize(inner_type, v) }
148
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
149
- k_type = Regexp.last_match[:k_type]
150
- v_type = Regexp.last_match[:v_type]
151
- {}.tap do |hash|
152
- value.each do |k, v|
153
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
154
- end
155
- end
156
- else # model
157
- temp_model = Allq.const_get(type).new
158
- temp_model.build_from_hash(value)
159
- end
160
- end
161
-
162
- # Returns the string representation of the object
163
- # @return [String] String presentation of the object
164
- def to_s
165
- to_hash.to_s
166
- end
167
-
168
- # to_body is an alias to to_hash (backward compatibility)
169
- # @return [Hash] Returns the object in the form of hash
170
- def to_body
171
- to_hash
172
- end
173
-
174
- # Returns the object in the form of hash
175
- # @return [Hash] Returns the object in the form of hash
176
- def to_hash
177
- hash = {}
178
- self.class.attribute_map.each_pair do |attr, param|
179
- value = self.send(attr)
180
- next if value.nil?
181
- hash[param] = _to_hash(value)
182
- end
183
- hash
184
- end
185
-
186
- # Outputs non-array value in the form of hash
187
- # For object, use to_hash. Otherwise, just return the value
188
- # @param [Object] value Any valid value
189
- # @return [Hash] Returns the value in the form of hash
190
- def _to_hash(value)
191
- if value.is_a?(Array)
192
- value.compact.map { |v| _to_hash(v) }
193
- elsif value.is_a?(Hash)
194
- {}.tap do |hash|
195
- value.each { |k, v| hash[k] = _to_hash(v) }
196
- end
197
- elsif value.respond_to? :to_hash
198
- value.to_hash
199
- else
200
- value
201
- end
202
- end
203
- end
204
- end
@@ -1,254 +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.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.15
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module Allq
16
- # Stats result
17
- class StatsResults
18
- # ID of server
19
- attr_accessor :server_name
20
-
21
- # Array of server instances
22
- attr_accessor :stats
23
-
24
- # Total actions taken on server
25
- attr_accessor :action_count
26
-
27
- # Total puts to server
28
- attr_accessor :job_put
29
-
30
- # Total gets from server
31
- attr_accessor :job_get
32
-
33
- # Attribute mapping from ruby-style variable name to JSON key.
34
- def self.attribute_map
35
- {
36
- :'server_name' => :'server_name',
37
- :'stats' => :'stats',
38
- :'action_count' => :'action_count',
39
- :'job_put' => :'job_put',
40
- :'job_get' => :'job_get'
41
- }
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.swagger_types
46
- {
47
- :'server_name' => :'String',
48
- :'stats' => :'Array<StatsTube>',
49
- :'action_count' => :'Integer',
50
- :'job_put' => :'Integer',
51
- :'job_get' => :'Integer'
52
- }
53
- end
54
-
55
- # Initializes the object
56
- # @param [Hash] attributes Model attributes in the form of hash
57
- def initialize(attributes = {})
58
-
59
- return unless attributes.is_a?(Hash)
60
-
61
- # convert string to symbol for hash key
62
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
-
64
- if attributes.has_key?(:'server_name')
65
- self.server_name = attributes[:'server_name']
66
- end
67
-
68
- if attributes.has_key?(:'stats')
69
- if (value = attributes[:'stats']).is_a?(Array)
70
- self.stats = value
71
- end
72
- end
73
-
74
- if attributes.has_key?(:'action_count')
75
- self.action_count = attributes[:'action_count']
76
- end
77
-
78
- if attributes.has_key?(:'job_put')
79
- self.job_put = attributes[:'job_put']
80
- end
81
-
82
- if attributes.has_key?(:'job_get')
83
- self.job_get = attributes[:'job_get']
84
- end
85
- end
86
-
87
- # Show invalid properties with the reasons. Usually used together with valid?
88
- # @return Array for valid properties with the reasons
89
- def list_invalid_properties
90
- invalid_properties = Array.new
91
- if @server_name.nil?
92
- invalid_properties.push('invalid value for "server_name", server_name cannot be nil.')
93
- end
94
-
95
- if @stats.nil?
96
- invalid_properties.push('invalid value for "stats", stats cannot be nil.')
97
- end
98
-
99
- if @action_count.nil?
100
- invalid_properties.push('invalid value for "action_count", action_count cannot be nil.')
101
- end
102
-
103
- if @job_put.nil?
104
- invalid_properties.push('invalid value for "job_put", job_put cannot be nil.')
105
- end
106
-
107
- if @job_get.nil?
108
- invalid_properties.push('invalid value for "job_get", job_get cannot be nil.')
109
- end
110
-
111
- invalid_properties
112
- end
113
-
114
- # Check to see if the all the properties in the model are valid
115
- # @return true if the model is valid
116
- def valid?
117
- return false if @server_name.nil?
118
- return false if @stats.nil?
119
- return false if @action_count.nil?
120
- return false if @job_put.nil?
121
- return false if @job_get.nil?
122
- true
123
- end
124
-
125
- # Checks equality by comparing each attribute.
126
- # @param [Object] Object to be compared
127
- def ==(o)
128
- return true if self.equal?(o)
129
- self.class == o.class &&
130
- server_name == o.server_name &&
131
- stats == o.stats &&
132
- action_count == o.action_count &&
133
- job_put == o.job_put &&
134
- job_get == o.job_get
135
- end
136
-
137
- # @see the `==` method
138
- # @param [Object] Object to be compared
139
- def eql?(o)
140
- self == o
141
- end
142
-
143
- # Calculates hash code according to all attributes.
144
- # @return [Fixnum] Hash code
145
- def hash
146
- [server_name, stats, action_count, job_put, job_get].hash
147
- end
148
-
149
- # Builds the object from hash
150
- # @param [Hash] attributes Model attributes in the form of hash
151
- # @return [Object] Returns the model itself
152
- def build_from_hash(attributes)
153
- return nil unless attributes.is_a?(Hash)
154
- self.class.swagger_types.each_pair do |key, type|
155
- if type =~ /\AArray<(.*)>/i
156
- # check to ensure the input is an array given that the attribute
157
- # is documented as an array but the input is not
158
- if attributes[self.class.attribute_map[key]].is_a?(Array)
159
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
- end
161
- elsif !attributes[self.class.attribute_map[key]].nil?
162
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
- end # or else data not found in attributes(hash), not an issue as the data can be optional
164
- end
165
-
166
- self
167
- end
168
-
169
- # Deserializes the data based on type
170
- # @param string type Data type
171
- # @param string value Value to be deserialized
172
- # @return [Object] Deserialized data
173
- def _deserialize(type, value)
174
- case type.to_sym
175
- when :DateTime
176
- DateTime.parse(value)
177
- when :Date
178
- Date.parse(value)
179
- when :String
180
- value.to_s
181
- when :Integer
182
- value.to_i
183
- when :Float
184
- value.to_f
185
- when :BOOLEAN
186
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
- true
188
- else
189
- false
190
- end
191
- when :Object
192
- # generic object (usually a Hash), return directly
193
- value
194
- when /\AArray<(?<inner_type>.+)>\z/
195
- inner_type = Regexp.last_match[:inner_type]
196
- value.map { |v| _deserialize(inner_type, v) }
197
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
- k_type = Regexp.last_match[:k_type]
199
- v_type = Regexp.last_match[:v_type]
200
- {}.tap do |hash|
201
- value.each do |k, v|
202
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
- end
204
- end
205
- else # model
206
- temp_model = Allq.const_get(type).new
207
- temp_model.build_from_hash(value)
208
- end
209
- end
210
-
211
- # Returns the string representation of the object
212
- # @return [String] String presentation of the object
213
- def to_s
214
- to_hash.to_s
215
- end
216
-
217
- # to_body is an alias to to_hash (backward compatibility)
218
- # @return [Hash] Returns the object in the form of hash
219
- def to_body
220
- to_hash
221
- end
222
-
223
- # Returns the object in the form of hash
224
- # @return [Hash] Returns the object in the form of hash
225
- def to_hash
226
- hash = {}
227
- self.class.attribute_map.each_pair do |attr, param|
228
- value = self.send(attr)
229
- next if value.nil?
230
- hash[param] = _to_hash(value)
231
- end
232
- hash
233
- end
234
-
235
- # Outputs non-array value in the form of hash
236
- # For object, use to_hash. Otherwise, just return the value
237
- # @param [Object] value Any valid value
238
- # @return [Hash] Returns the value in the form of hash
239
- def _to_hash(value)
240
- if value.is_a?(Array)
241
- value.compact.map { |v| _to_hash(v) }
242
- elsif value.is_a?(Hash)
243
- {}.tap do |hash|
244
- value.each { |k, v| hash[k] = _to_hash(v) }
245
- end
246
- elsif value.respond_to? :to_hash
247
- value.to_hash
248
- else
249
- value
250
- end
251
- end
252
-
253
- end
254
- end