// 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.devcenter.fluent.models.DevBoxDefinitionUpdateProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Partial update of a Dev Box definition resource. */
@Fluent
public final class DevBoxDefinitionUpdate extends TrackedResourceUpdate {
    /*
     * Properties of a Dev Box definition to be updated.
     */
    @JsonProperty(value = "properties")
    private DevBoxDefinitionUpdateProperties innerProperties;

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

    /**
     * Get the innerProperties property: Properties of a Dev Box definition to be updated.
     *
     * @return the innerProperties value.
     */
    private DevBoxDefinitionUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public DevBoxDefinitionUpdate withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DevBoxDefinitionUpdate withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /**
     * Get the imageReference property: Image reference information.
     *
     * @return the imageReference value.
     */
    public ImageReference imageReference() {
        return this.innerProperties() == null ? null : this.innerProperties().imageReference();
    }

    /**
     * Set the imageReference property: Image reference information.
     *
     * @param imageReference the imageReference value to set.
     * @return the DevBoxDefinitionUpdate object itself.
     */
    public DevBoxDefinitionUpdate withImageReference(ImageReference imageReference) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DevBoxDefinitionUpdateProperties();
        }
        this.innerProperties().withImageReference(imageReference);
        return this;
    }

    /**
     * Get the sku property: The SKU for Dev Boxes created using this definition.
     *
     * @return the sku value.
     */
    public Sku sku() {
        return this.innerProperties() == null ? null : this.innerProperties().sku();
    }

    /**
     * Set the sku property: The SKU for Dev Boxes created using this definition.
     *
     * @param sku the sku value to set.
     * @return the DevBoxDefinitionUpdate object itself.
     */
    public DevBoxDefinitionUpdate withSku(Sku sku) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DevBoxDefinitionUpdateProperties();
        }
        this.innerProperties().withSku(sku);
        return this;
    }

    /**
     * Get the osStorageType property: The storage type used for the Operating System disk of Dev Boxes created using
     * this definition.
     *
     * @return the osStorageType value.
     */
    public String osStorageType() {
        return this.innerProperties() == null ? null : this.innerProperties().osStorageType();
    }

    /**
     * Set the osStorageType property: The storage type used for the Operating System disk of Dev Boxes created using
     * this definition.
     *
     * @param osStorageType the osStorageType value to set.
     * @return the DevBoxDefinitionUpdate object itself.
     */
    public DevBoxDefinitionUpdate withOsStorageType(String osStorageType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DevBoxDefinitionUpdateProperties();
        }
        this.innerProperties().withOsStorageType(osStorageType);
        return this;
    }

    /**
     * Get the hibernateSupport property: Indicates whether Dev Boxes created with this definition are capable of
     * hibernation. Not all images are capable of supporting hibernation. To find out more see
     * https://aka.ms/devbox/hibernate.
     *
     * @return the hibernateSupport value.
     */
    public HibernateSupport hibernateSupport() {
        return this.innerProperties() == null ? null : this.innerProperties().hibernateSupport();
    }

    /**
     * Set the hibernateSupport property: Indicates whether Dev Boxes created with this definition are capable of
     * hibernation. Not all images are capable of supporting hibernation. To find out more see
     * https://aka.ms/devbox/hibernate.
     *
     * @param hibernateSupport the hibernateSupport value to set.
     * @return the DevBoxDefinitionUpdate object itself.
     */
    public DevBoxDefinitionUpdate withHibernateSupport(HibernateSupport hibernateSupport) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DevBoxDefinitionUpdateProperties();
        }
        this.innerProperties().withHibernateSupport(hibernateSupport);
        return this;
    }

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