// 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.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.reservations.models.Kind;
import com.azure.resourcemanager.reservations.models.ReservationsProperties;
import com.azure.resourcemanager.reservations.models.SkuName;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The definition of the reservation. */
@Fluent
public final class ReservationResponseInner extends ProxyResource {
    /*
     * The Azure region where the reserved resource lives.
     */
    @JsonProperty(value = "location")
    private String location;

    /*
     * The etag property.
     */
    @JsonProperty(value = "etag")
    private Integer etag;

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

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

    /*
     * Resource Provider type to be reserved.
     */
    @JsonProperty(value = "kind")
    private Kind kind;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the location property: The Azure region where the reserved resource lives.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: The Azure region where the reserved resource lives.
     *
     * @param location the location value to set.
     * @return the ReservationResponseInner object itself.
     */
    public ReservationResponseInner withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the etag property: The etag property.
     *
     * @return the etag value.
     */
    public Integer etag() {
        return this.etag;
    }

    /**
     * Set the etag property: The etag property.
     *
     * @param etag the etag value to set.
     * @return the ReservationResponseInner object itself.
     */
    public ReservationResponseInner withEtag(Integer etag) {
        this.etag = etag;
        return this;
    }

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

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

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

    /**
     * Set the properties property: The properties associated to this reservation.
     *
     * @param properties the properties value to set.
     * @return the ReservationResponseInner object itself.
     */
    public ReservationResponseInner withProperties(ReservationsProperties properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Get the kind property: Resource Provider type to be reserved.
     *
     * @return the kind value.
     */
    public Kind kind() {
        return this.kind;
    }

    /**
     * Set the kind property: Resource Provider type to be reserved.
     *
     * @param kind the kind value to set.
     * @return the ReservationResponseInner object itself.
     */
    public ReservationResponseInner withKind(Kind kind) {
        this.kind = kind;
        return this;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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