Class: MicrosoftGraph::Models::DirectoryRole

Inherits:
DirectoryObject show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/directory_role.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DirectoryObject

#deleted_date_time, #deleted_date_time=

Methods inherited from Entity

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

Constructor Details

#initializeObject

Instantiates a new directoryRole and sets the default values.



28
29
30
31
# File 'lib/models/directory_role.rb', line 28

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

Raises:

  • (StandardError)


37
38
39
40
# File 'lib/models/directory_role.rb', line 37

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

Instance Method Details

#descriptionObject

Gets the description property value. The description for the directory role. Read-only. Supports $filter (eq), $search, $select.

Returns:

  • a string



45
46
47
# File 'lib/models/directory_role.rb', line 45

def description
    return @description
end

#description=(value) ⇒ Object

Sets the description property value. The description for the directory role. Read-only. Supports $filter (eq), $search, $select.

Parameters:

  • value

    Value to set for the description property.

Returns:

  • a void



53
54
55
# File 'lib/models/directory_role.rb', line 53

def description=(value)
    @description = value
end

#display_nameObject

Gets the displayName property value. The display name for the directory role. Read-only. Supports $filter (eq), $search, $select.

Returns:

  • a string



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

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. The display name for the directory role. Read-only. Supports $filter (eq), $search, $select.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



68
69
70
# File 'lib/models/directory_role.rb', line 68

def display_name=(value)
    @display_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



75
76
77
78
79
80
81
82
83
# File 'lib/models/directory_role.rb', line 75

def get_field_deserializers()
    return super.merge({
        "description" => lambda {|n| @description = n.get_string_value() },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "members" => lambda {|n| @members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },
        "roleTemplateId" => lambda {|n| @role_template_id = n.get_string_value() },
        "scopedMembers" => lambda {|n| @scoped_members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ScopedRoleMembership.create_from_discriminator_value(pn) }) },
    })
end

#membersObject

Gets the members property value. Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. Read-only. Nullable. Supports $expand.

Returns:

  • a directory_object



88
89
90
# File 'lib/models/directory_role.rb', line 88

def members
    return @members
end

#members=(value) ⇒ Object

Sets the members property value. Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. Read-only. Nullable. Supports $expand.

Parameters:

  • value

    Value to set for the members property.

Returns:

  • a void



96
97
98
# File 'lib/models/directory_role.rb', line 96

def members=(value)
    @members = value
end

#role_template_idObject

Gets the roleTemplateId property value. The id of the directoryRoleTemplate that this role is based on. The property must be specified when activating a directory role in a tenant with a POST operation. After the directory role has been activated, the property is read only. Supports $filter (eq), $select.

Returns:

  • a string



103
104
105
# File 'lib/models/directory_role.rb', line 103

def role_template_id
    return @role_template_id
end

#role_template_id=(value) ⇒ Object

Sets the roleTemplateId property value. The id of the directoryRoleTemplate that this role is based on. The property must be specified when activating a directory role in a tenant with a POST operation. After the directory role has been activated, the property is read only. Supports $filter (eq), $select.

Parameters:

  • value

    Value to set for the roleTemplateId property.

Returns:

  • a void



111
112
113
# File 'lib/models/directory_role.rb', line 111

def role_template_id=(value)
    @role_template_id = value
end

#scoped_membersObject

Gets the scopedMembers property value. Members of this directory role that are scoped to administrative units. Read-only. Nullable.

Returns:

  • a scoped_role_membership



118
119
120
# File 'lib/models/directory_role.rb', line 118

def scoped_members
    return @scoped_members
end

#scoped_members=(value) ⇒ Object

Sets the scopedMembers property value. Members of this directory role that are scoped to administrative units. Read-only. Nullable.

Parameters:

  • value

    Value to set for the scopedMembers property.

Returns:

  • a void



126
127
128
# File 'lib/models/directory_role.rb', line 126

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


134
135
136
137
138
139
140
141
142
# File 'lib/models/directory_role.rb', line 134

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_string_value("description", @description)
    writer.write_string_value("displayName", @display_name)
    writer.write_collection_of_object_values("members", @members)
    writer.write_string_value("roleTemplateId", @role_template_id)
    writer.write_collection_of_object_values("scopedMembers", @scoped_members)
end