// 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.PatchProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

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

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

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

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

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

    /**
     * Get the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
     * AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for
     * Single AppliedScopeType.
     *
     * @return the appliedScopes value.
     */
    public List<String> appliedScopes() {
        return this.innerProperties() == null ? null : this.innerProperties().appliedScopes();
    }

    /**
     * Set the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
     * AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for
     * Single AppliedScopeType.
     *
     * @param appliedScopes the appliedScopes value to set.
     * @return the PatchModel object itself.
     */
    public PatchModel withAppliedScopes(List<String> appliedScopes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchProperties();
        }
        this.innerProperties().withAppliedScopes(appliedScopes);
        return this;
    }

    /**
     * Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
     * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
     *
     * @return the appliedScopeProperties value.
     */
    public AppliedScopeProperties appliedScopeProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().appliedScopeProperties();
    }

    /**
     * Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
     * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
     *
     * @param appliedScopeProperties the appliedScopeProperties value to set.
     * @return the PatchModel object itself.
     */
    public PatchModel withAppliedScopeProperties(AppliedScopeProperties appliedScopeProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchProperties();
        }
        this.innerProperties().withAppliedScopeProperties(appliedScopeProperties);
        return this;
    }

    /**
     * Get the instanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the
     * same VM size group. Only specify for VirtualMachines reserved resource type.
     *
     * @return the instanceFlexibility value.
     */
    public InstanceFlexibility instanceFlexibility() {
        return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibility();
    }

    /**
     * Set the instanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the
     * same VM size group. Only specify for VirtualMachines reserved resource type.
     *
     * @param instanceFlexibility the instanceFlexibility value to set.
     * @return the PatchModel object itself.
     */
    public PatchModel withInstanceFlexibility(InstanceFlexibility instanceFlexibility) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchProperties();
        }
        this.innerProperties().withInstanceFlexibility(instanceFlexibility);
        return this;
    }

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

    /**
     * Set the name property: Display name of the reservation.
     *
     * @param name the name value to set.
     * @return the PatchModel object itself.
     */
    public PatchModel withName(String name) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchProperties();
        }
        this.innerProperties().withName(name);
        return this;
    }

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

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

    /**
     * Get the renewProperties property: The renewProperties property.
     *
     * @return the renewProperties value.
     */
    public PatchPropertiesRenewProperties renewProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().renewProperties();
    }

    /**
     * Set the renewProperties property: The renewProperties property.
     *
     * @param renewProperties the renewProperties value to set.
     * @return the PatchModel object itself.
     */
    public PatchModel withRenewProperties(PatchPropertiesRenewProperties renewProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchProperties();
        }
        this.innerProperties().withRenewProperties(renewProperties);
        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.innerProperties() == null ? null : this.innerProperties().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 PatchModel object itself.
     */
    public PatchModel withReviewDateTime(OffsetDateTime reviewDateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchProperties();
        }
        this.innerProperties().withReviewDateTime(reviewDateTime);
        return this;
    }

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