Class: SwaggerClient::ClassSchedule

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

Overview

Represents a single class instance. The class meets at the start time, goes until the end time.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ClassSchedule

Initializes the object



142
143
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/swagger_client/models/class_schedule.rb', line 142

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?(:'Classes')
    if (value = attributes[:'Classes']).is_a?(Array)
      self.classes = value
    end
  end

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

  if attributes.has_key?(:'Course')
    self.course = attributes[:'Course']
  end

  if attributes.has_key?(:'SemesterId')
    self.semester_id = attributes[:'SemesterId']
  end

  if attributes.has_key?(:'IsAvailable')
    self.is_available = attributes[:'IsAvailable']
  end

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

  if attributes.has_key?(:'ClassDescription')
    self.class_description = attributes[:'ClassDescription']
  end

  if attributes.has_key?(:'DaySunday')
    self.day_sunday = attributes[:'DaySunday']
  end

  if attributes.has_key?(:'DayMonday')
    self.day_monday = attributes[:'DayMonday']
  end

  if attributes.has_key?(:'DayTuesday')
    self.day_tuesday = attributes[:'DayTuesday']
  end

  if attributes.has_key?(:'DayWednesday')
    self.day_wednesday = attributes[:'DayWednesday']
  end

  if attributes.has_key?(:'DayThursday')
    self.day_thursday = attributes[:'DayThursday']
  end

  if attributes.has_key?(:'DayFriday')
    self.day_friday = attributes[:'DayFriday']
  end

  if attributes.has_key?(:'DaySaturday')
    self.day_saturday = attributes[:'DaySaturday']
  end

  if attributes.has_key?(:'AllowOpenEnrollment')
    self.allow_open_enrollment = attributes[:'AllowOpenEnrollment']
  end

  if attributes.has_key?(:'AllowDateForwardEnrollment')
    self.allow_date_forward_enrollment = attributes[:'AllowDateForwardEnrollment']
  end

  if attributes.has_key?(:'StartTime')
    self.start_time = attributes[:'StartTime']
  end

  if attributes.has_key?(:'EndTime')
    self.end_time = attributes[:'EndTime']
  end

  if attributes.has_key?(:'StartDate')
    self.start_date = attributes[:'StartDate']
  end

  if attributes.has_key?(:'EndDate')
    self.end_date = attributes[:'EndDate']
  end

  if attributes.has_key?(:'Staff')
    self.staff = attributes[:'Staff']
  end

  if attributes.has_key?(:'Location')
    self.location = attributes[:'Location']
  end
end

Instance Attribute Details

#allow_date_forward_enrollmentObject

When ‘true`, indicates that this the enrollment shows in consumer mode, the enrollment has not started yet, and there is room in each class of the enrollment.



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

def allow_date_forward_enrollment
  @allow_date_forward_enrollment
end

#allow_open_enrollmentObject

When ‘true`, indicates that the enrollment allows booking after the enrollment has started.



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

def allow_open_enrollment
  @allow_open_enrollment
end

#class_descriptionObject

Contains information about the class.



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

def class_description
  @class_description
end

#classesObject

Contains information about classes.



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

def classes
  @classes
end

#clientsObject

Contains information about clients.



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

def clients
  @clients
end

#courseObject

Contains information about the course that the enrollment is a part of.



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

def course
  @course
end

#day_fridayObject

When ‘true`, indicates that this schedule occurs on Fridays.



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

def day_friday
  @day_friday
end

#day_mondayObject

When ‘true`, indicates that this schedule occurs on Mondays.



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

def day_monday
  @day_monday
end

#day_saturdayObject

When ‘true`, indicates that this schedule occurs on Saturdays.



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

def day_saturday
  @day_saturday
end

#day_sundayObject

When ‘true`, indicates that this schedule occurs on Sundays.



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

def day_sunday
  @day_sunday
end

#day_thursdayObject

When ‘true`, indicates that this schedule occurs on Thursdays.



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

def day_thursday
  @day_thursday
end

#day_tuesdayObject

When ‘true`, indicates that this schedule occurs on Tuesdays.



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

def day_tuesday
  @day_tuesday
end

#day_wednesdayObject

When ‘true`, indicates that this schedule occurs on Wednesdays.



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

def day_wednesday
  @day_wednesday
end

#end_dateObject

The date this class schedule ends.



76
77
78
# File 'lib/swagger_client/models/class_schedule.rb', line 76

def end_date
  @end_date
end

#end_timeObject

The time this class schedule ends.



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

def end_time
  @end_time
end

#idObject

The unique ID of the class schedule.



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

def id
  @id
end

#is_availableObject

When ‘true`, indicates that the enrollment shows in consumer mode, has not started yet, and there is room in each class of the enrollment.<br /> When `false`, indicates that either the enrollment does not show in consumer mode, has already started, or there is no room in some classes of the enrollment.



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

def is_available
  @is_available
end

#locationObject

Contains information about the regularly scheduled location of this class.



82
83
84
# File 'lib/swagger_client/models/class_schedule.rb', line 82

