Class: FlatApi::ClassDetails
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- FlatApi::ClassDetails
- Defined in:
- lib/flat_api/models/class_details.rb
Overview
A classroom
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#assignments_count ⇒ Object
The number of assignments created in the class.
-
#canvas ⇒ Object
Returns the value of attribute canvas.
-
#clever ⇒ Object
Returns the value of attribute clever.
-
#creation_date ⇒ Object
The date when the class was create.
-
#description ⇒ Object
An optionnal description for this class.
-
#enrollment_code ⇒ Object
[Teachers only] The enrollment code that can be used by the students to join the class.
-
#google_classroom ⇒ Object
Returns the value of attribute google_classroom.
-
#google_drive ⇒ Object
Returns the value of attribute google_drive.
-
#id ⇒ Object
The unique identifier of the class.
-
#issues ⇒ Object
Returns the value of attribute issues.
-
#level ⇒ Object
Returns the value of attribute level.
-
#lti ⇒ Object
Returns the value of attribute lti.
-
#mfc ⇒ Object
Returns the value of attribute mfc.
-
#microsoft_graph ⇒ Object
Returns the value of attribute microsoft_graph.
-
#modification_date ⇒ Object
The date when the class was last modified.
-
#name ⇒ Object
The name of the class.
-
#organization ⇒ Object
The unique identifier of the Organization owning this class.
-
#owner ⇒ Object
The unique identifier of the User owning this class.
-
#section ⇒ Object
The section of the class.
-
#size ⇒ Object
Number of students in the classroom.
-
#skills_focused ⇒ Object
Specific skills that will be focused in classroom.
-
#state ⇒ Object
Returns the value of attribute state.
-
#students_group ⇒ Object
Returns the value of attribute students_group.
-
#teachers_group ⇒ Object
Returns the value of attribute teachers_group.
-
#theme ⇒ Object
The theme identifier using in Flat User Interface.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ClassDetails
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ ClassDetails
Initializes the object
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 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 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 303 304 305 306 307 308 |
# File 'lib/flat_api/models/class_details.rb', line 185 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::ClassDetails` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'state') self.state = attributes[:'state'] else self.state = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'section') self.section = attributes[:'section'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'organization') self.organization = attributes[:'organization'] end if attributes.key?(:'owner') self.owner = attributes[:'owner'] end if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] else self.creation_date = nil end if attributes.key?(:'modification_date') self.modification_date = attributes[:'modification_date'] end if attributes.key?(:'enrollment_code') self.enrollment_code = attributes[:'enrollment_code'] end if attributes.key?(:'theme') self.theme = attributes[:'theme'] end if attributes.key?(:'assignments_count') self.assignments_count = attributes[:'assignments_count'] end if attributes.key?(:'students_group') self.students_group = attributes[:'students_group'] end if attributes.key?(:'teachers_group') self.teachers_group = attributes[:'teachers_group'] end if attributes.key?(:'issues') self.issues = attributes[:'issues'] end if attributes.key?(:'google_classroom') self.google_classroom = attributes[:'google_classroom'] end if attributes.key?(:'google_drive') self.google_drive = attributes[:'google_drive'] end if attributes.key?(:'microsoft_graph') self.microsoft_graph = attributes[:'microsoft_graph'] end if attributes.key?(:'lti') self.lti = attributes[:'lti'] end if attributes.key?(:'canvas') self.canvas = attributes[:'canvas'] end if attributes.key?(:'mfc') self.mfc = attributes[:'mfc'] end if attributes.key?(:'clever') self.clever = attributes[:'clever'] end if attributes.key?(:'level') self.level = attributes[:'level'] end if attributes.key?(:'skills_focused') if (value = attributes[:'skills_focused']).is_a?(Array) self.skills_focused = value end end if attributes.key?(:'size') self.size = attributes[:'size'] end end |
Instance Attribute Details
#assignments_count ⇒ Object
The number of assignments created in the class
52 53 54 |
# File 'lib/flat_api/models/class_details.rb', line 52 def assignments_count @assignments_count end |
#canvas ⇒ Object
Returns the value of attribute canvas.
68 69 70 |
# File 'lib/flat_api/models/class_details.rb', line 68 def canvas @canvas end |
#clever ⇒ Object
Returns the value of attribute clever.
72 73 74 |
# File 'lib/flat_api/models/class_details.rb', line 72 def clever @clever end |
#creation_date ⇒ Object
The date when the class was create
40 41 42 |
# File 'lib/flat_api/models/class_details.rb', line 40 def creation_date @creation_date end |
#description ⇒ Object
An optionnal description for this class
31 32 33 |
# File 'lib/flat_api/models/class_details.rb', line 31 def description @description end |
#enrollment_code ⇒ Object
[Teachers only] The enrollment code that can be used by the students to join the class
46 47 48 |
# File 'lib/flat_api/models/class_details.rb', line 46 def enrollment_code @enrollment_code end |
#google_classroom ⇒ Object
Returns the value of attribute google_classroom.
60 61 62 |
# File 'lib/flat_api/models/class_details.rb', line 60 def google_classroom @google_classroom end |
#google_drive ⇒ Object
Returns the value of attribute google_drive.
62 63 64 |
# File 'lib/flat_api/models/class_details.rb', line 62 def google_drive @google_drive end |
#id ⇒ Object
The unique identifier of the class
20 21 22 |
# File 'lib/flat_api/models/class_details.rb', line 20 def id @id end |
#issues ⇒ Object
Returns the value of attribute issues.
58 59 60 |
# File 'lib/flat_api/models/class_details.rb', line 58 def issues @issues end |
#level ⇒ Object
Returns the value of attribute level.
74 75 76 |
# File 'lib/flat_api/models/class_details.rb', line 74 def level @level end |
#lti ⇒ Object
Returns the value of attribute lti.
66 67 68 |
# File 'lib/flat_api/models/class_details.rb', line 66 def lti @lti end |
#mfc ⇒ Object
Returns the value of attribute mfc.
70 71 72 |
# File 'lib/flat_api/models/class_details.rb', line 70 def mfc @mfc end |
#microsoft_graph ⇒ Object
Returns the value of attribute microsoft_graph.
64 65 66 |
# File 'lib/flat_api/models/class_details.rb', line 64 def microsoft_graph @microsoft_graph end |
#modification_date ⇒ Object
The date when the class was last modified
43 44 45 |
# File 'lib/flat_api/models/class_details.rb', line 43 def modification_date @modification_date end |
#name ⇒ Object
The name of the class
25 26 27 |
# File 'lib/flat_api/models/class_details.rb', line 25 def name @name end |
#organization ⇒ Object
The unique identifier of the Organization owning this class
34 35 36 |
# File 'lib/flat_api/models/class_details.rb', line 34 def organization @organization end |
#owner ⇒ Object
The unique identifier of the User owning this class
37 38 39 |
# File 'lib/flat_api/models/class_details.rb', line 37 def owner @owner end |
#section ⇒ Object
The section of the class
28 29 30 |
# File 'lib/flat_api/models/class_details.rb', line 28 def section @section end |
#size ⇒ Object
Number of students in the classroom
80 81 82 |
# File 'lib/flat_api/models/class_details.rb', line 80 def size @size end |
#skills_focused ⇒ Object
Specific skills that will be focused in classroom
77 78 79 |
# File 'lib/flat_api/models/class_details.rb', line 77 def skills_focused @skills_focused end |
#state ⇒ Object
Returns the value of attribute state.
22 23 24 |
# File 'lib/flat_api/models/class_details.rb', line 22 def state @state end |
#students_group ⇒ Object
Returns the value of attribute students_group.
54 55 56 |
# File 'lib/flat_api/models/class_details.rb', line 54 def students_group @students_group end |
#teachers_group ⇒ Object
Returns the value of attribute teachers_group.
56 57 58 |
# File 'lib/flat_api/models/class_details.rb', line 56 def teachers_group @teachers_group end |
#theme ⇒ Object
The theme identifier using in Flat User Interface
49 50 51 |
# File 'lib/flat_api/models/class_details.rb', line 49 def theme @theme end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
136 137 138 |
# File 'lib/flat_api/models/class_details.rb', line 136 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
141 142 143 |
# File 'lib/flat_api/models/class_details.rb', line 141 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/flat_api/models/class_details.rb', line 105 def self.attribute_map { :'id' => :'id', :'state' => :'state', :'name' => :'name', :'section' => :'section', :'description' => :'description', :'organization' => :'organization', :'owner' => :'owner', :'creation_date' => :'creationDate', :'modification_date' => :'modificationDate', :'enrollment_code' => :'enrollmentCode', :'theme' => :'theme', :'assignments_count' => :'assignmentsCount', :'students_group' => :'studentsGroup', :'teachers_group' => :'teachersGroup', :'issues' => :'issues', :'google_classroom' => :'googleClassroom', :'google_drive' => :'googleDrive', :'microsoft_graph' => :'microsoftGraph', :'lti' => :'lti', :'canvas' => :'canvas', :'mfc' => :'mfc', :'clever' => :'clever', :'level' => :'level', :'skills_focused' => :'skillsFocused', :'size' => :'size' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 |
# File 'lib/flat_api/models/class_details.rb', line 432 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif 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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
177 178 179 180 181 |
# File 'lib/flat_api/models/class_details.rb', line 177 def self.openapi_nullable Set.new([ :'size' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/flat_api/models/class_details.rb', line 146 def self.openapi_types { :'id' => :'String', :'state' => :'ClassState', :'name' => :'String', :'section' => :'String', :'description' => :'String', :'organization' => :'String', :'owner' => :'String', :'creation_date' => :'Time', :'modification_date' => :'Time', :'enrollment_code' => :'String', :'theme' => :'String', :'assignments_count' => :'Float', :'students_group' => :'GroupDetails', :'teachers_group' => :'GroupDetails', :'issues' => :'ClassDetailsIssues', :'google_classroom' => :'ClassDetailsGoogleClassroom', :'google_drive' => :'ClassDetailsGoogleDrive', :'microsoft_graph' => :'ClassDetailsMicrosoftGraph', :'lti' => :'ClassDetailsLti', :'canvas' => :'ClassDetailsCanvas', :'mfc' => :'ClassDetailsMfc', :'clever' => :'ClassDetailsClever', :'level' => :'ClassGradeLevel', :'skills_focused' => :'Array<String>', :'size' => :'Float' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/flat_api/models/class_details.rb', line 387 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && state == o.state && name == o.name && section == o.section && description == o.description && organization == o.organization && owner == o.owner && creation_date == o.creation_date && modification_date == o.modification_date && enrollment_code == o.enrollment_code && theme == o.theme && assignments_count == o.assignments_count && students_group == o.students_group && teachers_group == o.teachers_group && issues == o.issues && google_classroom == o.google_classroom && google_drive == o.google_drive && microsoft_graph == o.microsoft_graph && lti == o.lti && canvas == o.canvas && mfc == o.mfc && clever == o.clever && level == o.level && skills_focused == o.skills_focused && size == o.size end |
#eql?(o) ⇒ Boolean
419 420 421 |
# File 'lib/flat_api/models/class_details.rb', line 419 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
425 426 427 |
# File 'lib/flat_api/models/class_details.rb', line 425 def hash [id, state, name, section, description, organization, owner, creation_date, modification_date, enrollment_code, theme, assignments_count, students_group, teachers_group, issues, google_classroom, google_drive, microsoft_graph, lti, canvas, mfc, clever, level, skills_focused, size].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/flat_api/models/class_details.rb', line 312 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @state.nil? invalid_properties.push('invalid value for "state", state cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @creation_date.nil? invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/flat_api/models/class_details.rb', line 454 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
336 337 338 339 340 341 342 343 |
# File 'lib/flat_api/models/class_details.rb', line 336 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @state.nil? return false if @name.nil? return false if @creation_date.nil? true end |