class EmassClient::WorkflowInstancesGet

Attributes

created_date[RW]
Read-Only

Date the workflow instance or the workflow transition was created.

current_stage[RW]
Read-Only

Name of the current stage.

last_edited_by[RW]
Read-Only

User that last acted on the workflow.

last_edited_date[RW]
Read-Only

Date the workflow was last acted on.

package_name[RW]
Read-Only

The package name.

system_name[RW]
Read-Only

The system name.

transitions[RW]
version[RW]
Read-Only

Version of the workflow definition.

workflow[RW]
Read-Only

The workflow type.

workflow_instance_id[RW]
Read-Only

Unique workflow instance identifier.

Public Class Methods

attribute_map() click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 68
def self.attribute_map
  {
    :'created_date' => :'createdDate',
    :'current_stage' => :'currentStage',
    :'last_edited_by' => :'lastEditedBy',
    :'last_edited_date' => :'lastEditedDate',
    :'package_name' => :'packageName',
    :'system_name' => :'systemName',
    :'version' => :'version',
    :'workflow' => :'workflow',
    :'workflow_instance_id' => :'workflowInstanceId',
    :'transitions' => :'transitions'
  }
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/emass_client/models/workflow_instances_get.rb, line 256
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 107
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::WorkflowInstancesGet` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::WorkflowInstancesGet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'created_date')
    self.created_date = attributes[:'created_date']
  end

  if attributes.key?(:'current_stage')
    self.current_stage = attributes[:'current_stage']
  end

  if attributes.key?(:'last_edited_by')
    self.last_edited_by = attributes[:'last_edited_by']
  end

  if attributes.key?(:'last_edited_date')
    self.last_edited_date = attributes[:'last_edited_date']
  end

  if attributes.key?(:'package_name')
    self.package_name = attributes[:'package_name']
  end

  if attributes.key?(:'system_name')
    self.system_name = attributes[:'system_name']
  end

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  end

  if attributes.key?(:'workflow')
    self.workflow = attributes[:'workflow']
  end

  if attributes.key?(:'workflow_instance_id')
    self.workflow_instance_id = attributes[:'workflow_instance_id']
  end

  if attributes.key?(:'transitions')
    if (value = attributes[:'transitions']).is_a?(Array)
      self.transitions = value
    end
  end
end
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/emass_client/models/workflow_instances_get.rb, line 100
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/emass_client/models/workflow_instances_get.rb, line 84
def self.openapi_types
  {
    :'created_date' => :'Object',
    :'current_stage' => :'Object',
    :'last_edited_by' => :'Object',
    :'last_edited_date' => :'Object',
    :'package_name' => :'Object',
    :'system_name' => :'Object',
    :'version' => :'Object',
    :'workflow' => :'Object',
    :'workflow_instance_id' => :'Object',
    :'transitions' => :'Object'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 226
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      created_date == o.created_date &&
      current_stage == o.current_stage &&
      last_edited_by == o.last_edited_by &&
      last_edited_date == o.last_edited_date &&
      package_name == o.package_name &&
      system_name == o.system_name &&
      version == o.version &&
      workflow == o.workflow &&
      workflow_instance_id == o.workflow_instance_id &&
      transitions == o.transitions
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/emass_client/models/workflow_instances_get.rb, line 286
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    EmassClient.const_get(type).build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/emass_client/models/workflow_instances_get.rb, line 355
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/emass_client/models/workflow_instances_get.rb, line 263
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if 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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end
current_stage=(current_stage) click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 186
def current_stage=(current_stage)
  validator = EnumAttributeValidator.new('Object', ['Echelon I', 'Echelon II', 'Echelon III', 'Categorize System', 'Submit Categorization', 'Approval', 'Cancel', 'Complete'])
  unless validator.valid?(current_stage)
    fail ArgumentError, "invalid value for \"current_stage\", must be one of #{validator.allowable_values}."
  end
  @current_stage = current_stage
end
eql?(o) click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 243
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 249
def hash
  [created_date, current_stage, last_edited_by, last_edited_date, package_name, system_name, version, workflow, workflow_instance_id, transitions].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/emass_client/models/workflow_instances_get.rb, line 165
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end
package_name=(package_name) click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 196
def package_name=(package_name)
  validator = EnumAttributeValidator.new('Object', ['Test POA&M Approval', 'Test RMF Step 1 package', 'Test RMF Step 2 package', 'Test RMF Step 3 package'])
  unless validator.valid?(package_name)
    fail ArgumentError, "invalid value for \"package_name\", must be one of #{validator.allowable_values}."
  end
  @package_name = package_name
end
system_name=(system_name) click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 206
def system_name=(system_name)
  validator = EnumAttributeValidator.new('Object', ['Test system 1', 'Test system 2', 'Test system 3', 'Test system 4'])
  unless validator.valid?(system_name)
    fail ArgumentError, "invalid value for \"system_name\", must be one of #{validator.allowable_values}."
  end
  @system_name = system_name
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/emass_client/models/workflow_instances_get.rb, line 331
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/emass_client/models/workflow_instances_get.rb, line 337
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
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/emass_client/models/workflow_instances_get.rb, line 325
def to_s
  to_hash.to_s
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/emass_client/models/workflow_instances_get.rb, line 172
def valid?
  current_stage_validator = EnumAttributeValidator.new('Object', ['Echelon I', 'Echelon II', 'Echelon III', 'Categorize System', 'Submit Categorization', 'Approval', 'Cancel', 'Complete'])
  return false unless current_stage_validator.valid?(@current_stage)
  package_name_validator = EnumAttributeValidator.new('Object', ['Test POA&M Approval', 'Test RMF Step 1 package', 'Test RMF Step 2 package', 'Test RMF Step 3 package'])
  return false unless package_name_validator.valid?(@package_name)
  system_name_validator = EnumAttributeValidator.new('Object', ['Test system 1', 'Test system 2', 'Test system 3', 'Test system 4'])
  return false unless system_name_validator.valid?(@system_name)
  workflow_validator = EnumAttributeValidator.new('Object', ['POA&M Approval', 'RMF Step 1: Security Category', 'RMF Step 2: Security Category', 'RMF Step 3: Security Category'])
  return false unless workflow_validator.valid?(@workflow)
  true
end
workflow=(workflow) click to toggle source

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

# File lib/emass_client/models/workflow_instances_get.rb, line 216
def workflow=(workflow)
  validator = EnumAttributeValidator.new('Object', ['POA&M Approval', 'RMF Step 1: Security Category', 'RMF Step 2: Security Category', 'RMF Step 3: Security Category'])
  unless validator.valid?(workflow)
    fail ArgumentError, "invalid value for \"workflow\", must be one of #{validator.allowable_values}."
  end
  @workflow = workflow
end