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

package com.azure.resourcemanager.consumption.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.consumption.models.Amount;
import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate;
import com.azure.resourcemanager.consumption.models.LotSource;
import com.azure.resourcemanager.consumption.models.Reseller;
import com.azure.resourcemanager.consumption.models.Status;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** The lot properties. */
@Immutable
public final class LotProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(LotProperties.class);

    /*
     * The original amount of a lot.
     */
    @JsonProperty(value = "originalAmount", access = JsonProperty.Access.WRITE_ONLY)
    private Amount originalAmount;

    /*
     * The balance as of the last invoice.
     */
    @JsonProperty(value = "closedBalance", access = JsonProperty.Access.WRITE_ONLY)
    private Amount closedBalance;

    /*
     * The source of the lot.
     */
    @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY)
    private LotSource source;

    /*
     * The date when the lot became effective.
     */
    @JsonProperty(value = "startDate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime startDate;

    /*
     * The expiration date of a lot.
     */
    @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime expirationDate;

    /*
     * The po number of the invoice on which the lot was added. This property
     * is not available for ConsumptionCommitment lots.
     */
    @JsonProperty(value = "poNumber", access = JsonProperty.Access.WRITE_ONLY)
    private String poNumber;

    /*
     * The date when the lot was added.
     */
    @JsonProperty(value = "purchasedDate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime purchasedDate;

    /*
     * The status of the lot.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private Status status;

    /*
     * The currency of the lot.
     */
    @JsonProperty(value = "creditCurrency", access = JsonProperty.Access.WRITE_ONLY)
    private String creditCurrency;

    /*
     * The billing currency of the lot.
     */
    @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY)
    private String billingCurrency;

    /*
     * The original amount of a lot in billing currency.
     */
    @JsonProperty(value = "originalAmountInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY)
    private AmountWithExchangeRate originalAmountInBillingCurrency;

    /*
     * The balance as of the last invoice in billing currency.
     */
    @JsonProperty(value = "closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY)
    private AmountWithExchangeRate closedBalanceInBillingCurrency;

    /*
     * The reseller of the lot.
     */
    @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY)
    private Reseller reseller;

    /*
     * The eTag for the resource.
     */
    @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /**
     * Get the originalAmount property: The original amount of a lot.
     *
     * @return the originalAmount value.
     */
    public Amount originalAmount() {
        return this.originalAmount;
    }

    /**
     * Get the closedBalance property: The balance as of the last invoice.
     *
     * @return the closedBalance value.
     */
    public Amount closedBalance() {
        return this.closedBalance;
    }

    /**
     * Get the source property: The source of the lot.
     *
     * @return the source value.
     */
    public LotSource source() {
        return this.source;
    }

    /**
     * Get the startDate property: The date when the lot became effective.
     *
     * @return the startDate value.
     */
    public OffsetDateTime startDate() {
        return this.startDate;
    }

    /**
     * Get the expirationDate property: The expiration date of a lot.
     *
     * @return the expirationDate value.
     */
    public OffsetDateTime expirationDate() {
        return this.expirationDate;
    }

    /**
     * Get the poNumber property: The po number of the invoice on which the lot was added. This property is not
     * available for ConsumptionCommitment lots.
     *
     * @return the poNumber value.
     */
    public String poNumber() {
        return this.poNumber;
    }

    /**
     * Get the purchasedDate property: The date when the lot was added.
     *
     * @return the purchasedDate value.
     */
    public OffsetDateTime purchasedDate() {
        return this.purchasedDate;
    }

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

    /**
     * Get the creditCurrency property: The currency of the lot.
     *
     * @return the creditCurrency value.
     */
    public String creditCurrency() {
        return this.creditCurrency;
    }

    /**
     * Get the billingCurrency property: The billing currency of the lot.
     *
     * @return the billingCurrency value.
     */
    public String billingCurrency() {
        return this.billingCurrency;
    }

    /**
     * Get the originalAmountInBillingCurrency property: The original amount of a lot in billing currency.
     *
     * @return the originalAmountInBillingCurrency value.
     */
    public AmountWithExchangeRate originalAmountInBillingCurrency() {
        return this.originalAmountInBillingCurrency;
    }

    /**
     * Get the closedBalanceInBillingCurrency property: The balance as of the last invoice in billing currency.
     *
     * @return the closedBalanceInBillingCurrency value.
     */
    public AmountWithExchangeRate closedBalanceInBillingCurrency() {
        return this.closedBalanceInBillingCurrency;
    }

    /**
     * Get the reseller property: The reseller of the lot.
     *
     * @return the reseller value.
     */
    public Reseller reseller() {
        return this.reseller;
    }

    /**
     * Get the etag property: The eTag for the resource.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (originalAmount() != null) {
            originalAmount().validate();
        }
        if (closedBalance() != null) {
            closedBalance().validate();
        }
        if (originalAmountInBillingCurrency() != null) {
            originalAmountInBillingCurrency().validate();
        }
        if (closedBalanceInBillingCurrency() != null) {
            closedBalanceInBillingCurrency().validate();
        }
        if (reseller() != null) {
            reseller().validate();
        }
    }
}
