Class: EdmentumClient::EdApiModelsClassDetail
- Inherits:
-
Object
- Object
- EdmentumClient::EdApiModelsClassDetail
- Defined in:
- lib/edmentum_client/models/ed_api_models_class_detail.rb
Instance Attribute Summary collapse
-
#allow_self_enroll ⇒ Object
Returns the value of attribute allow_self_enroll.
-
#class_id ⇒ Object
Returns the value of attribute class_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#is_active ⇒ Object
Returns the value of attribute is_active.
-
#learners ⇒ Object
Returns the value of attribute learners.
-
#lock_assignment_on_due_date ⇒ Object
Returns the value of attribute lock_assignment_on_due_date.
-
#mastery_test_attempts ⇒ Object
Returns the value of attribute mastery_test_attempts.
-
#name ⇒ Object
Returns the value of attribute name.
-
#program_id ⇒ Object
Returns the value of attribute program_id.
-
#resource_node_id ⇒ Object
Returns the value of attribute resource_node_id.
-
#resource_node_name ⇒ Object
Returns the value of attribute resource_node_name.
-
#resource_version ⇒ Object
Returns the value of attribute resource_version.
-
#self_enroll_code ⇒ Object
Returns the value of attribute self_enroll_code.
-
#self_enroll_password ⇒ Object
Returns the value of attribute self_enroll_password.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#teachers ⇒ Object
Returns the value of attribute teachers.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ EdApiModelsClassDetail
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ EdApiModelsClassDetail
Initializes the object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 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 139 140 141 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 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 99 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?(:'Teachers') if (value = attributes[:'Teachers']).is_a?(Array) self.teachers = value end end if attributes.has_key?(:'Learners') if (value = attributes[:'Learners']).is_a?(Array) self.learners = value end end if attributes.has_key?(:'ProgramId') self.program_id = attributes[:'ProgramId'] end if attributes.has_key?(:'ResourceNodeId') self.resource_node_id = attributes[:'ResourceNodeId'] end if attributes.has_key?(:'ResourceVersion') self.resource_version = attributes[:'ResourceVersion'] end if attributes.has_key?(:'ResourceNodeName') self.resource_node_name = attributes[:'ResourceNodeName'] end if attributes.has_key?(:'ClassId') self.class_id = attributes[:'ClassId'] end if attributes.has_key?(:'Name') self.name = attributes[:'Name'] end if attributes.has_key?(:'Description') self.description = attributes[:'Description'] 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?(:'LockAssignmentOnDueDate') self.lock_assignment_on_due_date = attributes[:'LockAssignmentOnDueDate'] end if attributes.has_key?(:'AllowSelfEnroll') self.allow_self_enroll = attributes[:'AllowSelfEnroll'] end if attributes.has_key?(:'IsActive') self.is_active = attributes[:'IsActive'] end if attributes.has_key?(:'SelfEnrollCode') self.self_enroll_code = attributes[:'SelfEnrollCode'] end if attributes.has_key?(:'SelfEnrollPassword') self.self_enroll_password = attributes[:'SelfEnrollPassword'] end if attributes.has_key?(:'MasteryTestAttempts') self.mastery_test_attempts = attributes[:'MasteryTestAttempts'] end end |
Instance Attribute Details
#allow_self_enroll ⇒ Object
Returns the value of attribute allow_self_enroll.
41 42 43 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 41 def allow_self_enroll @allow_self_enroll end |
#class_id ⇒ Object
Returns the value of attribute class_id.
29 30 31 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 29 def class_id @class_id end |
#description ⇒ Object
Returns the value of attribute description.
33 34 35 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 33 def description @description end |
#end_date ⇒ Object
Returns the value of attribute end_date.
37 38 39 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 37 def end_date @end_date end |
#is_active ⇒ Object
Returns the value of attribute is_active.
43 44 45 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 43 def is_active @is_active end |
#learners ⇒ Object
Returns the value of attribute learners.
19 20 21 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 19 def learners @learners end |
#lock_assignment_on_due_date ⇒ Object
Returns the value of attribute lock_assignment_on_due_date.
39 40 41 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 39 def lock_assignment_on_due_date @lock_assignment_on_due_date end |
#mastery_test_attempts ⇒ Object
Returns the value of attribute mastery_test_attempts.
49 50 51 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 49 def mastery_test_attempts @mastery_test_attempts end |
#name ⇒ Object
Returns the value of attribute name.
31 32 33 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 31 def name @name end |
#program_id ⇒ Object
Returns the value of attribute program_id.
21 22 23 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 21 def program_id @program_id end |
#resource_node_id ⇒ Object
Returns the value of attribute resource_node_id.
23 24 25 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 23 def resource_node_id @resource_node_id end |
#resource_node_name ⇒ Object
Returns the value of attribute resource_node_name.
27 28 29 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 27 def resource_node_name @resource_node_name end |
#resource_version ⇒ Object
Returns the value of attribute resource_version.
25 26 27 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 25 def resource_version @resource_version end |
#self_enroll_code ⇒ Object
Returns the value of attribute self_enroll_code.
45 46 47 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 45 def self_enroll_code @self_enroll_code end |
#self_enroll_password ⇒ Object
Returns the value of attribute self_enroll_password.
47 48 49 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 47 def self_enroll_password @self_enroll_password end |
#start_date ⇒ Object
Returns the value of attribute start_date.
35 36 37 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 35 def start_date @start_date end |
#teachers ⇒ Object
Returns the value of attribute teachers.
17 18 19 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 17 def teachers @teachers end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 52 def self.attribute_map { :'teachers' => :'Teachers', :'learners' => :'Learners', :'program_id' => :'ProgramId', :'resource_node_id' => :'ResourceNodeId', :'resource_version' => :'ResourceVersion', :'resource_node_name' => :'ResourceNodeName', :'class_id' => :'ClassId', :'name' => :'Name', :'description' => :'Description', :'start_date' => :'StartDate', :'end_date' => :'EndDate', :'lock_assignment_on_due_date' => :'LockAssignmentOnDueDate', :'allow_self_enroll' => :'AllowSelfEnroll', :'is_active' => :'IsActive', :'self_enroll_code' => :'SelfEnrollCode', :'self_enroll_password' => :'SelfEnrollPassword', :'mastery_test_attempts' => :'MasteryTestAttempts' } end |
.swagger_types ⇒ Object
Attribute type mapping.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 75 def self.swagger_types { :'teachers' => :'Array<Integer>', :'learners' => :'Array<Integer>', :'program_id' => :'Integer', :'resource_node_id' => :'Integer', :'resource_version' => :'Integer', :'resource_node_name' => :'String', :'class_id' => :'Integer', :'name' => :'String', :'description' => :'String', :'start_date' => :'DateTime', :'end_date' => :'DateTime', :'lock_assignment_on_due_date' => :'BOOLEAN', :'allow_self_enroll' => :'BOOLEAN', :'is_active' => :'BOOLEAN', :'self_enroll_code' => :'String', :'self_enroll_password' => :'String', :'mastery_test_attempts' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 252 def ==(o) return true if self.equal?(o) self.class == o.class && teachers == o.teachers && learners == o.learners && program_id == o.program_id && resource_node_id == o.resource_node_id && resource_version == o.resource_version && resource_node_name == o.resource_node_name && class_id == o.class_id && name == o.name && description == o.description && start_date == o.start_date && end_date == o.end_date && lock_assignment_on_due_date == o.lock_assignment_on_due_date && allow_self_enroll == o.allow_self_enroll && is_active == o.is_active && self_enroll_code == o.self_enroll_code && self_enroll_password == o.self_enroll_password && mastery_test_attempts == o.mastery_test_attempts end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
310 311 312 313 314 315 316 317 318 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 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 310 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
376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 376 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
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 289 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 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
276 277 278 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 276 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
282 283 284 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 282 def hash [teachers, learners, program_id, resource_node_id, resource_version, resource_node_name, class_id, name, description, start_date, end_date, lock_assignment_on_due_date, allow_self_enroll, is_active, self_enroll_code, self_enroll_password, mastery_test_attempts].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 180 def list_invalid_properties invalid_properties = Array.new if @resource_node_id.nil? invalid_properties.push('invalid value for "resource_node_id", resource_node_id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @start_date.nil? invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') end if @is_active.nil? invalid_properties.push('invalid value for "is_active", is_active cannot be nil.') end if !@self_enroll_password.nil? invalid_properties.push('must include a non-blank password') end if !@mastery_test_attempts.nil? && @mastery_test_attempts > 10 invalid_properties.push('invalid value for "mastery_test_attempts", must be smaller than or equal to 10.') end if !@mastery_test_attempts.nil? && @mastery_test_attempts < 0 invalid_properties.push('invalid value for "mastery_test_attempts", must be greater than or equal to 0.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
356 357 358 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 356 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
362 363 364 365 366 367 368 369 370 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 362 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 ⇒ String
Returns the string representation of the object
350 351 352 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 350 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
215 216 217 218 219 220 221 222 223 224 |
# File 'lib/edmentum_client/models/ed_api_models_class_detail.rb', line 215 def valid? return false if @resource_node_id.nil? return false if @name.nil? return false if @start_date.nil? return false if @is_active.nil? return false if !@self_enroll_password.nil? && @self_enroll_password !~ Regexp.new(/^[a-zA-Z0-9@#$%&*+\\-_(),+':;?.,!\\[\\]\\s\\\\]{1,40}$/) return false if !@mastery_test_attempts.nil? && @mastery_test_attempts > 10 return false if !@mastery_test_attempts.nil? && @mastery_test_attempts < 0 true end |