Class: SwaggerClient::Staff

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/models/staff.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Staff

Initializes the object



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# 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

Instance Attribute Details

#addressObject

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



18
19
20
# File 'lib/swagger_client/models/staff.rb', line 18

def address
  @address
end

#always_allow_double_bookingObject

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.



24
25
26
# File 'lib/swagger_client/models/staff.rb', line 24

def always_allow_double_booking
  @always_allow_double_booking
end

#appointment_instructorObject

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



21
22
23
# File 'lib/swagger_client/models/staff.rb', line 21

def appointment_instructor
  @appointment_instructor
end

#appointmentsObject

A list of appointments for the staff.



81
82
83
# File 'lib/swagger_client/models/staff.rb', line 81

def appointments
  @appointments
end

#availabilitiesObject

A list of availabilities for the staff.



87
88
89
# File 'lib/swagger_client/models/staff.rb', line 87

def availabilities
  @availabilities
end

#bioObject

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



27
28
29
# File 'lib/swagger_client/models/staff.rb', line 27

def bio
  @bio
end

#cityObject

The staff member’s city.



30
31
32
# File 'lib/swagger_client/models/staff.rb', line 30

def city
  @city
end

#class_teacherObject

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



66
67
68
# File 'lib/swagger_client/models/staff.rb', line 66

def class_teacher
  @class_teacher
end

#countryObject

The staff member’s country.



33
34
35
# File 'lib/swagger_client/models/staff.rb', line 33

def country
  @country
end

#emailObject

The staff member’s email address.



36
37
38
# File 'lib/swagger_client/models/staff.rb', line 36

def email
  @email
end

#first_nameObject

The staff member’s first name.



39
40
41
# File 'lib/swagger_client/models/staff.rb', line 39

def first_name
  @first_name
end

#home_phoneObject

The staff member’s home phone number.



42
43
44
# File 'lib/swagger_client/models/staff.rb', line 42

def home_phone
  @home_phone
end

#idObject

The ID assigned to the staff member.



45
46
47
# File 'lib/swagger_client/models/staff.rb', line 45

def id
  @id
end

#image_urlObject

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



78
79
80
# File 'lib/swagger_client/models/staff.rb', line 78

def image_url
  @image_url
end

#independent_contractorObject

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



48
49
50
# File 'lib/swagger_client/models/staff.rb', line 48

def independent_contractor
  @independent_contractor
end

#is_maleObject

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



51
52
53
# File 'lib/swagger_client/models/staff.rb', line 51

def is_male
  @is_male
end

#last_nameObject

The staff member’s last name.



54
55
56
# File 'lib/swagger_client/models/staff.rb', line 54

def last_name
  @last_name
end

#mobile_phoneObject

The staff member’s mobile phone number.



57
58
59
# File 'lib/swagger_client/models/staff.rb', line 57

def mobile_phone
  @mobile_phone
end

#nameObject

The staff member’s name.



60
61
62
# File 'lib/swagger_client/models/staff.rb', line 60

def name
  @name
end

#postal_codeObject

The staff member’s postal code.



63
64
65
# File 'lib/swagger_client/models/staff.rb', line 63

def postal_code
  @postal_code
end

#sort_orderObject

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.



69
70
71
# File 'lib/swagger_client/models/staff.rb', line 69

def sort_order
  @sort_order
end

#stateObject

The staff member’s state.



72
73
74
# File 'lib/swagger_client/models/staff.rb', line 72

def state
  @state
end

#unavailabilitiesObject

A list of unavailabilities for the staff.



84
85
86
# File 'lib/swagger_client/models/staff.rb', line 84

def unavailabilities
  @unavailabilities
end

#work_phoneObject

The staff member’s work phone number.



75
76
77
# File 'lib/swagger_client/models/staff.rb', line 75

def work_phone
  @work_phone
end

Class Method Details

.attribute_mapObject

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



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# 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

.swagger_typesObject

Attribute type mapping.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# 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

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# 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) ⇒ Object

Deserializes the data based on type



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# 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) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value



406
407
408
409
410
411
412
413
414
415
416
417
418
# 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) ⇒ Object

Builds the object from hash



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# 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) ⇒ Boolean

See Also:

  • `==` method


306
307
308
# File 'lib/swagger_client/models/staff.rb', line 306

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.



312
313
314
# 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_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?



262
263
264
265
# File 'lib/swagger_client/models/staff.rb', line 262

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)



386
387
388
# File 'lib/swagger_client/models/staff.rb', line 386

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash



392
393
394
395
396
397
398
399
400
# 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_sString

Returns the string representation of the object



380
381
382
# File 'lib/swagger_client/models/staff.rb', line 380

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid



269
270
271
# File 'lib/swagger_client/models/staff.rb', line 269

def valid?
  true
end