Class: MicrosoftGraph::Models::GroupAssignmentTarget

Inherits:
DeviceAndAppManagementAssignmentTarget show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/group_assignment_target.rb

Overview

Represents an assignment to a group.

Direct Known Subclasses

ExclusionGroupAssignmentTarget

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DeviceAndAppManagementAssignmentTarget

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

Constructor Details

#initializeObject

Instantiates a new groupAssignmentTarget and sets the default values.



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

def initialize()
    super
    @odata_type = "#microsoft.graph.groupAssignmentTarget"
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 group_assignment_target

Raises:

  • (StandardError)


27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/models/group_assignment_target.rb', line 27

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.exclusionGroupAssignmentTarget"
                return ExclusionGroupAssignmentTarget.new
        end
    end
    return GroupAssignmentTarget.new
end

Instance Method Details

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



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

def get_field_deserializers()
    return super.merge({
        "groupId" => lambda {|n| @group_id = n.get_string_value() },
    })
end

#group_idObject

Gets the groupId property value. The group Id that is the target of the assignment.

Returns:

  • a string



52
53
54
# File 'lib/models/group_assignment_target.rb', line 52

def group_id
    return @group_id
end

#group_id=(value) ⇒ Object

Sets the groupId property value. The group Id that is the target of the assignment.

Parameters:

  • value

    Value to set for the groupId property.

Returns:

  • a void



60
61
62
# File 'lib/models/group_assignment_target.rb', line 60

def group_id=(value)
    @group_id = 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)


68
69
70
71
72
# File 'lib/models/group_assignment_target.rb', line 68

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_string_value("groupId", @group_id)
end