Class RoleDefinition

java.lang.Object
com.azure.resourcemanager.resources.models.RoleDefinition
All Implemented Interfaces:
com.azure.json.JsonSerializable<RoleDefinition>

public final class RoleDefinition extends Object implements com.azure.json.JsonSerializable<RoleDefinition>
Role definition properties.
  • Constructor Details

    • RoleDefinition

      public RoleDefinition()
      Creates an instance of RoleDefinition class.
  • Method Details

    • id

      public String id()
      Get the id property: The role definition ID.
      Returns:
      the id value.
    • withId

      public RoleDefinition withId(String id)
      Set the id property: The role definition ID.
      Parameters:
      id - the id value to set.
      Returns:
      the RoleDefinition object itself.
    • name

      public String name()
      Get the name property: The role definition name.
      Returns:
      the name value.
    • withName

      public RoleDefinition withName(String name)
      Set the name property: The role definition name.
      Parameters:
      name - the name value to set.
      Returns:
      the RoleDefinition object itself.
    • isServiceRole

      public Boolean isServiceRole()
      Get the isServiceRole property: If this is a service role.
      Returns:
      the isServiceRole value.
    • withIsServiceRole

      public RoleDefinition withIsServiceRole(Boolean isServiceRole)
      Set the isServiceRole property: If this is a service role.
      Parameters:
      isServiceRole - the isServiceRole value to set.
      Returns:
      the RoleDefinition object itself.
    • permissions

      public List<Permission> permissions()
      Get the permissions property: Role definition permissions.
      Returns:
      the permissions value.
    • withPermissions

      public RoleDefinition withPermissions(List<Permission> permissions)
      Set the permissions property: Role definition permissions.
      Parameters:
      permissions - the permissions value to set.
      Returns:
      the RoleDefinition object itself.
    • scopes

      public List<String> scopes()
      Get the scopes property: Role definition assignable scopes.
      Returns:
      the scopes value.
    • withScopes

      public RoleDefinition withScopes(List<String> scopes)
      Set the scopes property: Role definition assignable scopes.
      Parameters:
      scopes - the scopes value to set.
      Returns:
      the RoleDefinition object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<RoleDefinition>
      Throws:
      IOException
    • fromJson

      public static RoleDefinition fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of RoleDefinition from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of RoleDefinition if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the RoleDefinition.