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

package com.azure.resourcemanager.vmwarecloudsimple.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.vmwarecloudsimple.models.NodeStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.UUID;

/** Properties of dedicated cloud node. */
@Fluent
public final class DedicatedCloudNodeProperties {
    /*
     * Availability Zone id, e.g. "az1"
     */
    @JsonProperty(value = "availabilityZoneId", required = true)
    private String availabilityZoneId;

    /*
     * Availability Zone name, e.g. "Availability Zone 1"
     */
    @JsonProperty(value = "availabilityZoneName", access = JsonProperty.Access.WRITE_ONLY)
    private String availabilityZoneName;

    /*
     * VMWare Cloud Rack Name
     */
    @JsonProperty(value = "cloudRackName", access = JsonProperty.Access.WRITE_ONLY)
    private String cloudRackName;

    /*
     * date time the resource was created
     */
    @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime created;

    /*
     * count of nodes to create
     */
    @JsonProperty(value = "nodesCount", required = true)
    private int nodesCount;

    /*
     * Placement Group id, e.g. "n1"
     */
    @JsonProperty(value = "placementGroupId", required = true)
    private String placementGroupId;

    /*
     * Placement Name, e.g. "Placement Group 1"
     */
    @JsonProperty(value = "placementGroupName", access = JsonProperty.Access.WRITE_ONLY)
    private String placementGroupName;

    /*
     * Private Cloud Id
     */
    @JsonProperty(value = "privateCloudId", access = JsonProperty.Access.WRITE_ONLY)
    private String privateCloudId;

    /*
     * Resource Pool Name
     */
    @JsonProperty(value = "privateCloudName", access = JsonProperty.Access.WRITE_ONLY)
    private String privateCloudName;

    /*
     * The provisioning status of the resource
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * purchase id
     */
    @JsonProperty(value = "purchaseId", required = true)
    private UUID purchaseId;

    /*
     * Dedicated Cloud Nodes SKU's description
     */
    @JsonProperty(value = "skuDescription")
    private SkuDescription innerSkuDescription;

    /*
     * Node status, indicates is private cloud set up on this node or not
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private NodeStatus status;

    /*
     * VMWare Cluster Name
     */
    @JsonProperty(value = "vmwareClusterName", access = JsonProperty.Access.WRITE_ONLY)
    private String vmwareClusterName;

    /** Creates an instance of DedicatedCloudNodeProperties class. */
    public DedicatedCloudNodeProperties() {
    }

    /**
     * Get the availabilityZoneId property: Availability Zone id, e.g. "az1".
     *
     * @return the availabilityZoneId value.
     */
    public String availabilityZoneId() {
        return this.availabilityZoneId;
    }

    /**
     * Set the availabilityZoneId property: Availability Zone id, e.g. "az1".
     *
     * @param availabilityZoneId the availabilityZoneId value to set.
     * @return the DedicatedCloudNodeProperties object itself.
     */
    public DedicatedCloudNodeProperties withAvailabilityZoneId(String availabilityZoneId) {
        this.availabilityZoneId = availabilityZoneId;
        return this;
    }

    /**
     * Get the availabilityZoneName property: Availability Zone name, e.g. "Availability Zone 1".
     *
     * @return the availabilityZoneName value.
     */
    public String availabilityZoneName() {
        return this.availabilityZoneName;
    }

    /**
     * Get the cloudRackName property: VMWare Cloud Rack Name.
     *
     * @return the cloudRackName value.
     */
    public String cloudRackName() {
        return this.cloudRackName;
    }

    /**
     * Get the created property: date time the resource was created.
     *
     * @return the created value.
     */
    public OffsetDateTime created() {
        return this.created;
    }

    /**
     * Get the nodesCount property: count of nodes to create.
     *
     * @return the nodesCount value.
     */
    public int nodesCount() {
        return this.nodesCount;
    }

    /**
     * Set the nodesCount property: count of nodes to create.
     *
     * @param nodesCount the nodesCount value to set.
     * @return the DedicatedCloudNodeProperties object itself.
     */
    public DedicatedCloudNodeProperties withNodesCount(int nodesCount) {
        this.nodesCount = nodesCount;
        return this;
    }

