class PureCloud::WorkPlanListItemResponse

Work plan information

Attributes

agent_count[RW]

Number of agents in this work plan. Populate with expand=agentCount

agents[RW]

Agents in this work plan. Populate with expand=details (defaults to empty list)

constrain_minimum_time_between_shifts[RW]

Whether the minimum time between shifts constraint is enabled for this work plan

constrain_paid_time_granularity[RW]

Whether paid time granularity is constrained for this workplan

constrain_weekly_paid_time[RW]

Whether the weekly paid time constraint is enabled for this work plan

enabled[RW]

Whether the work plan is enabled for scheduling

flexible_weekly_paid_time[RW]

Whether the weekly paid time constraint is flexible for this work plan

id[RW]

The globally unique identifier for the object.

maximum_days[RW]

Maximum number days in a week allowed to be scheduled for this work plan

metadata[RW]

Version metadata for this work plan

minimum_time_between_shifts_minutes[RW]

Minimum time between shifts in minutes defined in this work plan. Used if constrainMinimumTimeBetweenShifts == true

minimum_working_days_per_week[RW]

The minimum number of days that agents assigned to a work plan must work per week

name[RW]
optional_days[RW]

Optional days to schedule for this work plan. Populate with expand=details

paid_time_granularity_minutes[RW]

Granularity in minutes allowed for shift paid time in this work plan. Used if constrainPaidTimeGranularity == true

self_uri[RW]

The URI for this object

shift_start_variances[RW]

Variance in minutes among start times of shifts in this work plan. Populate with expand=details

shifts[RW]

Shifts in this work plan. Populate with expand=details (defaults to empty list)

weekly_exact_paid_minutes[RW]

Exact weekly paid time in minutes for this work plan. Used if flexibleWeeklyPaidTime == false

weekly_maximum_paid_minutes[RW]

Maximum weekly paid time in minutes for this work plan. Used if flexibleWeeklyPaidTime == true

weekly_minimum_paid_minutes[RW]

Minimum weekly paid time in minutes for this work plan. Used if flexibleWeeklyPaidTime == true

Public Class Methods

attribute_map() click to toggle source

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

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 85
def self.attribute_map
  {
    
    :'id' => :'id',
    
    :'name' => :'name',
    
    :'enabled' => :'enabled',
    
    :'constrain_weekly_paid_time' => :'constrainWeeklyPaidTime',
    
    :'flexible_weekly_paid_time' => :'flexibleWeeklyPaidTime',
    
    :'weekly_exact_paid_minutes' => :'weeklyExactPaidMinutes',
    
    :'weekly_minimum_paid_minutes' => :'weeklyMinimumPaidMinutes',
    
    :'weekly_maximum_paid_minutes' => :'weeklyMaximumPaidMinutes',
    
    :'constrain_paid_time_granularity' => :'constrainPaidTimeGranularity',
    
    :'paid_time_granularity_minutes' => :'paidTimeGranularityMinutes',
    
    :'constrain_minimum_time_between_shifts' => :'constrainMinimumTimeBetweenShifts',
    
    :'minimum_time_between_shifts_minutes' => :'minimumTimeBetweenShiftsMinutes',
    
    :'maximum_days' => :'maximumDays',
    
    :'minimum_working_days_per_week' => :'minimumWorkingDaysPerWeek',
    
    :'optional_days' => :'optionalDays',
    
    :'shift_start_variances' => :'shiftStartVariances',
    
    :'shifts' => :'shifts',
    
    :'agents' => :'agents',
    
    :'metadata' => :'metadata',
    
    :'agent_count' => :'agentCount',
    
    :'self_uri' => :'selfUri'
    
  }