def location
  @location
end

#semester_idObject

The semester ID for the enrollment (if any).



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

def semester_id
  @semester_id
end

#staffObject

Contains information about the staff member who is regularly scheduled to teach the class.



79
80
81
# File 'lib/swagger_client/models/class_schedule.rb', line 79

def staff
  @staff
end

#start_dateObject

The date this class schedule starts.



73
74
75
# File 'lib/swagger_client/models/class_schedule.rb', line 73

def start_date
  @start_date
end

#start_timeObject

The time this class schedule starts.



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

def start_time
  @start_time
end

Class Method Details

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/swagger_client/models/class_schedule.rb', line 85

def self.attribute_map
  {
    :'classes' => :'Classes',
    :'clients' => :'Clients',
    :'course' => :'Course',
    :'semester_id' => :'SemesterId',
    :'is_available' => :'IsAvailable',
    :'id' => :'Id',
    :'class_description' => :'ClassDescription',
    :'day_sunday' => :'DaySunday',
    :'day_monday' => :'DayMonday',
    :'day_tuesday' => :'DayTuesday',
    :'day_wednesday' => :'DayWednesday',
    :'day_thursday' => :'DayThursday',
    :'day_friday' => :'DayFriday',
    :'day_saturday' => :'DaySaturday',
    :'allow_open_enrollment' => :'AllowOpenEnrollment',
    :'allow_date_forward_enrollment' => :'AllowDateForwardEnrollment',
    :'start_time' => :'StartTime',
    :'end_time' => :'EndTime',
    :'start_date' => :'StartDate',
    :'end_date' => :'EndDate',
    :'staff' => :'Staff',
    :'location' => :'Location'
  }
end

.swagger_typesObject

Attribute type mapping.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/swagger_client/models/class_schedule.rb', line 113

def self.swagger_types
  {
    :'classes' => :'Array<ModelClass>',
    :'clients' => :'Array<Client>',
    :'course' => :'Course',
    :'semester_id' => :'Integer',
    :'is_available' => :'BOOLEAN',
    :'id' => :'Integer',
    :'class_description' => :'ClassDescription',
    :'day_sunday' => :'BOOLEAN',
    :'day_monday' => :'BOOLEAN',
    :'day_tuesday' => :'BOOLEAN',
    :'day_wednesday' => :'BOOLEAN',
    :'day_thursday' => :'BOOLEAN',
    :'day_friday' => :'BOOLEAN',
    :'day_saturday' => :'BOOLEAN',
    :'allow_open_enrollment' => :'BOOLEAN',
    :'allow_date_forward_enrollment' => :'BOOLEAN',
    :'start_time' => :'DateTime',
    :'end_time' => :'DateTime',
    :'start_date' => :'DateTime',
    :'end_date' => :'DateTime',
    :'staff' => :'Staff',
    :'location' => :'Location'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/swagger_client/models/class_schedule.rb', line 256

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      classes == o.classes &&
      clients == o.clients &&
      course == o.course &&
      semester_id == o.semester_id &&
      is_available == o.is_available &&
      id == o.id &&
      class_description == o.class_description &&
      day_sunday == o.day_sunday &&
      day_monday == o.day_monday &&
      day_tuesday == o.day_tuesday &&
      day_wednesday == o.day_wednesday &&
      day_thursday == o.day_thursday &&
      day_friday == o.day_friday &&
      day_saturday == o.day_saturday &&
      allow_open_enrollment == o.allow_open_enrollment &&
      allow_date_forward_enrollment == o.allow_date_forward_enrollment &&
      start_time == o.start_time &&
      end_time == o.end_time &&
      start_date == o.start_date &&
      end_date == o.end_date &&
      staff == o.staff &&
      location == o.location
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/swagger_client/models/class_schedule.rb', line 319

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



385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/swagger_client/models/class_schedule.rb', line 385

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



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/swagger_client/models/class_schedule.rb', line 298

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


285
286
287
# File 'lib/swagger_client/models/class_schedule.rb', line 285

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.



291
292
293
# File 'lib/swagger_client/models/class_schedule.rb', line 291

def hash
  [classes, clients, course, semester_id, is_available, id, class_description, day_sunday, day_monday, day_tuesday, day_wednesday, day_thursday, day_friday, day_saturday, allow_open_enrollment, allow_date_forward_enrollment, start_time, end_time, start_date, end_date, staff, location].hash
end

#list_invalid_propertiesObject

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



243
244
245
246
# File 'lib/swagger_client/models/class_schedule.rb', line 243

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)



365
366
367
# File 'lib/swagger_client/models/class_schedule.rb', line 365

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash



371
372
373
374
375
376
377
378
379
# File 'lib/swagger_client/models/class_schedule.rb', line 371

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



359
360
361
# File 'lib/swagger_client/models/class_schedule.rb', line 359

def to_s
  to_hash.to_s
end

#valid?Boolean

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



250
251
252
# File 'lib/swagger_client/models/class_schedule.rb', line 250

def valid?
  true
end