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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.devcenter.models.HibernateSupport;
import com.azure.resourcemanager.devcenter.models.ImageReference;
import com.azure.resourcemanager.devcenter.models.ImageValidationErrorDetails;
import com.azure.resourcemanager.devcenter.models.ImageValidationStatus;
import com.azure.resourcemanager.devcenter.models.ProvisioningState;
import com.azure.resourcemanager.devcenter.models.Sku;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of a Dev Box definition. */
@Fluent
public final class DevBoxDefinitionProperties extends DevBoxDefinitionUpdateProperties {
    /*
     * The provisioning state of the resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Validation status of the configured image.
     */
    @JsonProperty(value = "imageValidationStatus", access = JsonProperty.Access.WRITE_ONLY)
    private ImageValidationStatus imageValidationStatus;

    /*
     * Details for image validator error. Populated when the image validation is not successful.
     */
    @JsonProperty(value = "imageValidationErrorDetails", access = JsonProperty.Access.WRITE_ONLY)
    private ImageValidationErrorDetails imageValidationErrorDetails;

    /*
     * Image reference information for the currently active image (only populated during updates).
     */
    @JsonProperty(value = "activeImageReference", access = JsonProperty.Access.WRITE_ONLY)
    private ImageReference activeImageReference;

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

    /**
     * Get the provisioningState property: The provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the imageValidationStatus property: Validation status of the configured image.
     *
     * @return the imageValidationStatus value.
     */
    public ImageValidationStatus imageValidationStatus() {
        return this.imageValidationStatus;
    }

    /**
     * Get the imageValidationErrorDetails property: Details for image validator error. Populated when the image
     * validation is not successful.
     *
     * @return the imageValidationErrorDetails value.
     */
    public ImageValidationErrorDetails imageValidationErrorDetails() {
        return this.imageValidationErrorDetails;
    }

    /**
     * Get the activeImageReference property: Image reference information for the currently active image (only populated
     * during updates).
     *
     * @return the activeImageReference value.
     */
    public ImageReference activeImageReference() {
        return this.activeImageReference;
    }

    /** {@inheritDoc} */
    @Override
    public DevBoxDefinitionProperties withImageReference(ImageReference imageReference) {
        super.withImageReference(imageReference);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DevBoxDefinitionProperties withSku(Sku sku) {
        super.withSku(sku);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DevBoxDefinitionProperties withOsStorageType(String osStorageType) {
        super.withOsStorageType(osStorageType);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DevBoxDefinitionProperties withHibernateSupport(HibernateSupport hibernateSupport) {
        super.withHibernateSupport(hibernateSupport);
        return this;
    }

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