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

package com.azure.resourcemanager.hybridnetwork.models;

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

/** Network function vendor configuration. */
@Fluent
public final class NetworkFunctionVendorConfiguration {
    /*
     * The name of the vendor network function role.
     */
    @JsonProperty(value = "roleName")
    private String roleName;

    /*
     * Specifies the operating system settings for the role instance.
     */
    @JsonProperty(value = "osProfile")
    private OsProfile osProfile;

    /*
     * The user parameters from the customer.
     */
    @JsonProperty(value = "userDataParameters", access = JsonProperty.Access.WRITE_ONLY)
    private Object userDataParameters;

    /*
     * The network interface configurations.
     */
    @JsonProperty(value = "networkInterfaces")
    private List<NetworkInterface> networkInterfaces;

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

    /**
     * Get the roleName property: The name of the vendor network function role.
     *
     * @return the roleName value.
     */
    public String roleName() {
        return this.roleName;
    }

    /**
     * Set the roleName property: The name of the vendor network function role.
     *
     * @param roleName the roleName value to set.
     * @return the NetworkFunctionVendorConfiguration object itself.
     */
    public NetworkFunctionVendorConfiguration withRoleName(String roleName) {
        this.roleName = roleName;
        return this;
    }

    /**
     * Get the osProfile property: Specifies the operating system settings for the role instance.
     *
     * @return the osProfile value.
     */
    public OsProfile osProfile() {
        return this.osProfile;
    }

    /**
     * Set the osProfile property: Specifies the operating system settings for the role instance.
     *
     * @param osProfile the osProfile value to set.
     * @return the NetworkFunctionVendorConfiguration object itself.
     */
    public NetworkFunctionVendorConfiguration withOsProfile(OsProfile osProfile) {
        this.osProfile = osProfile;
        return this;
    }

    /**
     * Get the userDataParameters property: The user parameters from the customer.
     *
     * @return the userDataParameters value.
     */
    public Object userDataParameters() {
        return this.userDataParameters;
    }

    /**
     * Get the networkInterfaces property: The network interface configurations.
     *
     * @return the networkInterfaces value.
     */
    public List<NetworkInterface> networkInterfaces() {
        return this.networkInterfaces;
    }

    /**
     * Set the networkInterfaces property: The network interface configurations.
     *
     * @param networkInterfaces the networkInterfaces value to set.
     * @return the NetworkFunctionVendorConfiguration object itself.
     */
    public NetworkFunctionVendorConfiguration withNetworkInterfaces(List<NetworkInterface> networkInterfaces) {
        this.networkInterfaces = networkInterfaces;
        return this;
    }

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