Class: MicrosoftGraph::Models::AccessPackageQuestion

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/access_package_question.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

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

Constructor Details

#initializeObject

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

Parameters:

  • parse_node

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

Returns:

  • a access_package_question

Raises:

  • (StandardError)


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_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



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_editableObject

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.

Returns:

  • a boolean



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.

Parameters:

  • value

    Value to set for the isAnswerEditable property.

Returns:

  • a void



75
76
77
# File 'lib/models/access_package_question.rb', line 75

def is_answer_editable=(value)
    @is_answer_editable = value
end

#is_requiredObject

Gets the isRequired property value. Whether the requestor is required to supply an answer or not.

Returns:

  • a boolean



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.

Parameters:

  • value

    Value to set for the isRequired property.

Returns:

  • a void



90
91
92
# File 'lib/models/access_package_question.rb', line 90

def is_required=(value)
    @is_required = value
end

#localizationsObject

Gets the localizations property value. The text of the question represented in a format for a specific locale.

Returns:

  • a access_package_localized_text



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.

Parameters:

  • value

    Value to set for the localizations property.

Returns:

  • a void



105
106
107
# File 'lib/models/access_package_question.rb', line 105

def localizations=(value)
    @localizations = value
end

#sequenceObject

Gets the sequence property value. Relative position of this question when displaying a list of questions to the requestor.

Returns:

  • a integer



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.

Parameters:

  • value

    Value to set for the sequence property.

Returns:

  • a void



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

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


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

#textObject

Gets the text property value. The text of the question to show to the requestor.

Returns:

  • a string



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.

Parameters:

  • value

    Value to set for the text property.

Returns:

  • a void



149
150
151
# File 'lib/models/access_package_question.rb', line 149

def text=(value)
    @text = value
end