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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.labservices.models.ProvisioningState;
import com.azure.resourcemanager.labservices.models.VirtualMachineConnectionProfile;
import com.azure.resourcemanager.labservices.models.VirtualMachineState;
import com.azure.resourcemanager.labservices.models.VirtualMachineType;
import com.fasterxml.jackson.annotation.JsonProperty;

/** A lab virtual machine resource. */
@Fluent
public final class VirtualMachineInner extends ProxyResource {
    /*
     * System data of the Lab virtual machine.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Virtual machine resource properties
     */
    @JsonProperty(value = "properties", required = true)
    private VirtualMachineProperties innerProperties = new VirtualMachineProperties();

    /**
     * Get the systemData property: System data of the Lab virtual machine.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

    /**
     * Get the provisioningState property: Current provisioning state of the virtual machine.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the state property: The current state of the virtual machine.
     *
     * @return the state value.
     */
    public VirtualMachineState state() {
        return this.innerProperties() == null ? null : this.innerProperties().state();
    }

    /**
     * Get the connectionProfile property: Profile for information about connecting to the virtual machine.
     *
     * @return the connectionProfile value.
     */
    public VirtualMachineConnectionProfile connectionProfile() {
        return this.innerProperties() == null ? null : this.innerProperties().connectionProfile();
    }

    /**
     * Get the claimedByUserId property: The lab user ID (not the PUID!) of who claimed the virtual machine.
     *
     * @return the claimedByUserId value.
     */
    public String claimedByUserId() {
        return this.innerProperties() == null ? null : this.innerProperties().claimedByUserId();
    }

    /**
     * Get the vmType property: The type of this VM resource.
     *
     * @return the vmType value.
     */
    public VirtualMachineType vmType() {
        return this.innerProperties() == null ? null : this.innerProperties().vmType();
    }

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

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