    /**
     * Get the placementGroupId property: Placement Group id, e.g. "n1".
     *
     * @return the placementGroupId value.
     */
    public String placementGroupId() {
        return this.placementGroupId;
    }

    /**
     * Set the placementGroupId property: Placement Group id, e.g. "n1".
     *
     * @param placementGroupId the placementGroupId value to set.
     * @return the DedicatedCloudNodeProperties object itself.
     */
    public DedicatedCloudNodeProperties withPlacementGroupId(String placementGroupId) {
        this.placementGroupId = placementGroupId;
        return this;
    }

    /**
     * Get the placementGroupName property: Placement Name, e.g. "Placement Group 1".
     *
     * @return the placementGroupName value.
     */
    public String placementGroupName() {
        return this.placementGroupName;
    }

    /**
     * Get the privateCloudId property: Private Cloud Id.
     *
     * @return the privateCloudId value.
     */
    public String privateCloudId() {
        return this.privateCloudId;
    }

    /**
     * Get the privateCloudName property: Resource Pool Name.
     *
     * @return the privateCloudName value.
     */
    public String privateCloudName() {
        return this.privateCloudName;
    }

    /**
     * Get the provisioningState property: The provisioning status of the resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the purchaseId property: purchase id.
     *
     * @return the purchaseId value.
     */
    public UUID purchaseId() {
        return this.purchaseId;
    }

    /**
     * Set the purchaseId property: purchase id.
     *
     * @param purchaseId the purchaseId value to set.
     * @return the DedicatedCloudNodeProperties object itself.
     */
    public DedicatedCloudNodeProperties withPurchaseId(UUID purchaseId) {
        this.purchaseId = purchaseId;
        return this;
    }

    /**
     * Get the innerSkuDescription property: Dedicated Cloud Nodes SKU's description.
     *
     * @return the innerSkuDescription value.
     */
    private SkuDescription innerSkuDescription() {
        return this.innerSkuDescription;
    }

    /**
     * Get the status property: Node status, indicates is private cloud set up on this node or not.
     *
     * @return the status value.
     */
    public NodeStatus status() {
        return this.status;
    }

    /**
     * Get the vmwareClusterName property: VMWare Cluster Name.
     *
     * @return the vmwareClusterName value.
     */
    public String vmwareClusterName() {
        return this.vmwareClusterName;
    }

    /**
     * Get the id property: SKU's id.
     *
     * @return the id value.
     */
    public String id() {
        return this.innerSkuDescription() == null ? null : this.innerSkuDescription().id();
    }

    /**
     * Set the id property: SKU's id.
     *
     * @param id the id value to set.
     * @return the DedicatedCloudNodeProperties object itself.
     */
    public DedicatedCloudNodeProperties withId(String id) {
        if (this.innerSkuDescription() == null) {
            this.innerSkuDescription = new SkuDescription();
        }
        this.innerSkuDescription().withId(id);
        return this;
    }

    /**
     * Get the name property: SKU's name.
     *
     * @return the name value.
     */
    public String name() {
        return this.innerSkuDescription() == null ? null : this.innerSkuDescription().name();
    }

    /**
     * Set the name property: SKU's name.
     *
     * @param name the name value to set.
     * @return the DedicatedCloudNodeProperties object itself.
     */
    public DedicatedCloudNodeProperties withName(String name) {
        if (this.innerSkuDescription() == null) {
            this.innerSkuDescription = new SkuDescription();
        }
        this.innerSkuDescription().withName(name);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (availabilityZoneId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property availabilityZoneId in model DedicatedCloudNodeProperties"));
        }
        if (placementGroupId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property placementGroupId in model DedicatedCloudNodeProperties"));
        }
        if (purchaseId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property purchaseId in model DedicatedCloudNodeProperties"));
        }
        if (innerSkuDescription() != null) {
            innerSkuDescription().validate();
        }
    }

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