// 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;

/** Savings plan purchase details. */
@Fluent
public final class SavingsPlanToPurchaseExchange {
    /*
     * Fully qualified id of the savings plan order being purchased
     */
    @JsonProperty(value = "savingsPlanOrderId")
    private String savingsPlanOrderId;

    /*
     * Fully qualified id of the savings plan being purchased. This value is only guaranteed to be non-null if the
     * purchase is successful.
     */
    @JsonProperty(value = "savingsPlanId")
    private String savingsPlanId;

    /*
     * Request body for savings plan purchase
     */
    @JsonProperty(value = "properties")
    private SavingsPlanPurchaseRequest properties;

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

    /*
     * Status of the individual operation.
     */
    @JsonProperty(value = "status")
    private OperationStatus status;

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

    /**
     * Get the savingsPlanOrderId property: Fully qualified id of the savings plan order being purchased.
     *
     * @return the savingsPlanOrderId value.
     */
    public String savingsPlanOrderId() {
        return this.savingsPlanOrderId;
    }

    /**
     * Set the savingsPlanOrderId property: Fully qualified id of the savings plan order being purchased.
     *
     * @param savingsPlanOrderId the savingsPlanOrderId value to set.
     * @return the SavingsPlanToPurchaseExchange object itself.
     */
    public SavingsPlanToPurchaseExchange withSavingsPlanOrderId(String savingsPlanOrderId) {
        this.savingsPlanOrderId = savingsPlanOrderId;
        return this;
    }

    /**
     * Get the savingsPlanId property: Fully qualified id of the savings plan being purchased. This value is only
     * guaranteed to be non-null if the purchase is successful.
     *
     * @return the savingsPlanId value.
     */
    public String savingsPlanId() {
        return this.savingsPlanId;
    }

    /**
     * Set the savingsPlanId property: Fully qualified id of the savings plan being purchased. This value is only
     * guaranteed to be non-null if the purchase is successful.
     *
     * @param savingsPlanId the savingsPlanId value to set.
     * @return the SavingsPlanToPurchaseExchange object itself.
     */
    public SavingsPlanToPurchaseExchange withSavingsPlanId(String savingsPlanId) {
        this.savingsPlanId = savingsPlanId;
        return this;
    }

    /**
     * Get the properties property: Request body for savings plan purchase.
     *
     * @return the properties value.
     */
    public SavingsPlanPurchaseRequest properties() {
        return this.properties;
    }

    /**
     * Set the properties property: Request body for savings plan purchase.
     *
     * @param properties the properties value to set.
     * @return the SavingsPlanToPurchaseExchange object itself.
     */
    public SavingsPlanToPurchaseExchange withProperties(SavingsPlanPurchaseRequest properties) {
        this.properties = properties;
        return this;
    }

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

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

    /**
     * Get the status property: Status of the individual operation.
     *
     * @return the status value.
     */
    public OperationStatus status() {
        return this.status;
    }

    /**
     * Set the status property: Status of the individual operation.
     *
     * @param status the status value to set.
     * @return the SavingsPlanToPurchaseExchange object itself.
     */
    public SavingsPlanToPurchaseExchange withStatus(OperationStatus status) {
        this.status = status;
        return this;
    }

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