MongoUserDefinitionResource Class

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

Implements

public final class MongoUserDefinitionResource
implements JsonSerializable<MongoUserDefinitionResource>

Azure Cosmos DB Mongo User Definition resource object.

Constructor Summary

Constructor Description
MongoUserDefinitionResource()

Creates an instance of MongoUserDefinitionResource class.

Method Summary

Modifier and Type Method and Description
String customData()

Get the customData property: A custom definition for the USer Definition.

String databaseName()

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

static MongoUserDefinitionResource fromJson(JsonReader jsonReader)

Reads an instance of MongoUserDefinitionResource from the JsonReader.

String mechanisms()

Get the mechanisms property: The Mongo Auth mechanism.

String password()

Get the password property: The password for User Definition.

List<Role> roles()

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

JsonWriter toJson(JsonWriter jsonWriter)
String username()

Get the username property: The user name for User Definition.

void validate()

Validates the instance.

MongoUserDefinitionResource withCustomData(String customData)

Set the customData property: A custom definition for the USer Definition.

MongoUserDefinitionResource withDatabaseName(String databaseName)

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

MongoUserDefinitionResource withMechanisms(String mechanisms)

Set the mechanisms property: The Mongo Auth mechanism.

MongoUserDefinitionResource withPassword(String password)

Set the password property: The password for User Definition.

MongoUserDefinitionResource withRoles(List<Role> roles)

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

MongoUserDefinitionResource withUsername(String username)

Set the username property: The user name for User Definition.

Methods inherited from java.lang.Object

Constructor Details

MongoUserDefinitionResource

public MongoUserDefinitionResource()

Creates an instance of MongoUserDefinitionResource class.

Method Details

customData

public String customData()

Get the customData property: A custom definition for the USer Definition.

Returns:

the customData value.

databaseName

public String databaseName()

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

Returns:

the databaseName value.

fromJson

public static MongoUserDefinitionResource fromJson(JsonReader jsonReader)

Reads an instance of MongoUserDefinitionResource from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

mechanisms

public String mechanisms()

Get the mechanisms property: The Mongo Auth mechanism. For now, we only support auth mechanism SCRAM-SHA-256.

Returns:

the mechanisms value.

password

public String password()

Get the password property: The password for User Definition. Response does not contain user password.

Returns:

the password value.

roles

public List<Role> roles()

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

Returns:

the roles value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

username

public String username()

Get the username property: The user name for User Definition.

Returns:

the username value.

validate

public void validate()

Validates the instance.

withCustomData

public MongoUserDefinitionResource withCustomData(String customData)

Set the customData property: A custom definition for the USer Definition.

Parameters:

customData - the customData value to set.

Returns:

the MongoUserDefinitionResource object itself.

withDatabaseName

public MongoUserDefinitionResource withDatabaseName(String databaseName)

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

Parameters:

databaseName - the databaseName value to set.

Returns:

the MongoUserDefinitionResource object itself.

withMechanisms

public MongoUserDefinitionResource withMechanisms(String mechanisms)

Set the mechanisms property: The Mongo Auth mechanism. For now, we only support auth mechanism SCRAM-SHA-256.

Parameters:

mechanisms - the mechanisms value to set.

Returns:

the MongoUserDefinitionResource object itself.

withPassword

public MongoUserDefinitionResource withPassword(String password)

Set the password property: The password for User Definition. Response does not contain user password.

Parameters:

password - the password value to set.

Returns:

the MongoUserDefinitionResource object itself.

withRoles

public MongoUserDefinitionResource withRoles(List<Role> roles)

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

Parameters:

roles - the roles value to set.

Returns:

the MongoUserDefinitionResource object itself.

withUsername

public MongoUserDefinitionResource withUsername(String username)

Set the username property: The user name for User Definition.

Parameters:

username - the username value to set.

Returns:

the MongoUserDefinitionResource object itself.

Applies to