lib/iron_titan/models/job.rb in iron_titan-0.0.3 vs lib/iron_titan/models/job.rb in iron_titan-0.0.4

- old
+ new

@@ -1,11 +1,11 @@ =begin Titan API The ultimate, language agnostic, container based job processing framework. -OpenAPI spec version: 0.0.3 +OpenAPI spec version: 0.0.4 Generated by: https://github.com/swagger-api/swagger-codegen.git =end @@ -15,10 +15,22 @@ module IronTitan class Job # Docker image to use for job. attr_accessor :image + # Time when job was submitted. + attr_accessor :created_at + + # Priority of the job. 3 levels from 0-2. Default 0. + attr_accessor :priority + + # Сorresponding error message, only when status=='error'. + attr_accessor :error + + # Maximum runtime in seconds. If job runs for longer, it will be killed. Default 60 seconds. + attr_accessor :timeout + # Number of retries. Default 3. attr_accessor :retries # Time when job completed, whether it was successul or failed. attr_accessor :completed_at @@ -30,73 +42,67 @@ attr_accessor :payload # Docker image to use for job. Default is 'image' attr_accessor :name - # Time when job was submitted. - attr_accessor :created_at - # Time when job started execution. attr_accessor :started_at # Unique identifier representing a specific job. attr_accessor :id - # Сorresponding error message, only when status=='error'. - attr_accessor :error - - # Maximum runtime in seconds. If job runs for longer, it will be killed. Default 60 seconds. - attr_accessor :timeout - # Status of job. One of: [pending, running, success, error, timeout] attr_accessor :status # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'image' => :'image', + :'created_at' => :'created_at', + + :'priority' => :'priority', + + :'error' => :'error', + + :'timeout' => :'timeout', + :'retries' => :'retries', :'completed_at' => :'completed_at', :'delay' => :'delay', :'payload' => :'payload', :'name' => :'name', - :'created_at' => :'created_at', - :'started_at' => :'started_at', :'id' => :'id', - :'error' => :'error', - - :'timeout' => :'timeout', - :'status' => :'status' } end # Attribute type mapping. def self.swagger_types { :'image' => :'String', + :'created_at' => :'DateTime', + :'priority' => :'Integer', + :'error' => :'String', + :'timeout' => :'Integer', :'retries' => :'Integer', :'completed_at' => :'DateTime', :'delay' => :'Integer', :'payload' => :'String', :'name' => :'String', - :'created_at' => :'DateTime', :'started_at' => :'DateTime', :'id' => :'String', - :'error' => :'String', - :'timeout' => :'Integer', :'status' => :'String' } end @@ -109,52 +115,54 @@ if attributes[:'image'] self.image = attributes[:'image'] end + if attributes[:'created_at'] + self.created_at = attributes[:'created_at'] + end + + if attributes[:'priority'] + self.priority = attributes[:'priority'] + end + + if attributes[:'error'] + self.error = attributes[:'error'] + end + + if attributes[:'timeout'] + self.timeout = attributes[:'timeout'] + end + if attributes[:'retries'] self.retries = attributes[:'retries'] end if attributes[:'completed_at'] self.completed_at = attributes[:'completed_at'] end if attributes[:'delay'] self.delay = attributes[:'delay'] - else - self.delay = 0 end if attributes[:'payload'] self.payload = attributes[:'payload'] end if attributes[:'name'] self.name = attributes[:'name'] end - if attributes[:'created_at'] - self.created_at = attributes[:'created_at'] - end - if attributes[:'started_at'] self.started_at = attributes[:'started_at'] end if attributes[:'id'] self.id = attributes[:'id'] end - if attributes[:'error'] - self.error = attributes[:'error'] - end - - if attributes[:'timeout'] - self.timeout = attributes[:'timeout'] - end - if attributes[:'status'] self.status = attributes[:'status'] end end @@ -162,30 +170,31 @@ # Check equality by comparing each attribute. def ==(o) return true if self.equal?(o) self.class == o.class && image == o.image && + created_at == o.created_at && + priority == o.priority && + error == o.error && + timeout == o.timeout && retries == o.retries && completed_at == o.completed_at && delay == o.delay && payload == o.payload && name == o.name && - created_at == o.created_at && started_at == o.started_at && id == o.id && - error == o.error && - timeout == o.timeout && status == o.status end # @see the `==` method def eql?(o) self == o end # Calculate hash code according to all attributes. def hash - [image, retries, completed_at, delay, payload, name, created_at, started_at, id, error, timeout, status].hash + [image, created_at, priority, error, timeout, retries, completed_at, delay, payload, name, started_at, id, status].hash end # build the object from hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash)