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

package com.azure.resourcemanager.maintenance.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Input configuration for a patch run. */
@Fluent
public final class InputPatchConfiguration {
    /*
     * Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or
     * not after the patch operation is completed.
     */
    @JsonProperty(value = "rebootSetting")
    private RebootOptions rebootSetting;

    /*
     * Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property.
     */
    @JsonProperty(value = "windowsParameters")
    private InputWindowsParameters windowsParameters;

    /*
     * Input parameters specific to patching Linux machine. For Windows machines, do not pass this property.
     */
    @JsonProperty(value = "linuxParameters")
    private InputLinuxParameters linuxParameters;

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

    /**
     * Get the rebootSetting property: Possible reboot preference as defined by the user based on which it would be
     * decided to reboot the machine or not after the patch operation is completed.
     *
     * @return the rebootSetting value.
     */
    public RebootOptions rebootSetting() {
        return this.rebootSetting;
    }

    /**
     * Set the rebootSetting property: Possible reboot preference as defined by the user based on which it would be
     * decided to reboot the machine or not after the patch operation is completed.
     *
     * @param rebootSetting the rebootSetting value to set.
     * @return the InputPatchConfiguration object itself.
     */
    public InputPatchConfiguration withRebootSetting(RebootOptions rebootSetting) {
        this.rebootSetting = rebootSetting;
        return this;
    }

    /**
     * Get the windowsParameters property: Input parameters specific to patching a Windows machine. For Linux machines,
     * do not pass this property.
     *
     * @return the windowsParameters value.
     */
    public InputWindowsParameters windowsParameters() {
        return this.windowsParameters;
    }

    /**
     * Set the windowsParameters property: Input parameters specific to patching a Windows machine. For Linux machines,
     * do not pass this property.
     *
     * @param windowsParameters the windowsParameters value to set.
     * @return the InputPatchConfiguration object itself.
     */
    public InputPatchConfiguration withWindowsParameters(InputWindowsParameters windowsParameters) {
        this.windowsParameters = windowsParameters;
        return this;
    }

    /**
     * Get the linuxParameters property: Input parameters specific to patching Linux machine. For Windows machines, do
     * not pass this property.
     *
     * @return the linuxParameters value.
     */
    public InputLinuxParameters linuxParameters() {
        return this.linuxParameters;
    }

    /**
     * Set the linuxParameters property: Input parameters specific to patching Linux machine. For Windows machines, do
     * not pass this property.
     *
     * @param linuxParameters the linuxParameters value to set.
     * @return the InputPatchConfiguration object itself.
     */
    public InputPatchConfiguration withLinuxParameters(InputLinuxParameters linuxParameters) {
        this.linuxParameters = linuxParameters;
        return this;
    }

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