Class RoleDefinition

  • All Implemented Interfaces:
    com.github.davidmoten.odata.client.ODataEntityType, com.github.davidmoten.odata.client.ODataType
    Direct Known Subclasses:
    DeviceAndAppManagementRoleDefinition

    public class RoleDefinition
    extends Entity
    implements com.github.davidmoten.odata.client.ODataEntityType
    “The Role Definition resource. The role definition is the foundation of role based access in Intune. The role combines an Intune resource such as a Mobile App and associated role permissions such as Create or Read for the resource. There are two types of roles, built-in and custom. Built-in roles cannot be modified. Both built-in roles and custom roles must have assignments to be enforced. Create custom roles if you want to define a role that allows any of the available resources and role permissions to be combined into a single role.”
    • Constructor Detail

      • RoleDefinition

        protected RoleDefinition()
    • Method Detail

      • odataTypeName

        public String odataTypeName()
        Specified by:
        odataTypeName in interface com.github.davidmoten.odata.client.ODataType
        Overrides:
        odataTypeName in class Entity
      • builderRoleDefinition

        public static RoleDefinition.Builder builderRoleDefinition()
        Returns a builder which is used to create a new instance of this class (given that this class is immutable).
        Returns:
        a new Builder for this class
      • getChangedFields

        public com.github.davidmoten.odata.client.internal.ChangedFields getChangedFields()
        Specified by:
        getChangedFields in interface com.github.davidmoten.odata.client.ODataEntityType
        Overrides:
        getChangedFields in class Entity
      • postInject

        public void postInject​(boolean addKeysToContextPath)
        Specified by:
        postInject in interface com.github.davidmoten.odata.client.ODataType
        Overrides:
        postInject in class Entity
      • getDescription

        public Optional<String> getDescription()
        “Description of the Role definition.”
        Returns:
        property description
      • withDescription

        public RoleDefinition withDescription​(String description)
        Returns an immutable copy of this with just the description field changed. Field description below. The field name is also added to an internal map of changed fields in the returned object so that when this. patch() is called (if available)on the returned object only the changed fields are submitted.

        “Description of the Role definition.”

        Parameters:
        description - new value of description field (as defined in service metadata)
        Returns:
        immutable copy of this with just the description field changed
      • getDisplayName

        public Optional<String> getDisplayName()
        “Display Name of the Role definition.”
        Returns:
        property displayName
      • withDisplayName

        public RoleDefinition withDisplayName​(String displayName)
        Returns an immutable copy of this with just the displayName field changed. Field description below. The field name is also added to an internal map of changed fields in the returned object so that when this. patch() is called (if available)on the returned object only the changed fields are submitted.

        “Display Name of the Role definition.”

        Parameters:
        displayName - new value of displayName field (as defined in service metadata)
        Returns:
        immutable copy of this with just the displayName field changed
      • getIsBuiltIn

        public Optional<Boolean> getIsBuiltIn()
        “Type of Role. Set to True if it is built-in, or set to False if it is a custom role definition.”
        Returns:
        property isBuiltIn
      • withIsBuiltIn

        public RoleDefinition withIsBuiltIn​(Boolean isBuiltIn)
        Returns an immutable copy of this with just the isBuiltIn field changed. Field description below. The field name is also added to an internal map of changed fields in the returned object so that when this.patch() is called (if available)on the returned object only the changed fields are submitted.

        “Type of Role. Set to True if it is built-in, or set to False if it is a custom role definition.”

        Parameters:
        isBuiltIn - new value of isBuiltIn field (as defined in service metadata)
        Returns:
        immutable copy of this with just the isBuiltIn field changed
      • getRolePermissions

        public com.github.davidmoten.odata.client.CollectionPage<RolePermission> getRolePermissions()
        “List of Role Permissions this role is allowed to perform. These must match the actionName that is defined as part of the rolePermission.”
        Returns:
        property rolePermissions
      • withRolePermissions

        public RoleDefinition withRolePermissions​(List<RolePermission> rolePermissions)
        Returns an immutable copy of this with just the rolePermissions field changed. Field description below. The field name is also added to an internal map of changed fields in the returned object so that when this. patch() is called (if available)on the returned object only the changed fields are submitted.

        “List of Role Permissions this role is allowed to perform. These must match the actionName that is defined as part of the rolePermission.”

        Parameters:
        rolePermissions - new value of rolePermissions field (as defined in service metadata)
        Returns:
        immutable copy of this with just the rolePermissions field changed
      • getRolePermissions

        public com.github.davidmoten.odata.client.CollectionPage<RolePermission> getRolePermissions​(com.github.davidmoten.odata.client.HttpRequestOptions options)
        “List of Role Permissions this role is allowed to perform. These must match the actionName that is defined as part of the rolePermission.”
        Parameters:
        options - specify connect and read timeouts
        Returns:
        property rolePermissions
      • getRoleAssignments

        public RoleAssignmentCollectionRequest getRoleAssignments()
        “List of Role assignments for this role definition.”
        Returns:
        navigational property roleAssignments
      • withRoleAssignments

        public RoleDefinition withRoleAssignments​(List<RoleAssignment> roleAssignments)
        Returns an immutable copy of this with just the roleAssignments field changed. Field description below. The field name is also added to an internal map of changed fields in the returned object so that when this. patch() is called (if available)on the returned object only the changed fields are submitted.

        “List of Role assignments for this role definition.”

        Parameters:
        roleAssignments - new value of roleAssignments field (as defined in service metadata)
        Returns:
        immutable copy of this with just the roleAssignments field changed
      • getUnmappedFields

        public com.github.davidmoten.odata.client.UnmappedFields getUnmappedFields()
        Specified by:
        getUnmappedFields in interface com.github.davidmoten.odata.client.ODataType
        Overrides:
        getUnmappedFields in class Entity
      • patch

        public RoleDefinition patch()
        Submits only changed fields for update and returns an immutable copy of this with changed fields reset.
        Overrides:
        patch in class Entity
        Returns:
        a copy of this with changed fields reset
        Throws:
        com.github.davidmoten.odata.client.ClientException - if HTTP response is not as expected
      • put

        public RoleDefinition put()
        Submits all fields for update and returns an immutable copy of this with changed fields reset (they were ignored anyway).
        Overrides:
        put in class Entity
        Returns:
        a copy of this with changed fields reset
        Throws:
        com.github.davidmoten.odata.client.ClientException - if HTTP response is not as expected