// 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.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.fasterxml.jackson.annotation.JsonProperty;

/** Defines the inventory item. */
@Fluent
public final class InventoryItemInner extends ProxyResource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private InventoryItemProperties innerProperties = new InventoryItemProperties();

    /*
     * The system data.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g.
     * ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist
     * this value.
     */
    @JsonProperty(value = "kind")
    private String kind;

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private InventoryItemProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: The system data.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of
     * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must
     * validate and persist this value.
     *
     * @return the kind value.
     */
    public String kind() {
        return this.kind;
    }

    /**
     * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of
     * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must
     * validate and persist this value.
     *
     * @param kind the kind value to set.
     * @return the InventoryItemInner object itself.
     */
    public InventoryItemInner withKind(String kind) {
        this.kind = kind;
        return this;
    }

    /**
     * Get the managedResourceId property: Gets or sets the tracked resource id corresponding to the inventory resource.
     *
     * @return the managedResourceId value.
     */
    public String managedResourceId() {
        return this.innerProperties() == null ? null : this.innerProperties().managedResourceId();
    }

    /**
     * Set the managedResourceId property: Gets or sets the tracked resource id corresponding to the inventory resource.
     *
     * @param managedResourceId the managedResourceId value to set.
     * @return the InventoryItemInner object itself.
     */
    public InventoryItemInner withManagedResourceId(String managedResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new InventoryItemProperties();
        }
        this.innerProperties().withManagedResourceId(managedResourceId);
        return this;
    }

    /**
     * Get the moRefId property: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item.
     *
     * @return the moRefId value.
     */
    public String moRefId() {
        return this.innerProperties() == null ? null : this.innerProperties().moRefId();
    }

    /**
     * Set the moRefId property: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item.
     *
     * @param moRefId the moRefId value to set.
     * @return the InventoryItemInner object itself.
     */
    public InventoryItemInner withMoRefId(String moRefId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new InventoryItemProperties();
        }
        this.innerProperties().withMoRefId(moRefId);
        return this;
    }

    /**
     * Get the moName property: Gets or sets the vCenter Managed Object name for the inventory item.
     *
     * @return the moName value.
     */
    public String moName() {
        return this.innerProperties() == null ? null : this.innerProperties().moName();
    }

    /**
     * Set the moName property: Gets or sets the vCenter Managed Object name for the inventory item.
     *
     * @param moName the moName value to set.
     * @return the InventoryItemInner object itself.
     */
    public InventoryItemInner withMoName(String moName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new InventoryItemProperties();
        }
        this.innerProperties().withMoName(moName);
        return this;
    }

    /**
     * Get the provisioningState property: Gets or sets the provisioning state.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * 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 InventoryItemInner"));
        } else {
            innerProperties().validate();
        }
    }

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