class SwaggerClient::Staff

Attributes

address[RW]

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

always_allow_double_booking[RW]

When `true`, indicates that the staff member can be scheduled for overlapping services.<br /> When `false`, indicates that the staff can only be scheduled for one service at a time in any given time-frame.

appointment_instructor[RW]

When `true`, indicates that the staff member offers appointments.<br /> When `false`, indicates that the staff member does not offer appointments.

appointments[RW]

A list of appointments for the staff.

availabilities[RW]

A list of availabilities for the staff.

bio[RW]

The staff member’s biography. This string contains HTML.

city[RW]

The staff member’s city.

class_teacher[RW]

When `true`, indicates that the staff member can teach classes. When `false`, indicates that the staff member cannot teach classes.

country[RW]

The staff member’s country.

email[RW]

The staff member’s email address.

first_name[RW]

The staff member’s first name.

home_phone[RW]

The staff member’s home phone number.

id[RW]

The ID assigned to the staff member.

image_url[RW]

The URL of the staff member’s image, if one has been uploaded.

independent_contractor[RW]

When `true`, indicates that the staff member is an independent contractor. When `false`, indicates that the staff member is not an independent contractor.

is_male[RW]

When `true`, indicates that the staff member is male. When `false`, indicates that the staff member is female.

last_name[RW]

The staff member’s last name.

mobile_phone[RW]

The staff member’s mobile phone number.

name[RW]

The staff member’s name.

postal_code[RW]

The staff member’s postal code.

sort_order[RW]

If configured by the business owner, this field determines a staff member’s weight when sorting. Use this field to sort staff members on your interface.

state[RW]

The staff member’s state.

unavailabilities[RW]

A list of unavailabilities for the staff.

work_phone[RW]

The staff member’s work phone number.

Public Class Methods

attribute_map() click to toggle source

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

# File lib/swagger_client/models/staff.rb, line 90
def self.attribute_map
  {
    :'address' => :'Address',
    :'appointment_instructor' => :'AppointmentInstructor',
    :'always_allow_double_booking' => :'AlwaysAllowDoubleBooking',
    :'bio' => :'Bio',
    :'city' => :'City',
    :'country' => :'Country',
    :'email' => :'Email',
    :'first_name' => :'FirstName',
    :'home_phone' => :'HomePhone',
    :'id' => :'Id',
    :'independent_contractor' => :'IndependentContractor',
    :'is_male' => :'IsMale',
    :'last_name' => :'LastName',
    :'mobile_phone' => :'MobilePhone',
    :'name' => :'Name',
    :'postal_code' => :'PostalCode',
    :'class_teacher' => :'ClassTeacher',
    :'sort_order' => :'SortOrder',
    :'state' => :'State',
    :'work_phone' => :'WorkPhone',
    :'image_url' => :'ImageUrl',
    :'appointments' => :'Appointments',
    :'unavailabilities' => :'Unavailabilities',
    :'availabilities' => :'Availabilities'
  }
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/staff.rb, line 151
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?(:'Address')
    self.address = attributes[:'Address']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.has_key?(:'Availabilities')
    if (value = attributes[:'Availabilities']).is_a?(Array)
      self.availabilities = value
    end
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/swagger_client/models/staff.rb, line 120
def self.swagger_types
  {
    :'address' => :'String',
    :'appointment_instructor' => :'BOOLEAN',
    :'always_allow_double_booking' => :'BOOLEAN',
    :'bio' => :'String',
    :'city' => :'String',
    :'country' => :'String',
    :'email' => :'String',
    :'first_name' => :'String',
    :'home_phone' => :'String',
    :'id' => :'Integer',
    :'independent_contractor' => :'BOOLEAN',
    :'is_male' => :'BOOLEAN',
    :'last_name' => :'String',
    :'mobile_phone' => :'String',
    :'name' => :'String',
    :'postal_code' => :'String',
    :'class_teacher' => :'BOOLEAN',
    :'sort_order' => :'Integer',
    :'state' => :'String',
    :'work_phone' => :'String',
    :'image_url' => :'String',
    :'appointments' => :'Array<Appointment>',
    :'unavailabilities' => :'Array<Unavailability>',
    :'availabilities' => :'Array<Availability>'
  }
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/staff.rb, line 275
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      address == o.address &&
      appointment_instructor == o.appointment_instructor &&
      always_allow_double_booking == o.always_allow_double_booking &&
      bio == o.bio &&
      city == o.city &&
      country == o.country &&
      email == o.email &&
      first_name == o.first_name &&
      home_phone == o.home_phone &&
      id == o.id &&
      independent_contractor == o.independent_contractor &&
      is_male == o.is_male &&
      last_name == o.last_name &&
      mobile_phone == o.mobile_phone &&
      name == o.name &&
      postal_code == o.postal_code &&
      class_teacher == o.class_teacher &&
      sort_order == o.sort_order &&
      state == o.state &&
      work_phone == o.work_phone &&
      image_url == o.image_url &&
      appointments == o.appointments &&
      unavailabilities == o.unavailabilities &&
      availabilities == o.availabilities
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/staff.rb, line 340
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/staff.rb, line 406
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/staff.rb, line 319
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/staff.rb, line 306
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/staff.rb, line 312
def hash
  [address, appointment_instructor, always_allow_double_booking, bio, city, country, email, first_name, home_phone, id, independent_contractor, is_male, last_name, mobile_phone, name, postal_code, class_teacher, sort_order, state, work_phone, image_url, appointments, unavailabilities, availabilities].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/staff.rb, line 262
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/staff.rb, line 386
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/staff.rb, line 392
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/staff.rb, line 380
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/staff.rb, line 269
def valid?
  true
end