// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.reservations.models.AppliedReservationList;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The response for applied reservations api. */
@Fluent
public final class AppliedReservationsInner {
    /*
     * Identifier of the applied reservations
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * Name of resource
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Type of resource. "Microsoft.Capacity/AppliedReservations"
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /*
     * Properties for applied reservations returned
     */
    @JsonProperty(value = "properties")
    private AppliedReservationsProperties innerProperties;

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

    /**
     * Get the id property: Identifier of the applied reservations.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Get the name property: Name of resource.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the type property: Type of resource. "Microsoft.Capacity/AppliedReservations".
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Get the innerProperties property: Properties for applied reservations returned.
     *
     * @return the innerProperties value.
     */
    private AppliedReservationsProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the reservationOrderIds property: Paginated list of applied reservations.
     *
     * @return the reservationOrderIds value.
     */
    public AppliedReservationList reservationOrderIds() {
        return this.innerProperties() == null ? null : this.innerProperties().reservationOrderIds();
    }

    /**
     * Set the reservationOrderIds property: Paginated list of applied reservations.
     *
     * @param reservationOrderIds the reservationOrderIds value to set.
     * @return the AppliedReservationsInner object itself.
     */
    public AppliedReservationsInner withReservationOrderIds(AppliedReservationList reservationOrderIds) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AppliedReservationsProperties();
        }
        this.innerProperties().withReservationOrderIds(reservationOrderIds);
        return this;
    }

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