// 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.management.Resource;
import com.azure.core.management.SystemData;
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;
import java.util.Map;

/** Network related settings. */
@Fluent
public final class NetworkConnectionInner extends Resource {
    /*
     * Properties of a Network Connection
     */
    @JsonProperty(value = "properties")
    private NetworkProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Properties of a Network Connection.
     *
     * @return the innerProperties value.
     */
    private NetworkProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

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

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

    /**
     * Get the healthCheckStatus property: Overall health status of the network connection. Health checks are run on
     * creation, update, and periodically to validate the network connection.
     *
     * @return the healthCheckStatus value.
     */
    public HealthCheckStatus healthCheckStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().healthCheckStatus();
    }

    /**
     * Get the networkingResourceGroupName property: The name for resource group where NICs will be placed.
     *
     * @return the networkingResourceGroupName value.
     */
    public String networkingResourceGroupName() {
        return this.innerProperties() == null ? null : this.innerProperties().networkingResourceGroupName();
    }

    /**
     * Set the networkingResourceGroupName property: The name for resource group where NICs will be placed.
     *
     * @param networkingResourceGroupName the networkingResourceGroupName value to set.
     * @return the NetworkConnectionInner object itself.
     */
    public NetworkConnectionInner withNetworkingResourceGroupName(String networkingResourceGroupName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkProperties();
        }
        this.innerProperties().withNetworkingResourceGroupName(networkingResourceGroupName);
        return this;
    }

    /**
     * Get the domainJoinType property: AAD Join type.
     *
     * @return the domainJoinType value.
     */
    public DomainJoinType domainJoinType() {
        return this.innerProperties() == null ? null : this.innerProperties().domainJoinType();
    }

    /**
     * Set the domainJoinType property: AAD Join type.
     *
     * @param domainJoinType the domainJoinType value to set.
     * @return the NetworkConnectionInner object itself.
     */
    public NetworkConnectionInner withDomainJoinType(DomainJoinType domainJoinType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkProperties();
        }
        this.innerProperties().withDomainJoinType(domainJoinType);
        return this;
    }

    /**
     * Get the subnetId property: The subnet to attach Virtual Machines to.
     *
     * @return the subnetId value.
     */
    public String subnetId() {
        return this.innerProperties() == null ? null : this.innerProperties().subnetId();
    }

    /**
     * Set the subnetId property: The subnet to attach Virtual Machines to.
     *
     * @param subnetId the subnetId value to set.
     * @return the NetworkConnectionInner object itself.
     */
    public NetworkConnectionInner withSubnetId(String subnetId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkProperties();
        }
        this.innerProperties().withSubnetId(subnetId);
        return this;
    }

    /**
     * Get the domainName property: Active Directory domain name.
     *
     * @return the domainName value.
     */
    public String domainName() {
        return this.innerProperties() == null ? null : this.innerProperties().domainName();
    }

    /**
     * Set the domainName property: Active Directory domain name.
     *
     * @param domainName the domainName value to set.
     * @return the NetworkConnectionInner object itself.
     */
    public NetworkConnectionInner withDomainName(String domainName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkProperties();
        }
        this.innerProperties().withDomainName(domainName);
        return this;
    }

    /**
     * Get the organizationUnit property: Active Directory domain Organization Unit (OU).
     *
     * @return the organizationUnit value.
     */
    public String organizationUnit() {
        return this.innerProperties() == null ? null : this.innerProperties().organizationUnit();
    }

    /**
     * Set the organizationUnit property: Active Directory domain Organization Unit (OU).
     *
     * @param organizationUnit the organizationUnit value to set.
     * @return the NetworkConnectionInner object itself.
     */
    public NetworkConnectionInner withOrganizationUnit(String organizationUnit) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkProperties();
        }
        this.innerProperties().withOrganizationUnit(organizationUnit);
        return this;
    }

    /**
     * Get the domainUsername property: The username of an Active Directory account (user or service account) that has
     * permissions to create computer objects in Active Directory. Required format: admin@contoso.com.
     *
     * @return the domainUsername value.
     */
    public String domainUsername() {
        return this.innerProperties() == null ? null : this.innerProperties().domainUsername();
    }

    /**
     * Set the domainUsername property: The username of an Active Directory account (user or service account) that has
     * permissions to create computer objects in Active Directory. Required format: admin@contoso.com.
     *
     * @param domainUsername the domainUsername value to set.
     * @return the NetworkConnectionInner object itself.
     */
    public NetworkConnectionInner withDomainUsername(String domainUsername) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkProperties();
        }
        this.innerProperties().withDomainUsername(domainUsername);
        return this;
    }

    /**
     * Get the domainPassword property: The password for the account used to join domain.
     *
     * @return the domainPassword value.
     */
    public String domainPassword() {
        return this.innerProperties() == null ? null : this.innerProperties().domainPassword();
    }

    /**
     * Set the domainPassword property: The password for the account used to join domain.
     *
     * @param domainPassword the domainPassword value to set.
     * @return the NetworkConnectionInner object itself.
     */
    public NetworkConnectionInner withDomainPassword(String domainPassword) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkProperties();
        }
        this.innerProperties().withDomainPassword(domainPassword);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
