class PureCloud::Evaluation

Attributes

agent[RW]
agent_has_read[RW]
answers[RW]
assigned_date[RW]

Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ

calibration[RW]
changed_date[RW]

Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ

conversation[RW]
evaluation_form[RW]

Evaluation form used for evaluation.

evaluator[RW]
id[RW]

The globally unique identifier for the object.

is_scoring_index[RW]
name[RW]
never_release[RW]

Signifies if the evaluation is never to be released. This cannot be set true if release date is also set.

queue[RW]
redacted[RW]

Is only true when the user making the request does not have sufficient permissions to see evaluation

release_date[RW]

Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ

resource_id[RW]

Only used for email evaluations. Will be null for all other evaluations.

resource_type[RW]

The type of resource. Only used for email evaluations. Will be null for evaluations on all other resources.

self_uri[RW]

The URI for this object

status[RW]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/purecloud/models/evaluation.rb, line 72
def self.attribute_map
  {
    
    :'id' => :'id',
    
    :'name' => :'name',
    
    :'conversation' => :'conversation',
    
    :'evaluation_form' => :'evaluationForm',
    
    :'evaluator' => :'evaluator',
    
    :'agent' => :'agent',
    
    :'calibration' => :'calibration',
    
    :'status' => :'status',
    
    :'answers' => :'answers',
    
    :'agent_has_read' => :'agentHasRead',
    
    :'release_date' => :'releaseDate',
    
    :'assigned_date' => :'assignedDate',
    
    :'changed_date' => :'changedDate',
    
    :'queue' => :'queue',
    
    :'never_release' => :'neverRelease',
    
    :'resource_id' => :'resourceId',
    
    :'resource_type' => :'resourceType',
    
    :'redacted' => :'redacted',
    
    :'is_scoring_index' => :'isScoringIndex',
    
    :'self_uri' => :'selfUri'
    
  }
end
new(attributes = {}) click to toggle source
# File lib/purecloud/models/evaluation.rb, line 145
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

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

  
  if attributes[:'id']
    self.id = attributes[:'id']
  end
  
  if attributes[:'name']
    self.name = attributes[:'name']
  end
  
  if attributes[:'conversation']
    self.conversation = attributes[:'conversation']
  end
  
  if attributes[:'evaluationForm']
    self.evaluation_form = attributes[:'evaluationForm']
  end
  
  if attributes[:'evaluator']
    self.evaluator = attributes[:'evaluator']
  end
  
  if attributes[:'agent']
    self.agent = attributes[:'agent']
  end
  
  if attributes[:'calibration']
    self.calibration = attributes[:'calibration']
  end
  
  if attributes[:'status']
    self.status = attributes[:'status']
  end
  
  if attributes[:'answers']
    self.answers = attributes[:'answers']
  end
  
  if attributes[:'agentHasRead']
    self.agent_has_read = attributes[:'agentHasRead']
  end
  
  if attributes[:'releaseDate']
    self.release_date = attributes[:'releaseDate']
  end
  
  if attributes[:'assignedDate']
    self.assigned_date = attributes[:'assignedDate']
  end
  
  if attributes[:'changedDate']
    self.changed_date = attributes[:'changedDate']
  end
  
  if attributes[:'queue']
    self.queue = attributes[:'queue']
  end
  
  if attributes[:'neverRelease']
    self.never_release = attributes[:'neverRelease']
  end
  
  if attributes[:'resourceId']
    self.resource_id = attributes[:'resourceId']
  end
  
  if attributes[:'resourceType']
    self.resource_type = attributes[:'resourceType']
  end
  
  if attributes[:'redacted']
    self.redacted = attributes[:'redacted']
  end
  
  if attributes[:'isScoringIndex']
    self.is_scoring_index = attributes[:'isScoringIndex']
  end
  
  if attributes[:'selfUri']
    self.self_uri = attributes[:'selfUri']
  end
  
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/purecloud/models/evaluation.rb, line 119
def self.swagger_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'conversation' => :'Conversation',
    :'evaluation_form' => :'EvaluationForm',
    :'evaluator' => :'User',
    :'agent' => :'User',
    :'calibration' => :'Calibration',
    :'status' => :'String',
    :'answers' => :'EvaluationScoringSet',
    :'agent_has_read' => :'BOOLEAN',
    :'release_date' => :'DateTime',
    :'assigned_date' => :'DateTime',
    :'changed_date' => :'DateTime',
    :'queue' => :'Queue',
    :'never_release' => :'BOOLEAN',
    :'resource_id' => :'String',
    :'resource_type' => :'String',
    :'redacted' => :'BOOLEAN',
    :'is_scoring_index' => :'BOOLEAN',
    :'self_uri' => :'String'
    
  }
