class AsposeSlidesCloud::Operation

Attributes

canceled[RW]
created[RW]
error[RW]
failed[RW]
finished[RW]
id[RW]
method[RW]
progress[RW]
started[RW]
status[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/aspose_slides_cloud/models/operation.rb, line 48
def self.attribute_map
  {
    :'id' => :'Id',
    :'method' => :'Method',
    :'status' => :'Status',
    :'progress' => :'Progress',
    :'created' => :'Created',
    :'started' => :'Started',
    :'failed' => :'Failed',
    :'canceled' => :'Canceled',
    :'finished' => :'Finished',
    :'error' => :'Error',
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/aspose_slides_cloud/models/operation.rb, line 81
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'Id')
    self.id = attributes[:'Id']
  end

  if attributes.has_key?(:'Method')
    self.method = attributes[:'Method']
  end

  if attributes.has_key?(:'Status')
    self.status = attributes[:'Status']
  end

  if attributes.has_key?(:'Progress')
    self.progress = attributes[:'Progress']
  end

  if attributes.has_key?(:'Created')
    self.created = attributes[:'Created']
  end

  if attributes.has_key?(:'Started')
    self.started = attributes[:'Started']
  end

  if attributes.has_key?(:'Failed')
    self.failed = attributes[:'Failed']
  end

  if attributes.has_key?(:'Canceled')
    self.canceled = attributes[:'Canceled']
  end

  if attributes.has_key?(:'Finished')
    self.finished = attributes[:'Finished']
  end

  if attributes.has_key?(:'Error')
    self.error = attributes[:'Error']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/aspose_slides_cloud/models/operation.rb, line 64
def self.swagger_types
  {
    :'id' => :'String',
    :'method' => :'String',
    :'status' => :'String',
    :'progress' => :'OperationProgress',
    :'created' => :'DateTime',
    :'started' => :'DateTime',
    :'failed' => :'DateTime',
    :'canceled' => :'DateTime',
    :'finished' => :'DateTime',
    :'error' => :'OperationError',
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/aspose_slides_cloud/models/operation.rb, line 182
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      method == o.method &&
      status == o.status &&
      progress == o.progress &&
      created == o.created &&
      started == o.started &&
      failed == o.failed &&
      canceled == o.canceled &&
      finished == o.finished &&
      error == o.error
end
eql?(o) click to toggle source

@see the ‘==` method @param [Object] Object to be compared

# File lib/aspose_slides_cloud/models/operation.rb, line 199
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/aspose_slides_cloud/models/operation.rb, line 205
def hash
  [id, method, status, progress, created, started, failed, canceled, finished, error].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/aspose_slides_cloud/models/operation.rb, line 130
def list_invalid_properties
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @method.nil?
    invalid_properties.push('invalid value for "method", method cannot be nil.')
  end

  if @status.nil?
    invalid_properties.push('invalid value for "status", status cannot be nil.')
  end

  invalid_properties
end
method=(method) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] method Object to be assigned

# File lib/aspose_slides_cloud/models/operation.rb, line 162
def method=(method)
  validator = EnumAttributeValidator.new('String', ['Convert', 'DownloadPresentation', 'ConvertAndSave', 'SavePresentation', 'Merge', 'MergeAndSave', 'Split', 'UploadAndSplit'])
  unless validator.valid?(method)
    fail ArgumentError, 'invalid value for "method", must be one of #{validator.allowable_values}.'
  end
  @method = method
end
status=(status) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned

# File lib/aspose_slides_cloud/models/operation.rb, line 172
def status=(status)
  validator = EnumAttributeValidator.new('String', ['Created', 'Enqueued', 'Started', 'Failed', 'Canceled', 'Finished'])
  unless validator.valid?(status)
    fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
  end
  @status = status
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/aspose_slides_cloud/models/operation.rb, line 149
def valid?
  return false if @id.nil?
  return false if @method.nil?
  method_validator = EnumAttributeValidator.new('String', ['Convert', 'DownloadPresentation', 'ConvertAndSave', 'SavePresentation', 'Merge', 'MergeAndSave', 'Split', 'UploadAndSplit'])
  return false unless method_validator.valid?(@method)
  return false if @status.nil?
  status_validator = EnumAttributeValidator.new('String', ['Created', 'Enqueued', 'Started', 'Failed', 'Canceled', 'Finished'])
  return false unless status_validator.valid?(@status)
  true
end