// 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.azure.resourcemanager.reservations.fluent.models.SplitProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The request for reservation split. */
@Fluent
public final class SplitRequest {
    /*
     * Properties for reservation split
     */
    @JsonProperty(value = "properties")
    private SplitProperties innerProperties;

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

    /**
     * Get the innerProperties property: Properties for reservation split.
     *
     * @return the innerProperties value.
     */
    private SplitProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the quantities property: List of the quantities in the new reservations to create.
     *
     * @return the quantities value.
     */
    public List<Integer> quantities() {
        return this.innerProperties() == null ? null : this.innerProperties().quantities();
    }

    /**
     * Set the quantities property: List of the quantities in the new reservations to create.
     *
     * @param quantities the quantities value to set.
     * @return the SplitRequest object itself.
     */
    public SplitRequest withQuantities(List<Integer> quantities) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SplitProperties();
        }
        this.innerProperties().withQuantities(quantities);
        return this;
    }

    /**
     * Get the reservationId property: Resource id of the reservation to be split. Format of the resource id should be
     * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
     *
     * @return the reservationId value.
     */
    public String reservationId() {
        return this.innerProperties() == null ? null : this.innerProperties().reservationId();
    }

    /**
     * Set the reservationId property: Resource id of the reservation to be split. Format of the resource id should be
     * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
     *
     * @param reservationId the reservationId value to set.
     * @return the SplitRequest object itself.
     */
    public SplitRequest withReservationId(String reservationId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SplitProperties();
        }
        this.innerProperties().withReservationId(reservationId);
        return this;
    }

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