DistributedAvailabilityGroupSetRole Class

  • java.lang.Object
    • com.azure.resourcemanager.sql.models.DistributedAvailabilityGroupSetRole

Implements

public final class DistributedAvailabilityGroupSetRole
implements JsonSerializable<DistributedAvailabilityGroupSetRole>

Distributed availability group failover request.

Constructor Summary

Constructor Description
DistributedAvailabilityGroupSetRole()

Creates an instance of DistributedAvailabilityGroupSetRole class.

Method Summary

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

Reads an instance of DistributedAvailabilityGroupSetRole from the JsonReader.

InstanceRole instanceRole()

Get the instanceRole property: New role of managed instance in a distributed availability group, can be Primary or Secondary.

RoleChangeType roleChangeType()

Get the roleChangeType property: The type of the role change, can be Planned or Forced.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

DistributedAvailabilityGroupSetRole withInstanceRole(InstanceRole instanceRole)

Set the instanceRole property: New role of managed instance in a distributed availability group, can be Primary or Secondary.

DistributedAvailabilityGroupSetRole withRoleChangeType(RoleChangeType roleChangeType)

Set the roleChangeType property: The type of the role change, can be Planned or Forced.

Methods inherited from java.lang.Object

Constructor Details

DistributedAvailabilityGroupSetRole

public DistributedAvailabilityGroupSetRole()

Creates an instance of DistributedAvailabilityGroupSetRole class.

Method Details

fromJson

public static DistributedAvailabilityGroupSetRole fromJson(JsonReader jsonReader)

Reads an instance of DistributedAvailabilityGroupSetRole from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of DistributedAvailabilityGroupSetRole if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

instanceRole

public InstanceRole instanceRole()

Get the instanceRole property: New role of managed instance in a distributed availability group, can be Primary or Secondary.

Returns:

the instanceRole value.

roleChangeType

public RoleChangeType roleChangeType()

Get the roleChangeType property: The type of the role change, can be Planned or Forced.

Returns:

the roleChangeType value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withInstanceRole

public DistributedAvailabilityGroupSetRole withInstanceRole(InstanceRole instanceRole)

Set the instanceRole property: New role of managed instance in a distributed availability group, can be Primary or Secondary.

Parameters:

instanceRole - the instanceRole value to set.

Returns:

the DistributedAvailabilityGroupSetRole object itself.

withRoleChangeType

public DistributedAvailabilityGroupSetRole withRoleChangeType(RoleChangeType roleChangeType)

Set the roleChangeType property: The type of the role change, can be Planned or Forced.

Parameters:

roleChangeType - the roleChangeType value to set.

Returns:

the DistributedAvailabilityGroupSetRole object itself.

Applies to