end

Public Instance Methods

==(o) click to toggle source

Check equality by comparing each attribute.

# File lib/purecloud/models/evaluation.rb, line 253
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      conversation == o.conversation &&
      evaluation_form == o.evaluation_form &&
      evaluator == o.evaluator &&
      agent == o.agent &&
      calibration == o.calibration &&
      status == o.status &&
      answers == o.answers &&
      agent_has_read == o.agent_has_read &&
      release_date == o.release_date &&
      assigned_date == o.assigned_date &&
      changed_date == o.changed_date &&
      queue == o.queue &&
      never_release == o.never_release &&
      resource_id == o.resource_id &&
      resource_type == o.resource_type &&
      redacted == o.redacted &&
      is_scoring_index == o.is_scoring_index &&
      self_uri == o.self_uri
end
_deserialize(type, value) click to toggle source
# File lib/purecloud/models/evaluation.rb, line 308
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 =~ /^(true|t|yes|y|1)$/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
    _model = Object.const_get("PureCloud").const_get(type).new
    _model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Method to output non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

# File lib/purecloud/models/evaluation.rb, line 368
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

build the object from hash

# File lib/purecloud/models/evaluation.rb, line 289
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      else
        #TODO show warning in debug mode
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    else
      # data not found in attributes(hash), not an issue as the data can be optional
    end
  end

  self
end
eql?(o) click to toggle source

@see the `==` method

# File lib/purecloud/models/evaluation.rb, line 279
def eql?(o)
  self == o
end
hash() click to toggle source

Calculate hash code according to all attributes.

# File lib/purecloud/models/evaluation.rb, line 284
def hash
  [id, name, conversation, evaluation_form, evaluator, agent, calibration, status, answers, agent_has_read, release_date, assigned_date, changed_date, queue, never_release, resource_id, resource_type, redacted, is_scoring_index, self_uri].hash
end
resource_type=(resource_type) click to toggle source

Custom attribute writer method checking allowed values (enum).

# File lib/purecloud/models/evaluation.rb, line 244
def resource_type=(resource_type)
  allowed_values = ["EMAIL"]
  if resource_type && !allowed_values.include?(resource_type)
    fail "invalid value for 'resource_type', must be one of #{allowed_values}"
  end
  @resource_type = resource_type
end
status=(status) click to toggle source

Custom attribute writer method checking allowed values (enum).

# File lib/purecloud/models/evaluation.rb, line 235
def status=(status)
  allowed_values = ["PENDING", "INPROGRESS", "FINISHED"]
  if status && !allowed_values.include?(status)
    fail "invalid value for 'status', must be one of #{allowed_values}"
  end
  @status = status
end
to_body() click to toggle source

to_body is an alias to to_body (backward compatibility))

# File lib/purecloud/models/evaluation.rb, line 351
def to_body
  to_hash
end
to_hash() click to toggle source

return the object in the form of hash

# File lib/purecloud/models/evaluation.rb, line 356
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source
# File lib/purecloud/models/evaluation.rb, line 346
def to_s
  to_hash.to_s
end