class SwaggerClient::SubstituteTeacherClass

Represents a single class instance. Used in SubstituteClassTeacher endpoint.

Attributes

active[RW]

When `true`, indicates that the class is being shown to clients in consumer mode.

class_description[RW]

Contains information about this class.

class_schedule_id[RW]

The class schedule ID of the requested class.

end_date_time[RW]

The date and time when this class is scheduled to end.

hide_cancel[RW]

When `true`, indicates that this class is should not be shown to clients when `IsCancelled` is `true`.<br /> When `false`, indicates that this class is should be shown to clients when `IsCancelled` is `true`.<br /> This property can be ignored when the `IsCancelled` property is `false`.

id[RW]

The unique identifier of the class.

is_available[RW]

When `true`, indicates that the class can be booked.<br /> When `false`, that the class cannot be booked at this time.

is_canceled[RW]

When `true`, indicates that the class has been canceled.<br /> When `false`, indicates that the class has not been canceled and may still be bookable.

is_waitlist_available[RW]

When `true`, indicates that the class has a waiting list and there is space available on the waiting list for another client.<br /> When `false`, indicates either that the class does not have a waiting list or there is no space available on the class waiting list.

last_modified_date_time[RW]

The last time the class was modified.

location[RW]

Contains information about the location where the class is taking place.

max_capacity[RW]

The total number of bookings allowed in the class.

semester_id[RW]

Identifies the semester assigned to this class.

staff[RW]

Contains information about the teacher of the class.

start_date_time[RW]

The date and time that this class is scheduled to start.

substitute[RW]

When `true`, indicates that the class is being taught by a substitute teacher.

total_booked[RW]

The total number of clients who are booked into the class prior to this call being made.

total_booked_waitlist[RW]

The total number of booked clients who are on the waiting list for the class prior to this call being made.

web_booked[RW]

The total number of bookings in the class made by online users, prior to this call being made. This property is the current number of bookings counted toward the `WebCapacity` limit.

web_capacity[RW]

The total number of online bookings allowed in the class.

Public Class Methods

attribute_map() click to toggle source

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

# File lib/swagger_client/models/substitute_teacher_class.rb, line 79
def self.attribute_map
  {
    :'class_schedule_id' => :'ClassScheduleId',
    :'location' => :'Location',
    :'max_capacity' => :'MaxCapacity',
    :'web_capacity' => :'WebCapacity',
    :'total_booked' => :'TotalBooked',
    :'total_booked_waitlist' => :'TotalBookedWaitlist',
    :'web_booked' => :'WebBooked',
    :'semester_id' => :'SemesterId',
    :'is_canceled' => :'IsCanceled',
    :'substitute' => :'Substitute',
    :'active' => :'Active',
    :'is_waitlist_available' => :'IsWaitlistAvailable',
    :'hide_cancel' => :'HideCancel',
    :'id' => :'Id',
    :'is_available' => :'IsAvailable',
    :'start_date_time' => :'StartDateTime',
    :'end_date_time' => :'EndDateTime',
    :'last_modified_date_time' => :'LastModifiedDateTime',
    :'class_description' => :'ClassDescription',
    :'staff' => :'Staff'
  }
end
new(attributes = {}) click to toggle source

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

# File lib/swagger_client/models/substitute_teacher_class.rb, line 132
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?(:'ClassScheduleId')
    self.class_schedule_id = attributes[:'ClassScheduleId']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Attribute type mapping.

# File lib/swagger_client/models/substitute_teacher_class.rb, line 105
def self.swagger_types
  {
    :'class_schedule_id' => :'Integer',
    :'location' => :'Location',
    :'max_capacity' => :'Integer',
    :'web_capacity' => :'Integer',
    :'total_booked' => :'Integer',
    :'total_booked_waitlist' => :'Integer',
    :'web_booked' => :'Integer',
    :'semester_id' => :'Integer',
    :'is_canceled' => :'BOOLEAN',
    :'substitute' => :'BOOLEAN',
    :'active' => :'BOOLEAN',
    :'is_waitlist_available' => :'BOOLEAN',
    :'hide_cancel' => :'BOOLEAN',
    :'id' => :'Integer',
    :'is_available' => :'BOOLEAN',
    :'start_date_time' => :'DateTime',
    :'end_date_time' => :'DateTime',
    :'last_modified_date_time' => :'DateTime',
    :'class_description' => :'ClassDescription',
    :'staff' => :'Staff'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/swagger_client/models/substitute_teacher_class.rb, line 234
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_schedule_id == o.class_schedule_id &&
      location == o.location &&
      max_capacity == o.max_capacity &&
      web_capacity == o.web_capacity &&
      total_booked == o.total_booked &&
      total_booked_waitlist == o.total_booked_waitlist &&
      web_booked == o.web_booked &&
      semester_id == o.semester_id &&
      is_canceled == o.is_canceled &&
      substitute == o.substitute &&
      active == o.active &&
      is_waitlist_available == o.is_waitlist_available &&
      hide_cancel == o.hide_cancel &&
      id == o.id &&
      is_available == o.is_available &&
      start_date_time == o.start_date_time &&
      end_date_time == o.end_date_time &&
      last_modified_date_time == o.last_modified_date_time &&
      class_description == o.class_description &&
      staff == o.staff
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/swagger_client/models/substitute_teacher_class.rb, line 295
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
    temp_model = SwaggerClient.const_get(type).new
    temp_model.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/swagger_client/models/substitute_teacher_class.rb, line 361
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/swagger_client/models/substitute_teacher_class.rb, line 274
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the 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]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
eql?(o) click to toggle source

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

# File lib/swagger_client/models/substitute_teacher_class.rb, line 261
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/swagger_client/models/substitute_teacher_class.rb, line 267
def hash
  [class_schedule_id, location, max_capacity, web_capacity, total_booked, total_booked_waitlist, web_booked, semester_id, is_canceled, substitute, active, is_waitlist_available, hide_cancel, id, is_available, start_date_time, end_date_time, last_modified_date_time, class_description, staff].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/swagger_client/models/substitute_teacher_class.rb, line 221
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
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/swagger_client/models/substitute_teacher_class.rb, line 341
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/swagger_client/models/substitute_teacher_class.rb, line 347
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

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

# File lib/swagger_client/models/substitute_teacher_class.rb, line 335
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/swagger_client/models/substitute_teacher_class.rb, line 228
def valid?
  true
end