MongoRoleDefinitionResource Class

  • java.lang.Object
    • com.azure.resourcemanager.cosmos.fluent.models.MongoRoleDefinitionResource

Implements

public final class MongoRoleDefinitionResource
implements JsonSerializable<MongoRoleDefinitionResource>

Azure Cosmos DB Mongo Role Definition resource object.

Constructor Summary

Constructor Description
MongoRoleDefinitionResource()

Creates an instance of MongoRoleDefinitionResource class.

Method Summary

Modifier and Type Method and Description
String databaseName()

Get the databaseName property: The database name for which access is being granted for this Role Definition.

static MongoRoleDefinitionResource fromJson(JsonReader jsonReader)

Reads an instance of MongoRoleDefinitionResource from the JsonReader.

List<Privilege> privileges()

Get the privileges property: A set of privileges contained by the Role Definition.

String roleName()

Get the roleName property: A user-friendly name for the Role Definition.

List<Role> roles()

Get the roles property: The set of roles inherited by this Role Definition.

JsonWriter toJson(JsonWriter jsonWriter)
MongoRoleDefinitionType type()

Get the type property: Indicates whether the Role Definition was built-in or user created.

void validate()

Validates the instance.

MongoRoleDefinitionResource withDatabaseName(String databaseName)

Set the databaseName property: The database name for which access is being granted for this Role Definition.

MongoRoleDefinitionResource withPrivileges(List<Privilege> privileges)

Set the privileges property: A set of privileges contained by the Role Definition.

MongoRoleDefinitionResource withRoleName(String roleName)

Set the roleName property: A user-friendly name for the Role Definition.

MongoRoleDefinitionResource withRoles(List<Role> roles)

Set the roles property: The set of roles inherited by this Role Definition.

MongoRoleDefinitionResource withType(MongoRoleDefinitionType type)

Set the type property: Indicates whether the Role Definition was built-in or user created.

Methods inherited from java.lang.Object

Constructor Details

MongoRoleDefinitionResource

public MongoRoleDefinitionResource()

Creates an instance of MongoRoleDefinitionResource class.

Method Details

databaseName

public String databaseName()

Get the databaseName property: The database name for which access is being granted for this Role Definition.

Returns:

the databaseName value.

fromJson

public static MongoRoleDefinitionResource fromJson(JsonReader jsonReader)

Reads an instance of MongoRoleDefinitionResource from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MongoRoleDefinitionResource 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 MongoRoleDefinitionResource.

privileges

public List<Privilege> privileges()

Get the privileges property: A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than Database are not enforceable as privilege.

Returns:

the privileges value.

roleName

public String roleName()

Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account.

Returns:

the roleName value.

roles

public List<Role> roles()

Get the roles property: The set of roles inherited by this Role Definition.

Returns:

the roles value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public MongoRoleDefinitionType type()

Get the type property: Indicates whether the Role Definition was built-in or user created.

Returns:

the type value.

validate

public void validate()

Validates the instance.

withDatabaseName

public MongoRoleDefinitionResource withDatabaseName(String databaseName)

Set the databaseName property: The database name for which access is being granted for this Role Definition.

Parameters:

databaseName - the databaseName value to set.

Returns:

the MongoRoleDefinitionResource object itself.

withPrivileges

public MongoRoleDefinitionResource withPrivileges(List<Privilege> privileges)

Set the privileges property: A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than Database are not enforceable as privilege.

Parameters:

privileges - the privileges value to set.

Returns:

the MongoRoleDefinitionResource object itself.

withRoleName

public MongoRoleDefinitionResource withRoleName(String roleName)

Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account.

Parameters:

roleName - the roleName value to set.

Returns:

the MongoRoleDefinitionResource object itself.

withRoles

public MongoRoleDefinitionResource withRoles(List<Role> roles)

Set the roles property: The set of roles inherited by this Role Definition.

Parameters:

roles - the roles value to set.

Returns:

the MongoRoleDefinitionResource object itself.

withType

public MongoRoleDefinitionResource withType(MongoRoleDefinitionType type)

Set the type property: Indicates whether the Role Definition was built-in or user created.

Parameters:

type - the type value to set.

Returns:

the MongoRoleDefinitionResource object itself.

Applies to