Class: SwaggerClient::Visit

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

Overview

Represents a specific visit to a class

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Visit

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



144
145
146
147
148
149
150
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
# 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. = attributes[:'WebSignup']
  end

  if attributes.has_key?(:'Action')
    self.action = attributes[:'Action']
  end
end

Instance Attribute Details

#actionObject

The action taken.



70
71
72
# File 'lib/swagger_client/models/visit.rb', line 70

def action
  @action
end

#appointment_gender_preferenceObject

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



22
23
24
# File 'lib/swagger_client/models/visit.rb', line 22

def appointment_gender_preference
  @appointment_gender_preference
end

#appointment_idObject

The appointment’s ID.



19
20
21
# File 'lib/swagger_client/models/visit.rb', line 19

def appointment_id
  @appointment_id
end

#appointment_statusObject

The status of the appointment.



25
26
27
# File 'lib/swagger_client/models/visit.rb', line 25

def appointment_status
  @appointment_status
end

#class_idObject

The class ID that was used to retrieve the visits.



28
29
30
# File 'lib/swagger_client/models/visit.rb', line 28

def class_id
  @class_id
end

#client_idObject

The ID of the client associated with the visit.



31
32
33
# File 'lib/swagger_client/models/visit.rb', line 31

def client_id
  @client_id
end

#end_date_timeObject

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.



37
38
39
# File 'lib/swagger_client/models/visit.rb', line 37

def end_date_time
  @end_date_time
end

#idObject

The ID of the visit.



40
41
42
# File 'lib/swagger_client/models/visit.rb', line 40

def id
  @id
end

#last_modified_date_timeObject

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.



43
44
45
# File 'lib/swagger_client/models/visit.rb', line 43

def last_modified_date_time
  @last_modified_date_time
end

#late_cancelledObject

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



46
47
48
# File 'lib/swagger_client/models/visit.rb', line 46

def late_cancelled
  @late_cancelled
end

#location_idObject

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



49
50
51
# File 'lib/swagger_client/models/visit.rb', line 49

def location_id
  @location_id
end

#make_upObject

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.



52
53
54
# File 'lib/swagger_client/models/visit.rb', line 52

def make_up
  @make_up
end

#nameObject

The name of the class.



55
56
57
# File 'lib/swagger_client/models/visit.rb', line 55

def name
  @name
end

#service_idObject

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



58
59
60
# File 'lib/swagger_client/models/visit.rb', line 58

def service_id
  @service_id
end

#signed_inObject

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



61
62
63
# File 'lib/swagger_client/models/visit.rb', line 61

def signed_in
  @signed_in
end

#staff_idObject

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



64
65
66
# File 'lib/swagger_client/models/visit.rb', line 64

def staff_id
  @staff_id
end

#start_date_timeObject

The time this class is scheduled to start.



34
35
36
# File 'lib/swagger_client/models/visit.rb', line 34

def start_date_time
  @start_date_time
end

#web_signupObject

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



67
68
69
# File 'lib/swagger_client/models/visit.rb', line 67

def 
  @web_signup
end

Class Method Details

.attribute_mapObject

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



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

.swagger_typesObject

Attribute type mapping.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# 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

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# 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 &&
       == o. &&
      action == o.action
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



333
334
335
336
337
338
339
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
# 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) ⇒ Hash

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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



399
400
401
402
403
404
405
406
407
408
409
410
411
# 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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# 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) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


299
300
301
# File 'lib/swagger_client/models/visit.rb', line 299

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



305
306
307
# 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, , action].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



225
226
227
228
# File 'lib/swagger_client/models/visit.rb', line 225

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



379
380
381
# File 'lib/swagger_client/models/visit.rb', line 379

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



385
386
387
388
389
390
391
392
393
# 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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



373
374
375
# File 'lib/swagger_client/models/visit.rb', line 373

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



232
233
234
235
236
237
238
239
240
# 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