Class: MicrosoftGraph::Models::AccessPackageMultipleChoiceQuestion

Inherits:
AccessPackageQuestion show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/access_package_multiple_choice_question.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AccessPackageQuestion

#is_answer_editable, #is_answer_editable=, #is_required, #is_required=, #localizations, #localizations=, #sequence, #sequence=, #text, #text=

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new accessPackageMultipleChoiceQuestion and sets the default values.



34
35
36
37
# File 'lib/models/access_package_multiple_choice_question.rb', line 34

def initialize()
    super
    @odata_type = "#microsoft.graph.accessPackageMultipleChoiceQuestion"
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a access_package_multiple_choice_question

Raises:

  • (StandardError)


43
44
45
46
# File 'lib/models/access_package_multiple_choice_question.rb', line 43

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return AccessPackageMultipleChoiceQuestion.new
end

Instance Method Details

#choicesObject

Gets the choices property value. List of answer choices.

Returns:

  • a access_package_answer_choice



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

def choices
    return @choices
end

#choices=(value) ⇒ Object

Sets the choices property value. List of answer choices.

Parameters:

  • value

    Value to set for the choices property.

Returns:

  • a void



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

def choices=(value)
    @choices = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



51
52
53
54
55
56
# File 'lib/models/access_package_multiple_choice_question.rb', line 51

def get_field_deserializers()
    return super.merge({
        "choices" => lambda {|n| @choices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AccessPackageAnswerChoice.create_from_discriminator_value(pn) }) },
        "isMultipleSelectionAllowed" => lambda {|n| @is_multiple_selection_allowed = n.get_boolean_value() },
    })
end

#is_multiple_selection_allowedObject

Gets the isMultipleSelectionAllowed property value. Indicates whether requestor can select multiple choices as their answer.

Returns:

  • a boolean



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

def is_multiple_selection_allowed
    return @is_multiple_selection_allowed
end

#is_multiple_selection_allowed=(value) ⇒ Object

Sets the isMultipleSelectionAllowed property value. Indicates whether requestor can select multiple choices as their answer.

Parameters:

  • value

    Value to set for the isMultipleSelectionAllowed property.

Returns:

  • a void



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

def is_multiple_selection_allowed=(value)
    @is_multiple_selection_allowed = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


77
78
79
80
81
82
# File 'lib/models/access_package_multiple_choice_question.rb', line 77

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_collection_of_object_values("choices", @choices)
    writer.write_boolean_value("isMultipleSelectionAllowed", @is_multiple_selection_allowed)
end