class SwaggerClient::Staff
Attributes
The address of the staff member who is teaching the class.
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.
When `true`, indicates that the staff member offers appointments.<br /> When `false`, indicates that the staff member does not offer appointments.
A list of appointments for the staff.
A list of availabilities for the staff.
The staff member’s biography. This string contains HTML.
The staff member’s city.
When `true`, indicates that the staff member can teach classes. When `false`, indicates that the staff member cannot teach classes.
The staff member’s country.
The staff member’s email address.
The staff member’s first name.
The staff member’s home phone number.
The ID assigned to the staff member.
The URL of the staff member’s image, if one has been uploaded.
When `true`, indicates that the staff member is an independent contractor. When `false`, indicates that the staff member is not an independent contractor.
When `true`, indicates that the staff member is male. When `false`, indicates that the staff member is female.
The staff member’s last name.
The staff member’s mobile phone number.
The staff member’s name.
The staff member’s postal code.
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.
The staff member’s state.
The staff member’s work phone number.
Public Class Methods
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
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
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
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
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
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
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
@see the `==` method @param [Object] Object to be compared
# File lib/swagger_client/models/staff.rb, line 306 def eql?(o) self == o end
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
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
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
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
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