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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RoleDefinitionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of RoleDefinition from the JsonReader.id()Get the id property: The role definition ID.Get the isServiceRole property: If this is a service role.name()Get the name property: The role definition name.Get the permissions property: Role definition permissions.scopes()Get the scopes property: Role definition assignable scopes.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.Set the id property: The role definition ID.withIsServiceRole(Boolean isServiceRole) Set the isServiceRole property: If this is a service role.Set the name property: The role definition name.withPermissions(List<Permission> permissions) Set the permissions property: Role definition permissions.withScopes(List<String> scopes) Set the scopes property: Role definition assignable scopes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
RoleDefinition
public RoleDefinition()Creates an instance of RoleDefinition class.
-
-
Method Details
-
id
Get the id property: The role definition ID.- Returns:
- the id value.
-
withId
Set the id property: The role definition ID.- Parameters:
id- the id value to set.- Returns:
- the RoleDefinition object itself.
-
name
Get the name property: The role definition name.- Returns:
- the name value.
-
withName
Set the name property: The role definition name.- Parameters:
name- the name value to set.- Returns:
- the RoleDefinition object itself.
-
isServiceRole
Get the isServiceRole property: If this is a service role.- Returns:
- the isServiceRole value.
-
withIsServiceRole
Set the isServiceRole property: If this is a service role.- Parameters:
isServiceRole- the isServiceRole value to set.- Returns:
- the RoleDefinition object itself.
-
permissions
Get the permissions property: Role definition permissions.- Returns:
- the permissions value.
-
withPermissions
Set the permissions property: Role definition permissions.- Parameters:
permissions- the permissions value to set.- Returns:
- the RoleDefinition object itself.
-
scopes
Get the scopes property: Role definition assignable scopes.- Returns:
- the scopes value.
-
withScopes
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
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<RoleDefinition>- Throws:
IOException
-
fromJson
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.
-