Compartilhar via


RoleDefinition Class

  • java.lang.Object
    • com.azure.resourcemanager.resources.models.RoleDefinition

Implements

public final class RoleDefinition
implements JsonSerializable<RoleDefinition>

Role definition properties.

Constructor Summary

Constructor Description
RoleDefinition()

Creates an instance of RoleDefinition class.

Method Summary

Modifier and Type Method and Description
static RoleDefinition fromJson(JsonReader jsonReader)

Reads an instance of RoleDefinition from the JsonReader.

String id()

Get the id property: The role definition ID.

Boolean isServiceRole()

Get the isServiceRole property: If this is a service role.

String name()

Get the name property: The role definition name.

List<Permission> permissions()

Get the permissions property: Role definition permissions.

List<String> scopes()

Get the scopes property: Role definition assignable scopes.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

RoleDefinition withId(String id)

Set the id property: The role definition ID.

RoleDefinition withIsServiceRole(Boolean isServiceRole)

Set the isServiceRole property: If this is a service role.

RoleDefinition withName(String name)

Set the name property: The role definition name.

RoleDefinition withPermissions(List<Permission> permissions)

Set the permissions property: Role definition permissions.

RoleDefinition withScopes(List<String> scopes)

Set the scopes property: Role definition assignable scopes.

Methods inherited from java.lang.Object

Constructor Details

RoleDefinition

public RoleDefinition()

Creates an instance of RoleDefinition class.

Method Details

fromJson

public static RoleDefinition fromJson(JsonReader jsonReader)

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.

id

public String id()

Get the id property: The role definition ID.

Returns:

the id value.

isServiceRole

public Boolean isServiceRole()

Get the isServiceRole property: If this is a service role.

Returns:

the isServiceRole value.

name

public String name()

Get the name property: The role definition name.

Returns:

the name value.

permissions

public List permissions()

Get the permissions property: Role definition permissions.

Returns:

the permissions value.

scopes

public List scopes()

Get the scopes property: Role definition assignable scopes.

Returns:

the scopes value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

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.

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.

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.

withPermissions

public RoleDefinition withPermissions(List permissions)

Set the permissions property: Role definition permissions.

Parameters:

permissions - the permissions value to set.

Returns:

the RoleDefinition object itself.

withScopes

public RoleDefinition withScopes(List scopes)

Set the scopes property: Role definition assignable scopes.

Parameters:

scopes - the scopes value to set.

Returns:

the RoleDefinition object itself.

Applies to