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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.billingbenefits.models.AppliedScopeProperties;
import com.azure.resourcemanager.billingbenefits.models.AppliedScopeType;
import com.azure.resourcemanager.billingbenefits.models.BillingPlan;
import com.azure.resourcemanager.billingbenefits.models.ReservationOrderAliasRequestPropertiesReservedResourceProperties;
import com.azure.resourcemanager.billingbenefits.models.ReservedResourceType;
import com.azure.resourcemanager.billingbenefits.models.Term;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Reservation properties. */
@Fluent
public final class ReservationOrderAliasRequestProperties {
    /*
     * Display name
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * Subscription that will be charged for purchasing the benefit
     */
    @JsonProperty(value = "billingScopeId")
    private String billingScopeId;

    /*
     * Represent benefit term in ISO 8601 format.
     */
    @JsonProperty(value = "term")
    private Term term;

    /*
     * Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
     */
    @JsonProperty(value = "billingPlan")
    private BillingPlan billingPlan;

    /*
     * Type of the Applied Scope.
     */
    @JsonProperty(value = "appliedScopeType")
    private AppliedScopeType appliedScopeType;

    /*
     * Properties specific to applied scope type. Not required if not applicable.
     */
    @JsonProperty(value = "appliedScopeProperties")
    private AppliedScopeProperties appliedScopeProperties;

    /*
     * Total Quantity of the SKUs purchased in the Reservation.
     */
    @JsonProperty(value = "quantity")
    private Integer quantity;

    /*
     * Setting this to true will automatically purchase a new benefit on the expiration date time.
     */
    @JsonProperty(value = "renew")
    private Boolean renew;

    /*
     * The type of the resource that is being reserved.
     */
    @JsonProperty(value = "reservedResourceType")
    private ReservedResourceType reservedResourceType;

    /*
     * This is the date-time when the Azure Hybrid Benefit needs to be reviewed.
     */
    @JsonProperty(value = "reviewDateTime")
    private OffsetDateTime reviewDateTime;

    /*
     * Properties specific to each reserved resource type. Not required if not applicable.
     */
    @JsonProperty(value = "reservedResourceProperties")
    private ReservationOrderAliasRequestPropertiesReservedResourceProperties reservedResourceProperties;

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

    /**
     * Get the displayName property: Display name.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: Display name.
     *
     * @param displayName the displayName value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the billingScopeId property: Subscription that will be charged for purchasing the benefit.
     *
     * @return the billingScopeId value.
     */
    public String billingScopeId() {
        return this.billingScopeId;
    }

    /**
     * Set the billingScopeId property: Subscription that will be charged for purchasing the benefit.
     *
     * @param billingScopeId the billingScopeId value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withBillingScopeId(String billingScopeId) {
        this.billingScopeId = billingScopeId;
        return this;
    }

    /**
     * Get the term property: Represent benefit term in ISO 8601 format.
     *
     * @return the term value.
     */
    public Term term() {
        return this.term;
    }

    /**
     * Set the term property: Represent benefit term in ISO 8601 format.
     *
     * @param term the term value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withTerm(Term term) {
        this.term = term;
        return this;
    }

    /**
     * Get the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly billing
     * plans.
     *
     * @return the billingPlan value.
     */
    public BillingPlan billingPlan() {
        return this.billingPlan;
    }

    /**
     * Set the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly billing
     * plans.
     *
     * @param billingPlan the billingPlan value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withBillingPlan(BillingPlan billingPlan) {
        this.billingPlan = billingPlan;
        return this;
    }

    /**
     * Get the appliedScopeType property: Type of the Applied Scope.
     *
     * @return the appliedScopeType value.
     */
    public AppliedScopeType appliedScopeType() {
        return this.appliedScopeType;
    }

    /**
     * Set the appliedScopeType property: Type of the Applied Scope.
     *
     * @param appliedScopeType the appliedScopeType value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withAppliedScopeType(AppliedScopeType appliedScopeType) {
        this.appliedScopeType = appliedScopeType;
        return this;
    }

    /**
     * Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
     * applicable.
     *
     * @return the appliedScopeProperties value.
     */
    public AppliedScopeProperties appliedScopeProperties() {
        return this.appliedScopeProperties;
    }

    /**
     * Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
     * applicable.
     *
     * @param appliedScopeProperties the appliedScopeProperties value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withAppliedScopeProperties(
        AppliedScopeProperties appliedScopeProperties) {
        this.appliedScopeProperties = appliedScopeProperties;
        return this;
    }

    /**
     * Get the quantity property: Total Quantity of the SKUs purchased in the Reservation.
     *
     * @return the quantity value.
     */
    public Integer quantity() {
        return this.quantity;
    }

    /**
     * Set the quantity property: Total Quantity of the SKUs purchased in the Reservation.
     *
     * @param quantity the quantity value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withQuantity(Integer quantity) {
        this.quantity = quantity;
        return this;
    }

    /**
     * Get the renew property: Setting this to true will automatically purchase a new benefit on the expiration date
     * time.
     *
     * @return the renew value.
     */
    public Boolean renew() {
        return this.renew;
    }

    /**
     * Set the renew property: Setting this to true will automatically purchase a new benefit on the expiration date
     * time.
     *
     * @param renew the renew value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withRenew(Boolean renew) {
        this.renew = renew;
        return this;
    }

    /**
     * Get the reservedResourceType property: The type of the resource that is being reserved.
     *
     * @return the reservedResourceType value.
     */
    public ReservedResourceType reservedResourceType() {
        return this.reservedResourceType;
    }

    /**
     * Set the reservedResourceType property: The type of the resource that is being reserved.
     *
     * @param reservedResourceType the reservedResourceType value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withReservedResourceType(ReservedResourceType reservedResourceType) {
        this.reservedResourceType = reservedResourceType;
        return this;
    }

    /**
     * Get the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed.
     *
     * @return the reviewDateTime value.
     */
    public OffsetDateTime reviewDateTime() {
        return this.reviewDateTime;
    }

    /**
     * Set the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed.
     *
     * @param reviewDateTime the reviewDateTime value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withReviewDateTime(OffsetDateTime reviewDateTime) {
        this.reviewDateTime = reviewDateTime;
        return this;
    }

    /**
     * Get the reservedResourceProperties property: Properties specific to each reserved resource type. Not required if
     * not applicable.
     *
     * @return the reservedResourceProperties value.
     */
    public ReservationOrderAliasRequestPropertiesReservedResourceProperties reservedResourceProperties() {
        return this.reservedResourceProperties;
    }

    /**
     * Set the reservedResourceProperties property: Properties specific to each reserved resource type. Not required if
     * not applicable.
     *
     * @param reservedResourceProperties the reservedResourceProperties value to set.
     * @return the ReservationOrderAliasRequestProperties object itself.
     */
    public ReservationOrderAliasRequestProperties withReservedResourceProperties(
        ReservationOrderAliasRequestPropertiesReservedResourceProperties reservedResourceProperties) {
        this.reservedResourceProperties = reservedResourceProperties;
        return this;
    }

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