Class: MicrosoftGraph::Models::AccessPackageQuestion
- Includes:
- MicrosoftKiotaAbstractions::Parsable
- Defined in:
- lib/models/access_package_question.rb
Direct Known Subclasses
AccessPackageMultipleChoiceQuestion, AccessPackageTextInputQuestion
Class Method Summary collapse
-
.create_from_discriminator_value(parse_node) ⇒ Object
Creates a new instance of the appropriate class based on discriminator value.
Instance Method Summary collapse
-
#get_field_deserializers ⇒ Object
The deserialization information for the current model.
-
#initialize ⇒ Object
constructor
Instantiates a new accessPackageQuestion and sets the default values.
-
#is_answer_editable ⇒ Object
Gets the isAnswerEditable property value.
-
#is_answer_editable=(value) ⇒ Object
Sets the isAnswerEditable property value.
-
#is_required ⇒ Object
Gets the isRequired property value.
-
#is_required=(value) ⇒ Object
Sets the isRequired property value.
-
#localizations ⇒ Object
Gets the localizations property value.
-
#localizations=(value) ⇒ Object
Sets the localizations property value.
-
#sequence ⇒ Object
Gets the sequence property value.
-
#sequence=(value) ⇒ Object
Sets the sequence property value.
-
#serialize(writer) ⇒ Object
Serializes information the current object.
-
#text ⇒ Object
Gets the text property value.
-
#text=(value) ⇒ Object
Sets the text property value.
Methods inherited from Entity
#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=
Constructor Details
#initialize ⇒ Object
Instantiates a new accessPackageQuestion and sets the default values.
28 29 30 |
# File 'lib/models/access_package_question.rb', line 28 def initialize() super end |
Class Method Details
.create_from_discriminator_value(parse_node) ⇒ Object
Creates a new instance of the appropriate class based on discriminator value
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/models/access_package_question.rb', line 36 def self.create_from_discriminator_value(parse_node) raise StandardError, 'parse_node cannot be null' if parse_node.nil? mapping_value_node = parse_node.get_child_node("@odata.type") unless mapping_value_node.nil? then mapping_value = mapping_value_node.get_string_value case mapping_value when "#microsoft.graph.accessPackageMultipleChoiceQuestion" return AccessPackageMultipleChoiceQuestion.new when "#microsoft.graph.accessPackageTextInputQuestion" return AccessPackageTextInputQuestion.new end end return AccessPackageQuestion.new end |
Instance Method Details
#get_field_deserializers ⇒ Object
The deserialization information for the current model
54 55 56 57 58 59 60 61 62 |
# File 'lib/models/access_package_question.rb', line 54 def get_field_deserializers() return super.merge({ "isAnswerEditable" => lambda {|n| @is_answer_editable = n.get_boolean_value() }, "isRequired" => lambda {|n| @is_required = n.get_boolean_value() }, "localizations" => lambda {|n| @localizations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AccessPackageLocalizedText.create_from_discriminator_value(pn) }) }, "sequence" => lambda {|n| @sequence = n.get_number_value() }, "text" => lambda {|n| @text = n.get_string_value() }, }) end |
#is_answer_editable ⇒ Object
Gets the isAnswerEditable property value. Specifies whether the requestor is allowed to edit answers to questions for an assignment by posting an update to accessPackageAssignmentRequest.
67 68 69 |
# File 'lib/models/access_package_question.rb', line 67 def is_answer_editable return @is_answer_editable end |
#is_answer_editable=(value) ⇒ Object
Sets the isAnswerEditable property value. Specifies whether the requestor is allowed to edit answers to questions for an assignment by posting an update to accessPackageAssignmentRequest.
75 76 77 |
# File 'lib/models/access_package_question.rb', line 75 def is_answer_editable=(value) @is_answer_editable = value end |
#is_required ⇒ Object
Gets the isRequired property value. Whether the requestor is required to supply an answer or not.
82 83 84 |
# File 'lib/models/access_package_question.rb', line 82 def is_required return @is_required end |
#is_required=(value) ⇒ Object
Sets the isRequired property value. Whether the requestor is required to supply an answer or not.
90 91 92 |
# File 'lib/models/access_package_question.rb', line 90 def is_required=(value) @is_required = value end |
#localizations ⇒ Object
Gets the localizations property value. The text of the question represented in a format for a specific locale.
97 98 99 |
# File 'lib/models/access_package_question.rb', line 97 def localizations return @localizations end |
#localizations=(value) ⇒ Object
Sets the localizations property value. The text of the question represented in a format for a specific locale.
105 106 107 |
# File 'lib/models/access_package_question.rb', line 105 def localizations=(value) @localizations = value end |
#sequence ⇒ Object
Gets the sequence property value. Relative position of this question when displaying a list of questions to the requestor.
112 113 114 |
# File 'lib/models/access_package_question.rb', line 112 def sequence return @sequence end |
#sequence=(value) ⇒ Object
Sets the sequence property value. Relative position of this question when displaying a list of questions to the requestor.
120 121 122 |
# File 'lib/models/access_package_question.rb', line 120 def sequence=(value) @sequence = value end |
#serialize(writer) ⇒ Object
Serializes information the current object
128 129 130 131 132 133 134 135 136 |
# File 'lib/models/access_package_question.rb', line 128 def serialize(writer) raise StandardError, 'writer cannot be null' if writer.nil? super writer.write_boolean_value("isAnswerEditable", @is_answer_editable) writer.write_boolean_value("isRequired", @is_required) writer.write_collection_of_object_values("localizations", @localizations) writer.write_number_value("sequence", @sequence) writer.write_string_value("text", @text) end |
#text ⇒ Object
Gets the text property value. The text of the question to show to the requestor.
141 142 143 |
# File 'lib/models/access_package_question.rb', line 141 def text return @text end |
#text=(value) ⇒ Object
Sets the text property value. The text of the question to show to the requestor.
149 150 151 |
# File 'lib/models/access_package_question.rb', line 149 def text=(value) @text = value end |