// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.reservations.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Reservation refund details. */
@Fluent
public final class ReservationToExchange {
    /*
     * Fully qualified id of the reservation being returned.
     */
    @JsonProperty(value = "reservationId")
    private String reservationId;

    /*
     * Quantity to be returned
     */
    @JsonProperty(value = "quantity")
    private Integer quantity;

    /*
     * Pricing information containing the amount and the currency code
     */
    @JsonProperty(value = "billingRefundAmount")
    private Price billingRefundAmount;

    /*
     * billing information
     */
    @JsonProperty(value = "billingInformation")
    private BillingInformation billingInformation;

    /** Creates an instance of ReservationToExchange class. */
    public ReservationToExchange() {
    }

    /**
     * Get the reservationId property: Fully qualified id of the reservation being returned.
     *
     * @return the reservationId value.
     */
    public String reservationId() {
        return this.reservationId;
    }

    /**
     * Set the reservationId property: Fully qualified id of the reservation being returned.
     *
     * @param reservationId the reservationId value to set.
     * @return the ReservationToExchange object itself.
     */
    public ReservationToExchange withReservationId(String reservationId) {
        this.reservationId = reservationId;
        return this;
    }

    /**
     * Get the quantity property: Quantity to be returned.
     *
     * @return the quantity value.
     */
    public Integer quantity() {
        return this.quantity;
    }

    /**
     * Set the quantity property: Quantity to be returned.
     *
     * @param quantity the quantity value to set.
     * @return the ReservationToExchange object itself.
     */
    public ReservationToExchange withQuantity(Integer quantity) {
        this.quantity = quantity;
        return this;
    }

    /**
     * Get the billingRefundAmount property: Pricing information containing the amount and the currency code.
     *
     * @return the billingRefundAmount value.
     */
    public Price billingRefundAmount() {
        return this.billingRefundAmount;
    }

    /**
     * Set the billingRefundAmount property: Pricing information containing the amount and the currency code.
     *
     * @param billingRefundAmount the billingRefundAmount value to set.
     * @return the ReservationToExchange object itself.
     */
    public ReservationToExchange withBillingRefundAmount(Price billingRefundAmount) {
        this.billingRefundAmount = billingRefundAmount;
        return this;
    }

    /**
     * Get the billingInformation property: billing information.
     *
     * @return the billingInformation value.
     */
    public BillingInformation billingInformation() {
        return this.billingInformation;
    }

    /**
     * Set the billingInformation property: billing information.
     *
     * @param billingInformation the billingInformation value to set.
     * @return the ReservationToExchange object itself.
     */
    public ReservationToExchange withBillingInformation(BillingInformation billingInformation) {
        this.billingInformation = billingInformation;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (billingRefundAmount() != null) {
            billingRefundAmount().validate();
        }
        if (billingInformation() != null) {
            billingInformation().validate();
        }
    }
}
