Class ReservationSwapProperties
java.lang.Object
com.azure.resourcemanager.reservations.models.ReservationSwapProperties
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ReservationSwapProperties>
public final class ReservationSwapProperties
extends Object
implements com.azure.json.JsonSerializable<ReservationSwapProperties>
Properties of reservation swap.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of ReservationSwapProperties class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReservationSwapProperties
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of ReservationSwapProperties from the JsonReader.Get the swapDestination property: Reservation resource id that the original resource gets swapped to.Get the swapSource property: Resource id of the source reservation that gets swapped.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withSwapDestination
(String swapDestination) Set the swapDestination property: Reservation resource id that the original resource gets swapped to.withSwapSource
(String swapSource) Set the swapSource property: Resource id of the source reservation that gets swapped.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ReservationSwapProperties
public ReservationSwapProperties()Creates an instance of ReservationSwapProperties class.
-
-
Method Details
-
swapSource
Get the swapSource property: Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.- Returns:
- the swapSource value.
-
withSwapSource
Set the swapSource property: Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.- Parameters:
swapSource
- the swapSource value to set.- Returns:
- the ReservationSwapProperties object itself.
-
swapDestination
Get the swapDestination property: Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.- Returns:
- the swapDestination value.
-
withSwapDestination
Set the swapDestination property: Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.- Parameters:
swapDestination
- the swapDestination value to set.- Returns:
- the ReservationSwapProperties object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<ReservationSwapProperties>
- Throws:
IOException
-
fromJson
public static ReservationSwapProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ReservationSwapProperties from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of ReservationSwapProperties 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 ReservationSwapProperties.
-