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

/** Commitment towards the benefit. */
@Fluent
public final class Commitment extends Price {
    /*
     * Commitment grain.
     */
    @JsonProperty(value = "grain")
    private CommitmentGrain grain;

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

    /**
     * Get the grain property: Commitment grain.
     *
     * @return the grain value.
     */
    public CommitmentGrain grain() {
        return this.grain;
    }

    /**
     * Set the grain property: Commitment grain.
     *
     * @param grain the grain value to set.
     * @return the Commitment object itself.
     */
    public Commitment withGrain(CommitmentGrain grain) {
        this.grain = grain;
        return this;
    }

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

    /** {@inheritDoc} */
    @Override
    public Commitment 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();
    }
}
