Class: TemplateFox::JobStatusResponse
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- TemplateFox::JobStatusResponse
- Defined in:
- lib/templatefox/models/job_status_response.rb
Overview
Response for job status query
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#created_at ⇒ Object
Job creation timestamp (ISO 8601).
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#export_type ⇒ Object
Export type (url).
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#id ⇒ Object
Job ID.
-
#result_expires_at ⇒ Object
Returns the value of attribute result_expires_at.
-
#result_filename ⇒ Object
Returns the value of attribute result_filename.
-
#result_s3_bucket ⇒ Object
Returns the value of attribute result_s3_bucket.
-
#result_s3_key ⇒ Object
Returns the value of attribute result_s3_key.
-
#result_url ⇒ Object
Returns the value of attribute result_url.
-
#status ⇒ Object
Current job status.
-
#store_s3 ⇒ Object
Whether S3 storage was requested.
-
#template_id ⇒ Object
Template used for generation.
-
#updated_at ⇒ Object
Last update timestamp (ISO 8601).
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ JobStatusResponse
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ JobStatusResponse
Initializes the object
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/templatefox/models/job_status_response.rb', line 151 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::JobStatusResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::JobStatusResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'template_id') self.template_id = attributes[:'template_id'] else self.template_id = nil end if attributes.key?(:'export_type') self.export_type = attributes[:'export_type'] else self.export_type = nil end if attributes.key?(:'filename') self.filename = attributes[:'filename'] end if attributes.key?(:'store_s3') self.store_s3 = attributes[:'store_s3'] else self.store_s3 = nil end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] else self.created_at = nil end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] else self.updated_at = nil end if attributes.key?(:'completed_at') self.completed_at = attributes[:'completed_at'] end if attributes.key?(:'result_url') self.result_url = attributes[:'result_url'] end if attributes.key?(:'result_filename') self.result_filename = attributes[:'result_filename'] end if attributes.key?(:'result_expires_at') self.result_expires_at = attributes[:'result_expires_at'] end if attributes.key?(:'result_s3_bucket') self.result_s3_bucket = attributes[:'result_s3_bucket'] end if attributes.key?(:'result_s3_key') self.result_s3_key = attributes[:'result_s3_key'] end if attributes.key?(:'error_message') self. = attributes[:'error_message'] end if attributes.key?(:'error_code') self.error_code = attributes[:'error_code'] end end |
Instance Attribute Details
#completed_at ⇒ Object
Returns the value of attribute completed_at.
42 43 44 |
# File 'lib/templatefox/models/job_status_response.rb', line 42 def completed_at @completed_at end |
#created_at ⇒ Object
Job creation timestamp (ISO 8601)
37 38 39 |
# File 'lib/templatefox/models/job_status_response.rb', line 37 def created_at @created_at end |
#error_code ⇒ Object
Returns the value of attribute error_code.
56 57 58 |
# File 'lib/templatefox/models/job_status_response.rb', line 56 def error_code @error_code end |
#error_message ⇒ Object
Returns the value of attribute error_message.
54 55 56 |
# File 'lib/templatefox/models/job_status_response.rb', line 54 def @error_message end |
#export_type ⇒ Object
Export type (url)
29 30 31 |
# File 'lib/templatefox/models/job_status_response.rb', line 29 def export_type @export_type end |
#filename ⇒ Object
Returns the value of attribute filename.
31 32 33 |
# File 'lib/templatefox/models/job_status_response.rb', line 31 def filename @filename end |
#id ⇒ Object
Job ID
20 21 22 |
# File 'lib/templatefox/models/job_status_response.rb', line 20 def id @id end |
#result_expires_at ⇒ Object
Returns the value of attribute result_expires_at.
48 49 50 |
# File 'lib/templatefox/models/job_status_response.rb', line 48 def result_expires_at @result_expires_at end |
#result_filename ⇒ Object
Returns the value of attribute result_filename.
46 47 48 |
# File 'lib/templatefox/models/job_status_response.rb', line 46 def result_filename @result_filename end |
#result_s3_bucket ⇒ Object
Returns the value of attribute result_s3_bucket.
50 51 52 |
# File 'lib/templatefox/models/job_status_response.rb', line 50 def result_s3_bucket @result_s3_bucket end |
#result_s3_key ⇒ Object
Returns the value of attribute result_s3_key.
52 53 54 |
# File 'lib/templatefox/models/job_status_response.rb', line 52 def result_s3_key @result_s3_key end |
#result_url ⇒ Object
Returns the value of attribute result_url.
44 45 46 |
# File 'lib/templatefox/models/job_status_response.rb', line 44 def result_url @result_url end |
#status ⇒ Object
Current job status
23 24 25 |
# File 'lib/templatefox/models/job_status_response.rb', line 23 def status @status end |
#store_s3 ⇒ Object
Whether S3 storage was requested
34 35 36 |
# File 'lib/templatefox/models/job_status_response.rb', line 34 def store_s3 @store_s3 end |
#template_id ⇒ Object
Template used for generation
26 27 28 |
# File 'lib/templatefox/models/job_status_response.rb', line 26 def template_id @template_id end |
#updated_at ⇒ Object
Last update timestamp (ISO 8601)
40 41 42 |
# File 'lib/templatefox/models/job_status_response.rb', line 40 def updated_at @updated_at end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
103 104 105 |
# File 'lib/templatefox/models/job_status_response.rb', line 103 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
108 109 110 |
# File 'lib/templatefox/models/job_status_response.rb', line 108 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/templatefox/models/job_status_response.rb', line 81 def self.attribute_map { :'id' => :'id', :'status' => :'status', :'template_id' => :'template_id', :'export_type' => :'export_type', :'filename' => :'filename', :'store_s3' => :'store_s3', :'created_at' => :'created_at', :'updated_at' => :'updated_at', :'completed_at' => :'completed_at', :'result_url' => :'result_url', :'result_filename' => :'result_filename', :'result_expires_at' => :'result_expires_at', :'result_s3_bucket' => :'result_s3_bucket', :'result_s3_key' => :'result_s3_key', :'error_message' => :'error_message', :'error_code' => :'error_code' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/templatefox/models/job_status_response.rb', line 402 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/templatefox/models/job_status_response.rb', line 135 def self.openapi_nullable Set.new([ :'filename', :'completed_at', :'result_url', :'result_filename', :'result_expires_at', :'result_s3_bucket', :'result_s3_key', :'error_message', :'error_code' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/templatefox/models/job_status_response.rb', line 113 def self.openapi_types { :'id' => :'String', :'status' => :'JobStatus', :'template_id' => :'String', :'export_type' => :'String', :'filename' => :'String', :'store_s3' => :'Boolean', :'created_at' => :'String', :'updated_at' => :'String', :'completed_at' => :'String', :'result_url' => :'String', :'result_filename' => :'String', :'result_expires_at' => :'String', :'result_s3_bucket' => :'String', :'result_s3_key' => :'String', :'error_message' => :'String', :'error_code' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/templatefox/models/job_status_response.rb', line 366 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && status == o.status && template_id == o.template_id && export_type == o.export_type && filename == o.filename && store_s3 == o.store_s3 && created_at == o.created_at && updated_at == o.updated_at && completed_at == o.completed_at && result_url == o.result_url && result_filename == o.result_filename && result_expires_at == o.result_expires_at && result_s3_bucket == o.result_s3_bucket && result_s3_key == o.result_s3_key && == o. && error_code == o.error_code end |
#eql?(o) ⇒ Boolean
389 390 391 |
# File 'lib/templatefox/models/job_status_response.rb', line 389 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
395 396 397 |
# File 'lib/templatefox/models/job_status_response.rb', line 395 def hash [id, status, template_id, export_type, filename, store_s3, created_at, updated_at, completed_at, result_url, result_filename, result_expires_at, result_s3_bucket, result_s3_key, , error_code].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/templatefox/models/job_status_response.rb', line 246 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @template_id.nil? invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') end if @export_type.nil? invalid_properties.push('invalid value for "export_type", export_type cannot be nil.') end if @store_s3.nil? invalid_properties.push('invalid value for "store_s3", store_s3 cannot be nil.') end if @created_at.nil? invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end if @updated_at.nil? invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
424 425 426 427 428 429 430 431 432 433 434 435 436 |
# File 'lib/templatefox/models/job_status_response.rb', line 424 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/templatefox/models/job_status_response.rb', line 282 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @status.nil? return false if @template_id.nil? return false if @export_type.nil? return false if @store_s3.nil? return false if @created_at.nil? return false if @updated_at.nil? true end |