class SwaggerClient::Visit

Represents a specific visit to a class

Attributes

action[RW]

The action taken.

appointment_gender_preference[RW]

The gender of staff member with whom the client prefers to book appointments.

appointment_id[RW]

The appointment’s ID.

appointment_status[RW]

The status of the appointment.

class_id[RW]

The class ID that was used to retrieve the visits.

client_id[RW]

The ID of the client associated with the visit.

end_date_time[RW]

The date and time the visit ends. The Public API returns UTC dates and times. For example, a class that occurs on June 25th, 2018 at 2:15PM (EST) appears as “2018-06-25T19:15:00Z” because EST is five hours behind UTC. Date time pairs always return in the format YYYY-MM-DDTHH:mm:ssZ.

id[RW]

The ID of the visit.

last_modified_date_time[RW]

When included in the request, only records modified on or after the specified `LastModifiedDate` are included in the response. The Public API returns UTC dates and times. For example, a class that occurs on June 25th, 2018 at 2:15PM (EST) appears as “2018-06-25T19:15:00Z” because EST is five hours behind UTC. Date time pairs always return in the format YYYY-MM-DDTHH:mm:ssZ.

late_cancelled[RW]

When `true`, indicates that the class has been `LateCancelled`.<br /> When `false`, indicates that the class has not been `LateCancelled`.

location_id[RW]

The ID of the location where the visit took place or is to take place.

make_up[RW]

When `true`, the client can make up this session and a session is not deducted from the pricing option that was used to sign the client into the enrollment. When the client has the make-up session, a session is automatically removed from a pricing option that matches the service category of the enrollment and is within the same date range of the missed session.<br /> When `false`, the client cannot make up this session. See [Enrollments: Make-ups](support.mindbodyonline.com/s/article/203259433-Enrollments-Make-ups?language=en_US) for more information.

name[RW]

The name of the class.

service_id[RW]

The ID of the pricing option used to pay for the class visit.

signed_in[RW]

When `true`, indicates that the client has been signed in.<br /> When `false`, indicates that the client has not been signed in.

staff_id[RW]

The ID of the staff member who is teaching the class.

start_date_time[RW]

The time this class is scheduled to start.

web_signup[RW]

When `true`, indicates that the client signed up online.<br /> When `false`, indicates that the client was signed up by a staff member.

Public Class Methods

attribute_map() click to toggle source

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

# File lib/swagger_client/models/visit.rb, line 95
def self.attribute_map
  {
    :'appointment_id' => :'AppointmentId',
    :'appointment_gender_preference' => :'AppointmentGenderPreference',
    :'appointment_status' => :'AppointmentStatus',
    :'class_id' => :'ClassId',
    :'client_id' => :'ClientId',
    :'start_date_time' => :'StartDateTime',
    :'end_date_time' => :'EndDateTime',
    :'id' => :'Id',
    :'last_modified_date_time' => :'LastModifiedDateTime',
    :'late_cancelled' => :'LateCancelled',
    :'location_id' => :'LocationId',
    :'make_up' => :'MakeUp',
    :'name' => :'Name',
    :'service_id' => :'ServiceId',
    :'signed_in' => :'SignedIn',
    :'staff_id' => :'StaffId',
    :'web_signup' => :'WebSignup',
    :'action' => :'Action'
  }
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/visit.rb, line 144
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?(:'AppointmentId')
    self.appointment_id = attributes[:'AppointmentId']
  end

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

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

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

  if attributes.has_key?(:'ClientId')
    self.client_id = attributes[:'ClientId']
  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?(:'Id')
    self.id = attributes[:'Id']
  end

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

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

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

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

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

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

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

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

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

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

Attribute type mapping.

