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

package com.azure.resourcemanager.devtestlabs.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties for creating a custom image from a VHD. */
@Fluent
public final class CustomImagePropertiesCustom {
    /*
     * The image name.
     */
    @JsonProperty(value = "imageName")
    private String imageName;

    /*
     * Indicates whether sysprep has been run on the VHD.
     */
    @JsonProperty(value = "sysPrep")
    private Boolean sysPrep;

    /*
     * The OS type of the custom image (i.e. Windows, Linux)
     */
    @JsonProperty(value = "osType", required = true)
    private CustomImageOsType osType;

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

    /**
     * Get the imageName property: The image name.
     *
     * @return the imageName value.
     */
    public String imageName() {
        return this.imageName;
    }

    /**
     * Set the imageName property: The image name.
     *
     * @param imageName the imageName value to set.
     * @return the CustomImagePropertiesCustom object itself.
     */
    public CustomImagePropertiesCustom withImageName(String imageName) {
        this.imageName = imageName;
        return this;
    }

    /**
     * Get the sysPrep property: Indicates whether sysprep has been run on the VHD.
     *
     * @return the sysPrep value.
     */
    public Boolean sysPrep() {
        return this.sysPrep;
    }

    /**
     * Set the sysPrep property: Indicates whether sysprep has been run on the VHD.
     *
     * @param sysPrep the sysPrep value to set.
     * @return the CustomImagePropertiesCustom object itself.
     */
    public CustomImagePropertiesCustom withSysPrep(Boolean sysPrep) {
        this.sysPrep = sysPrep;
        return this;
    }

    /**
     * Get the osType property: The OS type of the custom image (i.e. Windows, Linux).
     *
     * @return the osType value.
     */
    public CustomImageOsType osType() {
        return this.osType;
    }

    /**
     * Set the osType property: The OS type of the custom image (i.e. Windows, Linux).
     *
     * @param osType the osType value to set.
     * @return the CustomImagePropertiesCustom object itself.
     */
    public CustomImagePropertiesCustom withOsType(CustomImageOsType osType) {
        this.osType = osType;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (osType() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property osType in model CustomImagePropertiesCustom"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(CustomImagePropertiesCustom.class);
}
