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

package com.azure.resourcemanager.scvmm.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** The Virtual machine inventory item. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inventoryType")
@JsonTypeName("VirtualMachine")
@Fluent
public final class VirtualMachineInventoryItem extends InventoryItemProperties {
    /*
     * Gets or sets the type of the os.
     */
    @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY)
    private OsType osType;

    /*
     * Gets or sets os name.
     */
    @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY)
    private String osName;

    /*
     * Gets the power state of the virtual machine.
     */
    @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY)
    private String powerState;

    /*
     * Gets or sets the nic ip addresses.
     */
    @JsonProperty(value = "ipAddresses")
    private List<String> ipAddresses;

    /*
     * Cloud inventory resource details where the VM is present.
     */
    @JsonProperty(value = "cloud")
    private InventoryItemDetails cloud;

    /**
     * Get the osType property: Gets or sets the type of the os.
     *
     * @return the osType value.
     */
    public OsType osType() {
        return this.osType;
    }

    /**
     * Get the osName property: Gets or sets os name.
     *
     * @return the osName value.
     */
    public String osName() {
        return this.osName;
    }

    /**
     * Get the powerState property: Gets the power state of the virtual machine.
     *
     * @return the powerState value.
     */
    public String powerState() {
        return this.powerState;
    }

    /**
     * Get the ipAddresses property: Gets or sets the nic ip addresses.
     *
     * @return the ipAddresses value.
     */
    public List<String> ipAddresses() {
        return this.ipAddresses;
    }

    /**
     * Set the ipAddresses property: Gets or sets the nic ip addresses.
     *
     * @param ipAddresses the ipAddresses value to set.
     * @return the VirtualMachineInventoryItem object itself.
     */
    public VirtualMachineInventoryItem withIpAddresses(List<String> ipAddresses) {
        this.ipAddresses = ipAddresses;
        return this;
    }

    /**
     * Get the cloud property: Cloud inventory resource details where the VM is present.
     *
     * @return the cloud value.
     */
    public InventoryItemDetails cloud() {
        return this.cloud;
    }

    /**
     * Set the cloud property: Cloud inventory resource details where the VM is present.
     *
     * @param cloud the cloud value to set.
     * @return the VirtualMachineInventoryItem object itself.
     */
    public VirtualMachineInventoryItem withCloud(InventoryItemDetails cloud) {
        this.cloud = cloud;
        return this;
    }

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