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

package com.azure.resourcemanager.networkcloud.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
 * AdministratorConfiguration represents the administrative credentials that will be applied to the control plane and
 * agent pool nodes in Kubernetes clusters.
 */
@Fluent
public final class AdministratorConfiguration {
    /*
     * The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If
     * not supplied, a user name will be chosen by the service.
     */
    @JsonProperty(value = "adminUsername")
    private String adminUsername;

    /*
     * The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases,
     * specification of public keys may be required to produce a working environment.
     */
    @JsonProperty(value = "sshPublicKeys")
    private List<SshPublicKey> sshPublicKeys;

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

    /**
     * Get the adminUsername property: The user name for the administrator that will be applied to the operating systems
     * that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.
     *
     * @return the adminUsername value.
     */
    public String adminUsername() {
        return this.adminUsername;
    }

    /**
     * Set the adminUsername property: The user name for the administrator that will be applied to the operating systems
     * that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.
     *
     * @param adminUsername the adminUsername value to set.
     * @return the AdministratorConfiguration object itself.
     */
    public AdministratorConfiguration withAdminUsername(String adminUsername) {
        this.adminUsername = adminUsername;
        return this;
    }

    /**
     * Get the sshPublicKeys property: The SSH configuration for the operating systems that run the nodes in the
     * Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.
     *
     * @return the sshPublicKeys value.
     */
    public List<SshPublicKey> sshPublicKeys() {
        return this.sshPublicKeys;
    }

    /**
     * Set the sshPublicKeys property: The SSH configuration for the operating systems that run the nodes in the
     * Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.
     *
     * @param sshPublicKeys the sshPublicKeys value to set.
     * @return the AdministratorConfiguration object itself.
     */
    public AdministratorConfiguration withSshPublicKeys(List<SshPublicKey> sshPublicKeys) {
        this.sshPublicKeys = sshPublicKeys;
        return this;
    }

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