# File lib/swagger_client/models/visit.rb, line 119
def self.swagger_types
  {
    :'appointment_id' => :'Integer',
    :'appointment_gender_preference' => :'String',
    :'appointment_status' => :'String',
    :'class_id' => :'Integer',
    :'client_id' => :'String',
    :'start_date_time' => :'DateTime',
    :'end_date_time' => :'DateTime',
    :'id' => :'Integer',
    :'last_modified_date_time' => :'DateTime',
    :'late_cancelled' => :'BOOLEAN',
    :'location_id' => :'Integer',
    :'make_up' => :'BOOLEAN',
    :'name' => :'String',
    :'service_id' => :'Integer',
    :'signed_in' => :'BOOLEAN',
    :'staff_id' => :'Integer',
    :'web_signup' => :'BOOLEAN',
    :'action' => :'String'
  }
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/visit.rb, line 274
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      appointment_id == o.appointment_id &&
      appointment_gender_preference == o.appointment_gender_preference &&
      appointment_status == o.appointment_status &&
      class_id == o.class_id &&
      client_id == o.client_id &&
      start_date_time == o.start_date_time &&
      end_date_time == o.end_date_time &&
      id == o.id &&
      last_modified_date_time == o.last_modified_date_time &&
      late_cancelled == o.late_cancelled &&
      location_id == o.location_id &&
      make_up == o.make_up &&
      name == o.name &&
      service_id == o.service_id &&
      signed_in == o.signed_in &&
      staff_id == o.staff_id &&
      web_signup == o.web_signup &&
      action == o.action
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/visit.rb, line 333
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/visit.rb, line 399
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
action=(action) click to toggle source

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

# File lib/swagger_client/models/visit.rb, line 264
def action=(action)
  validator = EnumAttributeValidator.new('String', ['None', 'Added', 'Updated', 'Failed', 'Removed'])
  unless validator.valid?(action)
    fail ArgumentError, 'invalid value for "action", must be one of #{validator.allowable_values}.'
  end
  @action = action
end
appointment_gender_preference=(appointment_gender_preference) click to toggle source

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

# File lib/swagger_client/models/visit.rb, line 244
def appointment_gender_preference=(appointment_gender_preference)
  validator = EnumAttributeValidator.new('String', ['None', 'Female', 'Male'])
  unless validator.valid?(appointment_gender_preference)
    fail ArgumentError, 'invalid value for "appointment_gender_preference", must be one of #{validator.allowable_values}.'
  end
  @appointment_gender_preference = appointment_gender_preference
end
appointment_status=(appointment_status) click to toggle source

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

# File lib/swagger_client/models/visit.rb, line 254
def appointment_status=(appointment_status)
  validator = EnumAttributeValidator.new('String', ['None', 'Requested', 'Booked', 'Completed', 'Confirmed', 'Arrived', 'NoShow', 'Cancelled', 'LateCancelled'])
  unless validator.valid?(appointment_status)
    fail ArgumentError, 'invalid value for "appointment_status", must be one of #{validator.allowable_values}.'
  end
  @appointment_status = appointment_status
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/visit.rb, line 312
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/visit.rb, line 299
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/visit.rb, line 305
def hash
  [appointment_id, appointment_gender_preference, appointment_status, class_id, client_id, start_date_time, end_date_time, id, last_modified_date_time, late_cancelled, location_id, make_up, name, service_id, signed_in, staff_id, web_signup, action].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/visit.rb, line 225
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/visit.rb, line 379
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/visit.rb, line 385
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/visit.rb, line 373
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/visit.rb, line 232
def valid?
  appointment_gender_preference_validator = EnumAttributeValidator.new('String', ['None', 'Female', 'Male'])
  return false unless appointment_gender_preference_validator.valid?(@appointment_gender_preference)
  appointment_status_validator = EnumAttributeValidator.new('String', ['None', 'Requested', 'Booked', 'Completed', 'Confirmed', 'Arrived', 'NoShow', 'Cancelled', 'LateCancelled'])
  return false unless appointment_status_validator.valid?(@appointment_status)
  action_validator = EnumAttributeValidator.new('String', ['None', 'Added', 'Updated', 'Failed', 'Removed'])
  return false unless action_validator.valid?(@action)
  true
end