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

package com.azure.resourcemanager.billingbenefits.models;

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

/** The PricingCurrencyTotal model. */
@Fluent
public final class PricingCurrencyTotal extends Price {
    /*
     * Represents either billing plan or savings plan term in ISO 8601 format.
     */
    @JsonProperty(value = "duration")
    private PricingCurrencyDuration duration;

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

    /**
     * Get the duration property: Represents either billing plan or savings plan term in ISO 8601 format.
     *
     * @return the duration value.
     */
    public PricingCurrencyDuration duration() {
        return this.duration;
    }

    /**
     * Set the duration property: Represents either billing plan or savings plan term in ISO 8601 format.
     *
     * @param duration the duration value to set.
     * @return the PricingCurrencyTotal object itself.
     */
    public PricingCurrencyTotal withDuration(PricingCurrencyDuration duration) {
        this.duration = duration;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public PricingCurrencyTotal withCurrencyCode(String currencyCode) {
        super.withCurrencyCode(currencyCode);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public PricingCurrencyTotal withAmount(Double amount) {
        super.withAmount(amount);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}
