// 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.azure.resourcemanager.connectedvmware.models.Identity;
import com.fasterxml.jackson.annotation.JsonProperty;

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

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

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

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

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

    /**
     * Set the vmId property: Gets or sets the Vm Id.
     *
     * @param vmId the vmId value to set.
     * @return the HybridIdentityMetadataInner object itself.
     */
    public HybridIdentityMetadataInner withVmId(String vmId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridIdentityMetadataProperties();
        }
        this.innerProperties().withVmId(vmId);
        return this;
    }

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

    /**
     * Set the publicKey property: Gets or sets the Public Key.
     *
     * @param publicKey the publicKey value to set.
     * @return the HybridIdentityMetadataInner object itself.
     */
    public HybridIdentityMetadataInner withPublicKey(String publicKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridIdentityMetadataProperties();
        }
        this.innerProperties().withPublicKey(publicKey);
        return this;
    }

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

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

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