end
new(attributes = {}) click to toggle source

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

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 184
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?(:'name')
    
    
    self.name = attributes[:'name']
    
  
  end

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

  
  if attributes.has_key?(:'constrainWeeklyPaidTime')
    
    
    self.constrain_weekly_paid_time = attributes[:'constrainWeeklyPaidTime']
    
  
  end

  
  if attributes.has_key?(:'flexibleWeeklyPaidTime')
    
    
    self.flexible_weekly_paid_time = attributes[:'flexibleWeeklyPaidTime']
    
  
  end

  
  if attributes.has_key?(:'weeklyExactPaidMinutes')
    
    
    self.weekly_exact_paid_minutes = attributes[:'weeklyExactPaidMinutes']
    
  
  end

  
  if attributes.has_key?(:'weeklyMinimumPaidMinutes')
    
    
    self.weekly_minimum_paid_minutes = attributes[:'weeklyMinimumPaidMinutes']
    
  
  end

  
  if attributes.has_key?(:'weeklyMaximumPaidMinutes')
    
    
    self.weekly_maximum_paid_minutes = attributes[:'weeklyMaximumPaidMinutes']
    
  
  end

  
  if attributes.has_key?(:'constrainPaidTimeGranularity')
    
    
    self.constrain_paid_time_granularity = attributes[:'constrainPaidTimeGranularity']
    
  
  end

  
  if attributes.has_key?(:'paidTimeGranularityMinutes')
    
    
    self.paid_time_granularity_minutes = attributes[:'paidTimeGranularityMinutes']
    
  
  end

  
  if attributes.has_key?(:'constrainMinimumTimeBetweenShifts')
    
    
    self.constrain_minimum_time_between_shifts = attributes[:'constrainMinimumTimeBetweenShifts']
    
  
  end

  
  if attributes.has_key?(:'minimumTimeBetweenShiftsMinutes')
    
    
    self.minimum_time_between_shifts_minutes = attributes[:'minimumTimeBetweenShiftsMinutes']
    
  
  end

  
  if attributes.has_key?(:'maximumDays')
    
    
    self.maximum_days = attributes[:'maximumDays']
    
  
  end

  
  if attributes.has_key?(:'minimumWorkingDaysPerWeek')
    
    
    self.minimum_working_days_per_week = attributes[:'minimumWorkingDaysPerWeek']
    
  
  end

  
  if attributes.has_key?(:'optionalDays')
    
    
    self.optional_days = attributes[:'optionalDays']
    
  
  end

  
  if attributes.has_key?(:'shiftStartVariances')
    
    
    self.shift_start_variances = attributes[:'shiftStartVariances']
    
  
  end

  
  if attributes.has_key?(:'shifts')
    
    if (value = attributes[:'shifts']).is_a?(Array)
      self.shifts = value
    end
    
    
  
  end

  
  if attributes.has_key?(:'agents')
    
    if (value = attributes[:'agents']).is_a?(Array)
      self.agents = value
    end
    
    
  
  end

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

  
  if attributes.has_key?(:'agentCount')
    
    
    self.agent_count = attributes[:'agentCount']
    
  
  end

  
  if attributes.has_key?(:'selfUri')
    
    
    self.self_uri = attributes[:'selfUri']
    
  
  end

  
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 134
def self.swagger_types
  {
    
    :'id' => :'String',
    
    :'name' => :'String',
    
    :'enabled' => :'BOOLEAN',
    
    :'constrain_weekly_paid_time' => :'BOOLEAN',
    
    :'flexible_weekly_paid_time' => :'BOOLEAN',
    
    :'weekly_exact_paid_minutes' => :'Integer',
    
    :'weekly_minimum_paid_minutes' => :'Integer',
    
    :'weekly_maximum_paid_minutes' => :'Integer',
    
    :'constrain_paid_time_granularity' => :'BOOLEAN',
    
    :'paid_time_granularity_minutes' => :'Integer',
    
    :'constrain_minimum_time_between_shifts' => :'BOOLEAN',
    
    :'minimum_time_between_shifts_minutes' => :'Integer',
    
    :'maximum_days' => :'Integer',
    
    :'minimum_working_days_per_week' => :'Integer',
    
    :'optional_days' => :'SetWrapperDayOfWeek',
    
    :'shift_start_variances' => :'ListWrapperShiftStartVariance',
    
    :'shifts' => :'Array<WorkPlanShift>',
    
    :'agents' => :'Array<DeletableUserReference>',
    
    :'metadata' => :'WfmVersionedEntityMetadata',
    
    :'agent_count' => :'Integer',
    
    :'self_uri' => :'String'
    
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 598
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      enabled == o.enabled &&
      constrain_weekly_paid_time == o.constrain_weekly_paid_time &&
      flexible_weekly_paid_time == o.flexible_weekly_paid_time &&
      weekly_exact_paid_minutes == o.weekly_exact_paid_minutes &&
      weekly_minimum_paid_minutes == o.weekly_minimum_paid_minutes &&
      weekly_maximum_paid_minutes == o.weekly_maximum_paid_minutes &&
      constrain_paid_time_granularity == o.constrain_paid_time_granularity &&
      paid_time_granularity_minutes == o.paid_time_granularity_minutes &&
      constrain_minimum_time_between_shifts == o.constrain_minimum_time_between_shifts &&
      minimum_time_between_shifts_minutes == o.minimum_time_between_shifts_minutes &&
      maximum_days == o.maximum_days &&
      minimum_working_days_per_week == o.minimum_working_days_per_week &&
      optional_days == o.optional_days &&
      shift_start_variances == o.shift_start_variances &&
      shifts == o.shifts &&
      agents == o.agents &&
      metadata == o.metadata &&
      agent_count == o.agent_count &&
      self_uri == o.self_uri
end
_deserialize(type, value) click to toggle source
# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 656
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/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 716
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/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 637
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 @param [Object] Object to be compared

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 626
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 632
def hash
  [id, name, enabled, constrain_weekly_paid_time, flexible_weekly_paid_time, weekly_exact_paid_minutes, weekly_minimum_paid_minutes, weekly_maximum_paid_minutes, constrain_paid_time_granularity, paid_time_granularity_minutes, constrain_minimum_time_between_shifts, minimum_time_between_shifts_minutes, maximum_days, minimum_working_days_per_week, optional_days, shift_start_variances, shifts, agents, metadata, agent_count, self_uri].hash
end
list_invalid_properties() click to toggle source

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

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 388
def list_invalid_properties
  invalid_properties = Array.new
  
  
  return invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_body (backward compatibility))

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 699
def to_body
  to_hash
end
to_hash() click to toggle source

return the object in the form of hash

# File lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 704
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/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 694
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/purecloudplatformclientv2/models/work_plan_list_item_response.rb, line 397
def valid?
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  if @metadata.nil?
    return false
  end

  
  
  
  
  
  
  
  
  
  
  
  
end