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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.devcenter.models.DomainJoinType;
import com.azure.resourcemanager.devcenter.models.HealthCheckStatus;
import com.azure.resourcemanager.devcenter.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of an attached NetworkConnection. */
@Fluent
public final class AttachedNetworkConnectionProperties {
    /*
     * The provisioning state of the resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * The resource ID of the NetworkConnection you want to attach.
     */
    @JsonProperty(value = "networkConnectionId", required = true)
    private String networkConnectionId;

    /*
     * The geo-location where the NetworkConnection resource specified in 'networkConnectionResourceId' property lives.
     */
    @JsonProperty(value = "networkConnectionLocation", access = JsonProperty.Access.WRITE_ONLY)
    private String networkConnectionLocation;

    /*
     * Health check status values
     */
    @JsonProperty(value = "healthCheckStatus", access = JsonProperty.Access.WRITE_ONLY)
    private HealthCheckStatus healthCheckStatus;

    /*
     * AAD Join type of the network. This is populated based on the referenced Network Connection.
     */
    @JsonProperty(value = "domainJoinType", access = JsonProperty.Access.WRITE_ONLY)
    private DomainJoinType domainJoinType;

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

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

    /**
     * Get the networkConnectionId property: The resource ID of the NetworkConnection you want to attach.
     *
     * @return the networkConnectionId value.
     */
    public String networkConnectionId() {
        return this.networkConnectionId;
    }

    /**
     * Set the networkConnectionId property: The resource ID of the NetworkConnection you want to attach.
     *
     * @param networkConnectionId the networkConnectionId value to set.
     * @return the AttachedNetworkConnectionProperties object itself.
     */
    public AttachedNetworkConnectionProperties withNetworkConnectionId(String networkConnectionId) {
        this.networkConnectionId = networkConnectionId;
        return this;
    }

    /**
     * Get the networkConnectionLocation property: The geo-location where the NetworkConnection resource specified in
     * 'networkConnectionResourceId' property lives.
     *
     * @return the networkConnectionLocation value.
     */
    public String networkConnectionLocation() {
        return this.networkConnectionLocation;
    }

    /**
     * Get the healthCheckStatus property: Health check status values.
     *
     * @return the healthCheckStatus value.
     */
    public HealthCheckStatus healthCheckStatus() {
        return this.healthCheckStatus;
    }

    /**
     * Get the domainJoinType property: AAD Join type of the network. This is populated based on the referenced Network
     * Connection.
     *
     * @return the domainJoinType value.
     */
    public DomainJoinType domainJoinType() {
        return this.domainJoinType;
    }

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

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