// 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 role configuration. */
@Fluent
public final class NetworkFunctionRoleConfiguration {
    /*
     * The name of the network function role.
     */
    @JsonProperty(value = "roleName")
    private String roleName;

    /*
     * Role type.
     */
    @JsonProperty(value = "roleType")
    private NetworkFunctionRoleConfigurationType roleType;

    /*
     * The size of the virtual machine.
     */
    @JsonProperty(value = "virtualMachineSize")
    private VirtualMachineSizeTypes virtualMachineSize;

    /*
     * Specifies the operating system settings for the role instance. This value can be updated during the deployment
     * of network function.
     */
    @JsonProperty(value = "osProfile")
    private OsProfile osProfile;

    /*
     * The user data template for customers. This is a json schema template describing the format and data type of user
     * data parameters.
     */
    @JsonProperty(value = "userDataTemplate")
    private Object userDataTemplate;

    /*
     * The user parameters for customers. The format of user data parameters has to be matched with the provided user
     * data template.
     */
    @JsonProperty(value = "userDataParameters")
    private Object userDataParameters;

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

    /*
     * Specifies the storage settings for the virtual machine disks.
     */
    @JsonProperty(value = "storageProfile")
    private StorageProfile storageProfile;

    /*
     * Specifies the custom settings for the virtual machine.
     */
    @JsonProperty(value = "customProfile")
    private CustomProfile customProfile;

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

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

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

    /**
     * Get the roleType property: Role type.
     *
     * @return the roleType value.
     */
    public NetworkFunctionRoleConfigurationType roleType() {
        return this.roleType;
    }

    /**
     * Set the roleType property: Role type.
     *
     * @param roleType the roleType value to set.
     * @return the NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withRoleType(NetworkFunctionRoleConfigurationType roleType) {
        this.roleType = roleType;
        return this;
    }

    /**
     * Get the virtualMachineSize property: The size of the virtual machine.
     *
     * @return the virtualMachineSize value.
     */
    public VirtualMachineSizeTypes virtualMachineSize() {
        return this.virtualMachineSize;
    }

    /**
     * Set the virtualMachineSize property: The size of the virtual machine.
     *
     * @param virtualMachineSize the virtualMachineSize value to set.
     * @return the NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withVirtualMachineSize(VirtualMachineSizeTypes virtualMachineSize) {
        this.virtualMachineSize = virtualMachineSize;
        return this;
    }

    /**
     * Get the osProfile property: Specifies the operating system settings for the role instance. This value can be
     * updated during the deployment of network function.
     *
     * @return the osProfile value.
     */
    public OsProfile osProfile() {
        return this.osProfile;
    }

    /**
     * Set the osProfile property: Specifies the operating system settings for the role instance. This value can be
     * updated during the deployment of network function.
     *
     * @param osProfile the osProfile value to set.
     * @return the NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withOsProfile(OsProfile osProfile) {
        this.osProfile = osProfile;
        return this;
    }

    /**
     * Get the userDataTemplate property: The user data template for customers. This is a json schema template
     * describing the format and data type of user data parameters.
     *
     * @return the userDataTemplate value.
     */
    public Object userDataTemplate() {
        return this.userDataTemplate;
    }

    /**
     * Set the userDataTemplate property: The user data template for customers. This is a json schema template
     * describing the format and data type of user data parameters.
     *
     * @param userDataTemplate the userDataTemplate value to set.
     * @return the NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withUserDataTemplate(Object userDataTemplate) {
        this.userDataTemplate = userDataTemplate;
        return this;
    }

    /**
     * Get the userDataParameters property: The user parameters for customers. The format of user data parameters has to
     * be matched with the provided user data template.
     *
     * @return the userDataParameters value.
     */
    public Object userDataParameters() {
        return this.userDataParameters;
    }

    /**
     * Set the userDataParameters property: The user parameters for customers. The format of user data parameters has to
     * be matched with the provided user data template.
     *
     * @param userDataParameters the userDataParameters value to set.
     * @return the NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withUserDataParameters(Object userDataParameters) {
        this.userDataParameters = userDataParameters;
        return this;
    }

    /**
     * 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 NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withNetworkInterfaces(List<NetworkInterface> networkInterfaces) {
        this.networkInterfaces = networkInterfaces;
        return this;
    }

    /**
     * Get the storageProfile property: Specifies the storage settings for the virtual machine disks.
     *
     * @return the storageProfile value.
     */
    public StorageProfile storageProfile() {
        return this.storageProfile;
    }

    /**
     * Set the storageProfile property: Specifies the storage settings for the virtual machine disks.
     *
     * @param storageProfile the storageProfile value to set.
     * @return the NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withStorageProfile(StorageProfile storageProfile) {
        this.storageProfile = storageProfile;
        return this;
    }

    /**
     * Get the customProfile property: Specifies the custom settings for the virtual machine.
     *
     * @return the customProfile value.
     */
    public CustomProfile customProfile() {
        return this.customProfile;
    }

    /**
     * Set the customProfile property: Specifies the custom settings for the virtual machine.
     *
     * @param customProfile the customProfile value to set.
     * @return the NetworkFunctionRoleConfiguration object itself.
     */
    public NetworkFunctionRoleConfiguration withCustomProfile(CustomProfile customProfile) {
        this.customProfile = customProfile;
        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());
        }
        if (storageProfile() != null) {
            storageProfile().validate();
        }
        if (customProfile() != null) {
            customProfile().validate();
        }
    }
}
