worker_ruby 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +118 -0
- data/VERSION +1 -0
- data/VERSION.txt +1 -0
- data/docs/Complete.md +10 -0
- data/docs/CoreApi.md +200 -0
- data/docs/Error.md +8 -0
- data/docs/ErrorBody.md +9 -0
- data/docs/Group.md +12 -0
- data/docs/GroupWrapper.md +8 -0
- data/docs/GroupsApi.md +197 -0
- data/docs/GroupsWrapper.md +8 -0
- data/docs/IdStatus.md +9 -0
- data/docs/Image.md +10 -0
- data/docs/ImageWrapper.md +8 -0
- data/docs/ImagesApi.md +98 -0
- data/docs/ImagesWrapper.md +8 -0
- data/docs/Job.md +25 -0
- data/docs/JobWrapper.md +8 -0
- data/docs/JobsApi.md +684 -0
- data/docs/JobsWrapper.md +10 -0
- data/docs/Log.md +8 -0
- data/docs/NewJob.md +14 -0
- data/docs/NewJobWithImage.md +15 -0
- data/docs/NewJobsWrapper.md +8 -0
- data/docs/NewTask.md +14 -0
- data/docs/NewTasksWrapper.md +8 -0
- data/docs/Reason.md +7 -0
- data/docs/RunnerApi.md +170 -0
- data/docs/Start.md +8 -0
- data/docs/Task.md +25 -0
- data/docs/TaskWrapper.md +8 -0
- data/docs/TasksApi.md +684 -0
- data/docs/TasksWrapper.md +10 -0
- data/git_push.sh +67 -0
- data/iron_ruby.gemspec +55 -0
- data/iron_titan.gemspec +32 -0
- data/lib/iron_ruby.rb +66 -0
- data/lib/iron_ruby/api/groups_api.rb +262 -0
- data/lib/iron_ruby/api/runner_api.rb +229 -0
- data/lib/iron_ruby/api/tasks_api.rb +842 -0
- data/lib/iron_ruby/api_client.rb +378 -0
- data/lib/iron_ruby/api_error.rb +47 -0
- data/lib/iron_ruby/configuration.rb +207 -0
- data/lib/iron_ruby/models/complete.rb +220 -0
- data/lib/iron_ruby/models/error.rb +199 -0
- data/lib/iron_ruby/models/error_body.rb +208 -0
- data/lib/iron_ruby/models/group.rb +242 -0
- data/lib/iron_ruby/models/group_wrapper.rb +200 -0
- data/lib/iron_ruby/models/groups_wrapper.rb +202 -0
- data/lib/iron_ruby/models/id_status.rb +243 -0
- data/lib/iron_ruby/models/new_task.rb +270 -0
- data/lib/iron_ruby/models/new_tasks_wrapper.rb +202 -0
- data/lib/iron_ruby/models/start.rb +200 -0
- data/lib/iron_ruby/models/task.rb +427 -0
- data/lib/iron_ruby/models/task_wrapper.rb +200 -0
- data/lib/iron_ruby/models/tasks_wrapper.rb +221 -0
- data/lib/iron_ruby/version.rb +26 -0
- data/lib/iron_titan.rb +66 -0
- data/lib/iron_titan/api/core_api.rb +260 -0
- data/lib/iron_titan/api/groups_api.rb +262 -0
- data/lib/iron_titan/api/images_api.rb +138 -0
- data/lib/iron_titan/api/jobs_api.rb +842 -0
- data/lib/iron_titan/api/runner_api.rb +229 -0
- data/lib/iron_titan/api_client.rb +372 -0
- data/lib/iron_titan/api_error.rb +47 -0
- data/lib/iron_titan/configuration.rb +186 -0
- data/lib/iron_titan/models/complete.rb +220 -0
- data/lib/iron_titan/models/error.rb +199 -0
- data/lib/iron_titan/models/error_body.rb +208 -0
- data/lib/iron_titan/models/group.rb +242 -0
- data/lib/iron_titan/models/group_wrapper.rb +200 -0
- data/lib/iron_titan/models/groups_wrapper.rb +202 -0
- data/lib/iron_titan/models/id_status.rb +243 -0
- data/lib/iron_titan/models/image.rb +184 -0
- data/lib/iron_titan/models/image_wrapper.rb +161 -0
- data/lib/iron_titan/models/images_wrapper.rb +163 -0
- data/lib/iron_titan/models/job.rb +427 -0
- data/lib/iron_titan/models/job_array.rb +160 -0
- data/lib/iron_titan/models/job_wrapper.rb +200 -0
- data/lib/iron_titan/models/jobs_wrapper.rb +221 -0
- data/lib/iron_titan/models/log.rb +161 -0
- data/lib/iron_titan/models/new_job.rb +270 -0
- data/lib/iron_titan/models/new_job_array.rb +160 -0
- data/lib/iron_titan/models/new_job_with_image.rb +249 -0
- data/lib/iron_titan/models/new_jobs_wrapper.rb +202 -0
- data/lib/iron_titan/models/reason.rb +164 -0
- data/lib/iron_titan/models/start.rb +200 -0
- data/lib/iron_titan/version.rb +26 -0
- data/lib/worker_ruby.rb +66 -0
- data/lib/worker_ruby/api/groups_api.rb +262 -0
- data/lib/worker_ruby/api/runner_api.rb +229 -0
- data/lib/worker_ruby/api/tasks_api.rb +842 -0
- data/lib/worker_ruby/api_client.rb +378 -0
- data/lib/worker_ruby/api_error.rb +47 -0
- data/lib/worker_ruby/configuration.rb +207 -0
- data/lib/worker_ruby/models/complete.rb +220 -0
- data/lib/worker_ruby/models/error.rb +199 -0
- data/lib/worker_ruby/models/error_body.rb +208 -0
- data/lib/worker_ruby/models/group.rb +242 -0
- data/lib/worker_ruby/models/group_wrapper.rb +200 -0
- data/lib/worker_ruby/models/groups_wrapper.rb +202 -0
- data/lib/worker_ruby/models/id_status.rb +243 -0
- data/lib/worker_ruby/models/new_task.rb +270 -0
- data/lib/worker_ruby/models/new_tasks_wrapper.rb +202 -0
- data/lib/worker_ruby/models/start.rb +200 -0
- data/lib/worker_ruby/models/task.rb +427 -0
- data/lib/worker_ruby/models/task_wrapper.rb +200 -0
- data/lib/worker_ruby/models/tasks_wrapper.rb +221 -0
- data/lib/worker_ruby/version.rb +26 -0
- data/spec/api/CoreApi_spec.rb +99 -0
- data/spec/api/JobsApi_spec.rb +131 -0
- data/spec/api/core_api_spec.rb +99 -0
- data/spec/api/groups_api_spec.rb +94 -0
- data/spec/api/images_api_spec.rb +66 -0
- data/spec/api/jobs_api_spec.rb +220 -0
- data/spec/api/runner_api_spec.rb +88 -0
- data/spec/api/tasks_api_spec.rb +220 -0
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/models/ErrorBody_spec.rb +56 -0
- data/spec/models/JobArray_spec.rb +46 -0
- data/spec/models/JobWrapper_spec.rb +46 -0
- data/spec/models/NewJobArray_spec.rb +46 -0
- data/spec/models/NewJob_spec.rb +96 -0
- data/spec/models/complete_spec.rb +65 -0
- data/spec/models/error_body_spec.rb +59 -0
- data/spec/models/error_spec.rb +53 -0
- data/spec/models/group_spec.rb +77 -0
- data/spec/models/group_wrapper_spec.rb +53 -0
- data/spec/models/groups_wrapper_spec.rb +53 -0
- data/spec/models/id_status_spec.rb +63 -0
- data/spec/models/image_spec.rb +66 -0
- data/spec/models/image_wrapper_spec.rb +46 -0
- data/spec/models/images_wrapper_spec.rb +46 -0
- data/spec/models/job_array_spec.rb +46 -0
- data/spec/models/job_spec.rb +161 -0
- data/spec/models/job_wrapper_spec.rb +53 -0
- data/spec/models/jobs_wrapper_spec.rb +65 -0
- data/spec/models/log_spec.rb +46 -0
- data/spec/models/new_job_array_spec.rb +46 -0
- data/spec/models/new_job_spec.rb +89 -0
- data/spec/models/new_job_with_image_spec.rb +116 -0
- data/spec/models/new_jobs_wrapper_spec.rb +53 -0
- data/spec/models/new_task_spec.rb +89 -0
- data/spec/models/new_tasks_wrapper_spec.rb +53 -0
- data/spec/models/reason_spec.rb +36 -0
- data/spec/models/start_spec.rb +53 -0
- data/spec/models/task_spec.rb +163 -0
- data/spec/models/task_wrapper_spec.rb +53 -0
- data/spec/models/tasks_wrapper_spec.rb +65 -0
- data/spec/spec_helper.rb +122 -0
- data/worker_ruby-0.5.5.gem +0 -0
- data/worker_ruby.gemspec +55 -0
- metadata +420 -0
@@ -0,0 +1,200 @@
|
|
1
|
+
=begin
|
2
|
+
#IronWorker CE API
|
3
|
+
|
4
|
+
#The ultimate, language agnostic, container based task processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.5.7
|
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 IronWorker
|
27
|
+
|
28
|
+
class TaskWrapper
|
29
|
+
attr_accessor :task
|
30
|
+
|
31
|
+
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:'task' => :'task'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
:'task' => :'Task'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
53
|
+
|
54
|
+
if attributes.has_key?(:'task')
|
55
|
+
self.task = attributes[:'task']
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
+
# @return Array for valid properies with the reasons
|
62
|
+
def list_invalid_properties
|
63
|
+
invalid_properties = Array.new
|
64
|
+
return invalid_properties
|
65
|
+
end
|
66
|
+
|
67
|
+
# Check to see if the all the properties in the model are valid
|
68
|
+
# @return true if the model is valid
|
69
|
+
def valid?
|
70
|
+
return false if @task.nil?
|
71
|
+
return true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
task == o.task
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Fixnum] Hash code
|
90
|
+
def hash
|
91
|
+
[task].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
self.class.swagger_types.each_pair do |key, type|
|
100
|
+
if type =~ /^Array<(.*)>/i
|
101
|
+
# check to ensure the input is an array given that the the attribute
|
102
|
+
# is documented as an array but the input is not
|
103
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
104
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
105
|
+
end
|
106
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
107
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
108
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
109
|
+
end
|
110
|
+
|
111
|
+
self
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
# @param string type Data type
|
116
|
+
# @param string value Value to be deserialized
|
117
|
+
# @return [Object] Deserialized data
|
118
|
+
def _deserialize(type, value)
|
119
|
+
case type.to_sym
|
120
|
+
when :DateTime
|
121
|
+
DateTime.parse(value)
|
122
|
+
when :Date
|
123
|
+
Date.parse(value)
|
124
|
+
when :String
|
125
|
+
value.to_s
|
126
|
+
when :Integer
|
127
|
+
value.to_i
|
128
|
+
when :Float
|
129
|
+
value.to_f
|
130
|
+
when :BOOLEAN
|
131
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
132
|
+
true
|
133
|
+
else
|
134
|
+
false
|
135
|
+
end
|
136
|
+
when :Object
|
137
|
+
# generic object (usually a Hash), return directly
|
138
|
+
value
|
139
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
140
|
+
inner_type = Regexp.last_match[:inner_type]
|
141
|
+
value.map { |v| _deserialize(inner_type, v) }
|
142
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
143
|
+
k_type = Regexp.last_match[:k_type]
|
144
|
+
v_type = Regexp.last_match[:v_type]
|
145
|
+
{}.tap do |hash|
|
146
|
+
value.each do |k, v|
|
147
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else # model
|
151
|
+
temp_model = IronWorker.const_get(type).new
|
152
|
+
temp_model.build_from_hash(value)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the string representation of the object
|
157
|
+
# @return [String] String presentation of the object
|
158
|
+
def to_s
|
159
|
+
to_hash.to_s
|
160
|
+
end
|
161
|
+
|
162
|
+
# to_body is an alias to to_hash (backward compatibility)
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_body
|
165
|
+
to_hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the object in the form of hash
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_hash
|
171
|
+
hash = {}
|
172
|
+
self.class.attribute_map.each_pair do |attr, param|
|
173
|
+
value = self.send(attr)
|
174
|
+
next if value.nil?
|
175
|
+
hash[param] = _to_hash(value)
|
176
|
+
end
|
177
|
+
hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Outputs non-array value in the form of hash
|
181
|
+
# For object, use to_hash. Otherwise, just return the value
|
182
|
+
# @param [Object] value Any valid value
|
183
|
+
# @return [Hash] Returns the value in the form of hash
|
184
|
+
def _to_hash(value)
|
185
|
+
if value.is_a?(Array)
|
186
|
+
value.compact.map{ |v| _to_hash(v) }
|
187
|
+
elsif value.is_a?(Hash)
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
190
|
+
end
|
191
|
+
elsif value.respond_to? :to_hash
|
192
|
+
value.to_hash
|
193
|
+
else
|
194
|
+
value
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
@@ -0,0 +1,221 @@
|
|
1
|
+
=begin
|
2
|
+
#IronWorker CE API
|
3
|
+
|
4
|
+
#The ultimate, language agnostic, container based task processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.5.7
|
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 IronWorker
|
27
|
+
|
28
|
+
class TasksWrapper
|
29
|
+
attr_accessor :tasks
|
30
|
+
|
31
|
+
# Used to paginate results. If this is returned, pass it into the same query again to get more results.
|
32
|
+
attr_accessor :cursor
|
33
|
+
|
34
|
+
attr_accessor :error
|
35
|
+
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'tasks' => :'tasks',
|
41
|
+
:'cursor' => :'cursor',
|
42
|
+
:'error' => :'error'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.swagger_types
|
48
|
+
{
|
49
|
+
:'tasks' => :'Array<Task>',
|
50
|
+
:'cursor' => :'String',
|
51
|
+
:'error' => :'ErrorBody'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
62
|
+
|
63
|
+
if attributes.has_key?(:'tasks')
|
64
|
+
if (value = attributes[:'tasks']).is_a?(Array)
|
65
|
+
self.tasks = value
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'cursor')
|
70
|
+
self.cursor = attributes[:'cursor']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'error')
|
74
|
+
self.error = attributes[:'error']
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properies with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
return invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
return false if @tasks.nil?
|
90
|
+
return true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
tasks == o.tasks &&
|
99
|
+
cursor == o.cursor &&
|
100
|
+
error == o.error
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Fixnum] Hash code
|
111
|
+
def hash
|
112
|
+
[tasks, cursor, error].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
120
|
+
self.class.swagger_types.each_pair do |key, type|
|
121
|
+
if type =~ /^Array<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
126
|
+
end
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
# Deserializes the data based on type
|
136
|
+
# @param string type Data type
|
137
|
+
# @param string value Value to be deserialized
|
138
|
+
# @return [Object] Deserialized data
|
139
|
+
def _deserialize(type, value)
|
140
|
+
case type.to_sym
|
141
|
+
when :DateTime
|
142
|
+
DateTime.parse(value)
|
143
|
+
when :Date
|
144
|
+
Date.parse(value)
|
145
|
+
when :String
|
146
|
+
value.to_s
|
147
|
+
when :Integer
|
148
|
+
value.to_i
|
149
|
+
when :Float
|
150
|
+
value.to_f
|
151
|
+
when :BOOLEAN
|
152
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
153
|
+
true
|
154
|
+
else
|
155
|
+
false
|
156
|
+
end
|
157
|
+
when :Object
|
158
|
+
# generic object (usually a Hash), return directly
|
159
|
+
value
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
163
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each do |k, v|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else # model
|
172
|
+
temp_model = IronWorker.const_get(type).new
|
173
|
+
temp_model.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
next if value.nil?
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map{ |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
=begin
|
2
|
+
#IronWorker CE API
|
3
|
+
|
4
|
+
#The ultimate, language agnostic, container based task processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.5.7
|
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
|
+
module IronWorker
|
25
|
+
VERSION = "0.5.7"
|
26
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
=begin
|
2
|
+
Titan API
|
3
|
+
|
4
|
+
The ultimate, language agnostic, container based job processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for IronTitan::CoreApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'CoreApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = IronTitan::CoreApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of CoreApi' do
|
30
|
+
it 'should create an instact of CoreApi' do
|
31
|
+
@instance.should be_a(IronTitan::CoreApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for job_id_get
|
36
|
+
# Gets job by id
|
37
|
+
# Gets a job by id.
|
38
|
+
# @param id Job id
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [JobWrapper]
|
41
|
+
describe 'job_id_get test' do
|
42
|
+
it "should work" do
|
43
|
+
# assertion here
|
44
|
+
# should be_a()
|
45
|
+
# should be_nil
|
46
|
+
# should ==
|
47
|
+
# should_not ==
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# unit tests for job_id_patch
|
52
|
+
# Update a job
|
53
|
+
# Typically used to update status on error/completion. TODO: only allow 'status' field.
|
54
|
+
# @param id Job id
|
55
|
+
# @param body Job data to post
|
56
|
+
# @param [Hash] opts the optional parameters
|
57
|
+
# @return [JobWrapper]
|
58
|
+
describe 'job_id_patch test' do
|
59
|
+
it "should work" do
|
60
|
+
# assertion here
|
61
|
+
# should be_a()
|
62
|
+
# should be_nil
|
63
|
+
# should ==
|
64
|
+
# should_not ==
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# unit tests for jobs_get
|
69
|
+
# Get next job.
|
70
|
+
# Gets the next job in the queue, ready for processing.
|
71
|
+
# @param [Hash] opts the optional parameters
|
72
|
+
# @return [Array<JobArray>]
|
73
|
+
describe 'jobs_get test' do
|
74
|
+
it "should work" do
|
75
|
+
# assertion here
|
76
|
+
# should be_a()
|
77
|
+
# should be_nil
|
78
|
+
# should ==
|
79
|
+
# should_not ==
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# unit tests for jobs_post
|
84
|
+
# Enqueue Job
|
85
|
+
# Enqueues a job.
|
86
|
+
# @param body Array of jobs to post.
|
87
|
+
# @param [Hash] opts the optional parameters
|
88
|
+
# @return [JobArray]
|
89
|
+
describe 'jobs_post test' do
|
90
|
+
it "should work" do
|
91
|
+
# assertion here
|
92
|
+
# should be_a()
|
93
|
+
# should be_nil
|
94
|
+
# should ==
|
95
|
+
# should_not ==
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|