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

package com.azure.resourcemanager.labservices.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.labservices.fluent.models.ImageUpdateProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Lab services virtual machine image for updates. */
@Fluent
public final class ImageUpdate {
    /*
     * Image resource properties
     */
    @JsonProperty(value = "properties")
    private ImageUpdateProperties innerProperties;

    /**
     * Get the innerProperties property: Image resource properties.
     *
     * @return the innerProperties value.
     */
    private ImageUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the enabledState property: Is the image enabled.
     *
     * @return the enabledState value.
     */
    public EnableState enabledState() {
        return this.innerProperties() == null ? null : this.innerProperties().enabledState();
    }

    /**
     * Set the enabledState property: Is the image enabled.
     *
     * @param enabledState the enabledState value to set.
     * @return the ImageUpdate object itself.
     */
    public ImageUpdate withEnabledState(EnableState enabledState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ImageUpdateProperties();
        }
        this.innerProperties().withEnabledState(enabledState);
        return this;
    }

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