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

package com.azure.resourcemanager.machinelearningservices.models;

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

/** An Azure Machine Learning compute instance. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType")
@JsonTypeName("ComputeInstance")
@Fluent
public final class ComputeInstance extends Compute {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeInstance.class);

    /*
     * Compute Instance properties
     */
    @JsonProperty(value = "properties")
    private ComputeInstanceProperties properties;

    /**
     * Get the properties property: Compute Instance properties.
     *
     * @return the properties value.
     */
    public ComputeInstanceProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: Compute Instance properties.
     *
     * @param properties the properties value to set.
     * @return the ComputeInstance object itself.
     */
    public ComputeInstance withProperties(ComputeInstanceProperties properties) {
        this.properties = properties;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ComputeInstance withComputeLocation(String computeLocation) {
        super.withComputeLocation(computeLocation);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ComputeInstance withDescription(String description) {
        super.withDescription(description);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ComputeInstance withResourceId(String resourceId) {
        super.withResourceId(resourceId);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ComputeInstance withDisableLocalAuth(Boolean disableLocalAuth) {
        super.withDisableLocalAuth(disableLocalAuth);
        return this;
    }

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