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 Details

    • ReservationSwapProperties

      public ReservationSwapProperties()
      Creates an instance of ReservationSwapProperties class.
  • Method Details

    • swapSource

      public String 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

      public ReservationSwapProperties withSwapSource(String swapSource)
      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

      public String 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

      public ReservationSwapProperties withSwapDestination(String swapDestination)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.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.