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

package com.azure.resourcemanager.connectedvmware.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** The host inventory item. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inventoryType")
@JsonTypeName("Host")
@Fluent
public final class HostInventoryItem extends InventoryItemProperties {
    /*
     * Parent host inventory resource details.
     */
    @JsonProperty(value = "parent")
    private InventoryItemDetails parent;

    /**
     * Get the parent property: Parent host inventory resource details.
     *
     * @return the parent value.
     */
    public InventoryItemDetails parent() {
        return this.parent;
    }

    /**
     * Set the parent property: Parent host inventory resource details.
     *
     * @param parent the parent value to set.
     * @return the HostInventoryItem object itself.
     */
    public HostInventoryItem withParent(InventoryItemDetails parent) {
        this.parent = parent;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HostInventoryItem withManagedResourceId(String managedResourceId) {
        super.withManagedResourceId(managedResourceId);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HostInventoryItem withMoRefId(String moRefId) {
        super.withMoRefId(moRefId);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public HostInventoryItem withMoName(String moName) {
        super.withMoName(moName);
        return this;
    }

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