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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.billing.models.ReservationPropertyUtilization;
import com.azure.resourcemanager.billing.models.ReservationSkuProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The definition of the reservation. */
@Fluent
public final class ReservationInner {
    /*
     * The id of the reservation.
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

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

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

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

    /*
     * The sku information associated to this reservation
     */
    @JsonProperty(value = "sku")
    private ReservationSkuProperty sku;

    /*
     * The properties associated to this reservation
     */
    @JsonProperty(value = "properties")
    private ReservationProperty innerProperties;

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

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

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

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

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

    /**
     * Get the sku property: The sku information associated to this reservation.
     *
     * @return the sku value.
     */
    public ReservationSkuProperty sku() {
        return this.sku;
    }

    /**
     * Set the sku property: The sku information associated to this reservation.
     *
     * @param sku the sku value to set.
     * @return the ReservationInner object itself.
     */
    public ReservationInner withSku(ReservationSkuProperty sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the innerProperties property: The properties associated to this reservation.
     *
     * @return the innerProperties value.
     */
    private ReservationProperty innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is
     * in Shared scope.
     *
     * @return the appliedScopes value.
     */
    public List<String> appliedScopes() {
        return this.innerProperties() == null ? null : this.innerProperties().appliedScopes();
    }

    /**
     * Set the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is
     * in Shared scope.
     *
     * @param appliedScopes the appliedScopes value to set.
     * @return the ReservationInner object itself.
     */
    public ReservationInner withAppliedScopes(List<String> appliedScopes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ReservationProperty();
        }
        this.innerProperties().withAppliedScopes(appliedScopes);
        return this;
    }

    /**
     * Get the appliedScopeType property: The applied scope type of the reservation.
     *
     * @return the appliedScopeType value.
     */
    public String appliedScopeType() {
        return this.innerProperties() == null ? null : this.innerProperties().appliedScopeType();
    }

    /**
     * Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine.
     *
     * @return the reservedResourceType value.
     */
    public String reservedResourceType() {
        return this.innerProperties() == null ? null : this.innerProperties().reservedResourceType();
    }

    /**
     * Get the quantity property: The number of the reservation.
     *
     * @return the quantity value.
     */
    public Float quantity() {
        return this.innerProperties() == null ? null : this.innerProperties().quantity();
    }

    /**
     * Get the provisioningState property: The provisioning state of the reservation, e.g. Succeeded.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the expiryDate property: The expiry date of the reservation.
     *
     * @return the expiryDate value.
     */
    public String expiryDate() {
        return this.innerProperties() == null ? null : this.innerProperties().expiryDate();
    }

    /**
     * Get the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded.
     *
     * @return the provisioningSubState value.
     */
    public String provisioningSubState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningSubState();
    }

    /**
     * Get the displayName property: The display name of the reservation.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded.
     *
     * @return the displayProvisioningState value.
     */
    public String displayProvisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().displayProvisioningState();
    }

    /**
     * Get the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On.
     *
     * @return the userFriendlyRenewState value.
     */
    public String userFriendlyRenewState() {
        return this.innerProperties() == null ? null : this.innerProperties().userFriendlyRenewState();
    }

    /**
     * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g.
     * Shared.
     *
     * @return the userFriendlyAppliedScopeType value.
     */
    public String userFriendlyAppliedScopeType() {
        return this.innerProperties() == null ? null : this.innerProperties().userFriendlyAppliedScopeType();
    }

    /**
     * Get the effectiveDateTime property: The effective date time of the reservation.
     *
     * @return the effectiveDateTime value.
     */
    public String effectiveDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().effectiveDateTime();
    }

    /**
     * Get the skuDescription property: The sku description of the reservation.
     *
     * @return the skuDescription value.
     */
    public String skuDescription() {
        return this.innerProperties() == null ? null : this.innerProperties().skuDescription();
    }

    /**
     * Get the term property: The term of the reservation, e.g. P1Y.
     *
     * @return the term value.
     */
    public String term() {
        return this.innerProperties() == null ? null : this.innerProperties().term();
    }

    /**
     * Get the renew property: The renew state of the reservation.
     *
     * @return the renew value.
     */
    public Boolean renew() {
        return this.innerProperties() == null ? null : this.innerProperties().renew();
    }

    /**
     * Get the renewSource property: The renew source of the reservation.
     *
     * @return the renewSource value.
     */
    public String renewSource() {
        return this.innerProperties() == null ? null : this.innerProperties().renewSource();
    }

    /**
     * Get the utilization property: Reservation utilization.
     *
     * @return the utilization value.
     */
    public ReservationPropertyUtilization utilization() {
        return this.innerProperties() == null ? null : this.innerProperties().utilization();
    }

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