// 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.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation;
import com.azure.resourcemanager.connectedvmware.models.ResourceStatus;
import com.azure.resourcemanager.connectedvmware.models.VICredential;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Defines the vCenter. */
@Fluent
public final class VCenterInner extends Resource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private VCenterProperties innerProperties = new VCenterProperties();

    /*
     * Gets or sets the extended location.
     */
    @JsonProperty(value = "extendedLocation")
    private ExtendedLocation extendedLocation;

    /*
     * 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 VCenterProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the extendedLocation property: Gets or sets the extended location.
     *
     * @return the extendedLocation value.
     */
    public ExtendedLocation extendedLocation() {
        return this.extendedLocation;
    }

    /**
     * Set the extendedLocation property: Gets or sets the extended location.
     *
     * @param extendedLocation the extendedLocation value to set.
     * @return the VCenterInner object itself.
     */
    public VCenterInner withExtendedLocation(ExtendedLocation extendedLocation) {
        this.extendedLocation = extendedLocation;
        return this;
    }

    /**
     * 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 VCenterInner object itself.
     */
    public VCenterInner withKind(String kind) {
        this.kind = kind;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public VCenterInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public VCenterInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the uuid property: Gets or sets a unique identifier for this resource.
     *
     * @return the uuid value.
     */
    public String uuid() {
        return this.innerProperties() == null ? null : this.innerProperties().uuid();
    }

    /**
     * Get the fqdn property: Gets or sets the FQDN/IPAddress of the vCenter.
     *
     * @return the fqdn value.
     */
    public String fqdn() {
        return this.innerProperties() == null ? null : this.innerProperties().fqdn();
    }

    /**
     * Set the fqdn property: Gets or sets the FQDN/IPAddress of the vCenter.
     *
     * @param fqdn the fqdn value to set.
     * @return the VCenterInner object itself.
     */
    public VCenterInner withFqdn(String fqdn) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VCenterProperties();
        }
        this.innerProperties().withFqdn(fqdn);
        return this;
    }

    /**
     * Get the port property: Gets or sets the port of the vCenter.
     *
     * @return the port value.
     */
    public Integer port() {
        return this.innerProperties() == null ? null : this.innerProperties().port();
    }

    /**
     * Set the port property: Gets or sets the port of the vCenter.
     *
     * @param port the port value to set.
     * @return the VCenterInner object itself.
     */
    public VCenterInner withPort(Integer port) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VCenterProperties();
        }
        this.innerProperties().withPort(port);
        return this;
    }

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

    /**
     * Get the instanceUuid property: Gets or sets the instance UUID of the vCenter.
     *
     * @return the instanceUuid value.
     */
    public String instanceUuid() {
        return this.innerProperties() == null ? null : this.innerProperties().instanceUuid();
    }

    /**
     * Get the connectionStatus property: Gets or sets the connection status to the vCenter.
     *
     * @return the connectionStatus value.
     */
    public String connectionStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().connectionStatus();
    }

    /**
     * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes.
     *
     * @return the customResourceName value.
     */
    public String customResourceName() {
        return this.innerProperties() == null ? null : this.innerProperties().customResourceName();
    }

    /**
     * Get the credentials property: Username / Password Credentials to connect to vcenter.
     *
     * @return the credentials value.
     */
    public VICredential credentials() {
        return this.innerProperties() == null ? null : this.innerProperties().credentials();
    }

    /**
     * Set the credentials property: Username / Password Credentials to connect to vcenter.
     *
     * @param credentials the credentials value to set.
     * @return the VCenterInner object itself.
     */
    public VCenterInner withCredentials(VICredential credentials) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VCenterProperties();
        }
        this.innerProperties().withCredentials(credentials);
        return this;
    }

    /**
     * Get the statuses property: The resource status information.
     *
     * @return the statuses value.
     */
    public List<ResourceStatus> statuses() {
        return this.innerProperties() == null ? null : this.innerProperties().statuses();
    }

    /**
     * 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 VCenterInner"));
        } else {
            innerProperties().validate();
        }
        if (extendedLocation() != null) {
            extendedLocation().validate();
        }
    }

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