lib/iron_titan/models/job.rb in iron_titan-0.3.1 vs lib/iron_titan/models/job.rb in iron_titan-0.3.7

- old
+ new

@@ -1,11 +1,11 @@ =begin Titan API The ultimate, language agnostic, container based job processing framework. -OpenAPI spec version: 0.3.2 +OpenAPI spec version: 0.3.7 Generated by: https://github.com/swagger-api/swagger-codegen.git =end @@ -42,10 +42,14 @@ attr_accessor :status # Group this job belongs to. attr_accessor :group_name + # The error message, if status is 'error'. This is errors due to things outside the job itself. Errors from user code will be found in the log. + attr_accessor :error + + # Machine usable reason for job being in this state.\nValid values for error status are `timeout | killed | bad_exit`.\nValid values for cancelled status are `client_request`.\nFor everything else, this is undefined.\n attr_accessor :reason # Time when job was submitted. Always in UTC. attr_accessor :created_at @@ -57,11 +61,11 @@ # If this field is set, then this job is a retry of the ID in this field. attr_accessor :retry_of # If this field is set, then this job was retried by the job referenced in this field. - attr_accessor :retry_id + attr_accessor :retry_at # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -83,21 +87,23 @@ :'status' => :'status', :'group_name' => :'group_name', + :'error' => :'error', + :'reason' => :'reason', :'created_at' => :'created_at', :'started_at' => :'started_at', :'completed_at' => :'completed_at', :'retry_of' => :'retry_of', - :'retry_id' => :'retry_id' + :'retry_at' => :'retry_at' } end # Attribute type mapping. @@ -111,16 +117,17 @@ :'max_retries' => :'Integer', :'retries_delay' => :'Integer', :'id' => :'String', :'status' => :'String', :'group_name' => :'String', - :'reason' => :'Reason', + :'error' => :'String', + :'reason' => :'String', :'created_at' => :'DateTime', :'started_at' => :'DateTime', :'completed_at' => :'DateTime', :'retry_of' => :'String', - :'retry_id' => :'String' + :'retry_at' => :'String' } end def initialize(attributes = {}) @@ -150,18 +157,16 @@ self.timeout = 60 end if attributes[:'priority'] self.priority = attributes[:'priority'] - else - self.priority = 0 end if attributes[:'max_retries'] self.max_retries = attributes[:'max_retries'] else - self.max_retries = 3 + self.max_retries = 0 end if attributes[:'retries_delay'] self.retries_delay = attributes[:'retries_delay'] else @@ -178,10 +183,14 @@ if attributes[:'group_name'] self.group_name = attributes[:'group_name'] end + if attributes[:'error'] + self.error = attributes[:'error'] + end + if attributes[:'reason'] self.reason = attributes[:'reason'] end if attributes[:'created_at'] @@ -198,12 +207,12 @@ if attributes[:'retry_of'] self.retry_of = attributes[:'retry_of'] end - if attributes[:'retry_id'] - self.retry_id = attributes[:'retry_id'] + if attributes[:'retry_at'] + self.retry_at = attributes[:'retry_at'] end end # Custom attribute writer method checking allowed values (enum). @@ -213,10 +222,19 @@ fail "invalid value for 'status', must be one of #{allowed_values}" end @status = status end + # Custom attribute writer method checking allowed values (enum). + def reason=(reason) + allowed_values = ["timeout", "killed", "bad_exit", "client_request"] + if reason && !allowed_values.include?(reason) + fail "invalid value for 'reason', must be one of #{allowed_values}" + end + @reason = reason + end + # Check equality by comparing each attribute. def ==(o) return true if self.equal?(o) self.class == o.class && image == o.image && @@ -227,25 +245,26 @@ max_retries == o.max_retries && retries_delay == o.retries_delay && id == o.id && status == o.status && group_name == o.group_name && + error == o.error && reason == o.reason && created_at == o.created_at && started_at == o.started_at && completed_at == o.completed_at && retry_of == o.retry_of && - retry_id == o.retry_id + retry_at == o.retry_at end # @see the `==` method def eql?(o) self == o end # Calculate hash code according to all attributes. def hash - [image, payload, delay, timeout, priority, max_retries, retries_delay, id, status, group_name, reason, created_at, started_at, completed_at, retry_of, retry_id].hash + [image, payload, delay, timeout, priority, max_retries, retries_delay, id, status, group_name, error, reason, created_at, started_at, completed_at, retry_of, retry_at].hash end # build the object from hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash)