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

package com.azure.resourcemanager.recoveryservicessiterecovery.models;

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

/** Hyper V VM network details. */
@Fluent
public final class VMNicDetails {
    /*
     * The nic Id.
     */
    @JsonProperty(value = "nicId")
    private String nicId;

    /*
     * The replica nic Id.
     */
    @JsonProperty(value = "replicaNicId")
    private String replicaNicId;

    /*
     * The source nic ARM Id.
     */
    @JsonProperty(value = "sourceNicArmId")
    private String sourceNicArmId;

    /*
     * VM network name.
     */
    @JsonProperty(value = "vMNetworkName")
    private String vMNetworkName;

    /*
     * Recovery VM network Id.
     */
    @JsonProperty(value = "recoveryVMNetworkId")
    private String recoveryVMNetworkId;

    /*
     * The IP configurations of the NIC.
     */
    @JsonProperty(value = "ipConfigs")
    private List<IpConfigDetails> ipConfigs;

    /*
     * Selection type for failover.
     */
    @JsonProperty(value = "selectionType")
    private String selectionType;

    /*
     * The id of the NSG associated with the NIC.
     */
    @JsonProperty(value = "recoveryNetworkSecurityGroupId")
    private String recoveryNetworkSecurityGroupId;

    /*
     * A value indicating whether the NIC has accelerated networking enabled.
     */
    @JsonProperty(value = "enableAcceleratedNetworkingOnRecovery")
    private Boolean enableAcceleratedNetworkingOnRecovery;

    /*
     * The network to be used by NIC during test failover.
     */
    @JsonProperty(value = "tfoVMNetworkId")
    private String tfoVMNetworkId;

    /*
     * The NSG to be used by NIC during test failover.
     */
    @JsonProperty(value = "tfoNetworkSecurityGroupId")
    private String tfoNetworkSecurityGroupId;

    /*
     * Whether the TFO NIC has accelerated networking enabled.
     */
    @JsonProperty(value = "enableAcceleratedNetworkingOnTfo")
    private Boolean enableAcceleratedNetworkingOnTfo;

    /*
     * The name of the NIC to be used when creating target NICs.
     */
    @JsonProperty(value = "recoveryNicName")
    private String recoveryNicName;

    /*
     * The resource group of the NIC to be used when creating target NICs.
     */
    @JsonProperty(value = "recoveryNicResourceGroupName")
    private String recoveryNicResourceGroupName;

    /*
     * A value indicating whether an existing NIC is allowed to be reused during failover subject to availability.
     */
    @JsonProperty(value = "reuseExistingNic")
    private Boolean reuseExistingNic;

    /*
     * The name of the NIC to be used when creating target NICs in TFO.
     */
    @JsonProperty(value = "tfoRecoveryNicName")
    private String tfoRecoveryNicName;

    /*
     * The resource group of the NIC to be used when creating target NICs in TFO.
     */
    @JsonProperty(value = "tfoRecoveryNicResourceGroupName")
    private String tfoRecoveryNicResourceGroupName;

    /*
     * A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability.
     */
    @JsonProperty(value = "tfoReuseExistingNic")
    private Boolean tfoReuseExistingNic;

    /*
     * Target NIC name.
     */
    @JsonProperty(value = "targetNicName")
    private String targetNicName;

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

    /**
     * Get the nicId property: The nic Id.
     *
     * @return the nicId value.
     */
    public String nicId() {
        return this.nicId;
    }

    /**
     * Set the nicId property: The nic Id.
     *
     * @param nicId the nicId value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withNicId(String nicId) {
        this.nicId = nicId;
        return this;
    }

    /**
     * Get the replicaNicId property: The replica nic Id.
     *
     * @return the replicaNicId value.
     */
    public String replicaNicId() {
        return this.replicaNicId;
    }

    /**
     * Set the replicaNicId property: The replica nic Id.
     *
     * @param replicaNicId the replicaNicId value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withReplicaNicId(String replicaNicId) {
        this.replicaNicId = replicaNicId;
        return this;
    }

    /**
     * Get the sourceNicArmId property: The source nic ARM Id.
     *
     * @return the sourceNicArmId value.
     */
    public String sourceNicArmId() {
        return this.sourceNicArmId;
    }

    /**
     * Set the sourceNicArmId property: The source nic ARM Id.
     *
     * @param sourceNicArmId the sourceNicArmId value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withSourceNicArmId(String sourceNicArmId) {
        this.sourceNicArmId = sourceNicArmId;
        return this;
    }

    /**
     * Get the vMNetworkName property: VM network name.
     *
     * @return the vMNetworkName value.
     */
    public String vMNetworkName() {
        return this.vMNetworkName;
    }

    /**
     * Set the vMNetworkName property: VM network name.
     *
     * @param vMNetworkName the vMNetworkName value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withVMNetworkName(String vMNetworkName) {
        this.vMNetworkName = vMNetworkName;
        return this;
    }

    /**
     * Get the recoveryVMNetworkId property: Recovery VM network Id.
     *
     * @return the recoveryVMNetworkId value.
     */
    public String recoveryVMNetworkId() {
        return this.recoveryVMNetworkId;
    }

    /**
     * Set the recoveryVMNetworkId property: Recovery VM network Id.
     *
     * @param recoveryVMNetworkId the recoveryVMNetworkId value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withRecoveryVMNetworkId(String recoveryVMNetworkId) {
        this.recoveryVMNetworkId = recoveryVMNetworkId;
        return this;
    }

    /**
     * Get the ipConfigs property: The IP configurations of the NIC.
     *
     * @return the ipConfigs value.
     */
    public List<IpConfigDetails> ipConfigs() {
        return this.ipConfigs;
    }

    /**
     * Set the ipConfigs property: The IP configurations of the NIC.
     *
     * @param ipConfigs the ipConfigs value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withIpConfigs(List<IpConfigDetails> ipConfigs) {
        this.ipConfigs = ipConfigs;
        return this;
    }

    /**
     * Get the selectionType property: Selection type for failover.
     *
     * @return the selectionType value.
     */
    public String selectionType() {
        return this.selectionType;
    }

    /**
     * Set the selectionType property: Selection type for failover.
     *
     * @param selectionType the selectionType value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withSelectionType(String selectionType) {
        this.selectionType = selectionType;
        return this;
    }

    /**
     * Get the recoveryNetworkSecurityGroupId property: The id of the NSG associated with the NIC.
     *
     * @return the recoveryNetworkSecurityGroupId value.
     */
    public String recoveryNetworkSecurityGroupId() {
        return this.recoveryNetworkSecurityGroupId;
    }

    /**
     * Set the recoveryNetworkSecurityGroupId property: The id of the NSG associated with the NIC.
     *
     * @param recoveryNetworkSecurityGroupId the recoveryNetworkSecurityGroupId value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withRecoveryNetworkSecurityGroupId(String recoveryNetworkSecurityGroupId) {
        this.recoveryNetworkSecurityGroupId = recoveryNetworkSecurityGroupId;
        return this;
    }

    /**
     * Get the enableAcceleratedNetworkingOnRecovery property: A value indicating whether the NIC has accelerated
     * networking enabled.
     *
     * @return the enableAcceleratedNetworkingOnRecovery value.
     */
    public Boolean enableAcceleratedNetworkingOnRecovery() {
        return this.enableAcceleratedNetworkingOnRecovery;
    }

    /**
     * Set the enableAcceleratedNetworkingOnRecovery property: A value indicating whether the NIC has accelerated
     * networking enabled.
     *
     * @param enableAcceleratedNetworkingOnRecovery the enableAcceleratedNetworkingOnRecovery value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withEnableAcceleratedNetworkingOnRecovery(Boolean enableAcceleratedNetworkingOnRecovery) {
        this.enableAcceleratedNetworkingOnRecovery = enableAcceleratedNetworkingOnRecovery;
        return this;
    }

    /**
     * Get the tfoVMNetworkId property: The network to be used by NIC during test failover.
     *
     * @return the tfoVMNetworkId value.
     */
    public String tfoVMNetworkId() {
        return this.tfoVMNetworkId;
    }

    /**
     * Set the tfoVMNetworkId property: The network to be used by NIC during test failover.
     *
     * @param tfoVMNetworkId the tfoVMNetworkId value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withTfoVMNetworkId(String tfoVMNetworkId) {
        this.tfoVMNetworkId = tfoVMNetworkId;
        return this;
    }

    /**
     * Get the tfoNetworkSecurityGroupId property: The NSG to be used by NIC during test failover.
     *
     * @return the tfoNetworkSecurityGroupId value.
     */
    public String tfoNetworkSecurityGroupId() {
        return this.tfoNetworkSecurityGroupId;
    }

    /**
     * Set the tfoNetworkSecurityGroupId property: The NSG to be used by NIC during test failover.
     *
     * @param tfoNetworkSecurityGroupId the tfoNetworkSecurityGroupId value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withTfoNetworkSecurityGroupId(String tfoNetworkSecurityGroupId) {
        this.tfoNetworkSecurityGroupId = tfoNetworkSecurityGroupId;
        return this;
    }

    /**
     * Get the enableAcceleratedNetworkingOnTfo property: Whether the TFO NIC has accelerated networking enabled.
     *
     * @return the enableAcceleratedNetworkingOnTfo value.
     */
    public Boolean enableAcceleratedNetworkingOnTfo() {
        return this.enableAcceleratedNetworkingOnTfo;
    }

    /**
     * Set the enableAcceleratedNetworkingOnTfo property: Whether the TFO NIC has accelerated networking enabled.
     *
     * @param enableAcceleratedNetworkingOnTfo the enableAcceleratedNetworkingOnTfo value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withEnableAcceleratedNetworkingOnTfo(Boolean enableAcceleratedNetworkingOnTfo) {
        this.enableAcceleratedNetworkingOnTfo = enableAcceleratedNetworkingOnTfo;
        return this;
    }

    /**
     * Get the recoveryNicName property: The name of the NIC to be used when creating target NICs.
     *
     * @return the recoveryNicName value.
     */
    public String recoveryNicName() {
        return this.recoveryNicName;
    }

    /**
     * Set the recoveryNicName property: The name of the NIC to be used when creating target NICs.
     *
     * @param recoveryNicName the recoveryNicName value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withRecoveryNicName(String recoveryNicName) {
        this.recoveryNicName = recoveryNicName;
        return this;
    }

    /**
     * Get the recoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target
     * NICs.
     *
     * @return the recoveryNicResourceGroupName value.
     */
    public String recoveryNicResourceGroupName() {
        return this.recoveryNicResourceGroupName;
    }

    /**
     * Set the recoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target
     * NICs.
     *
     * @param recoveryNicResourceGroupName the recoveryNicResourceGroupName value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withRecoveryNicResourceGroupName(String recoveryNicResourceGroupName) {
        this.recoveryNicResourceGroupName = recoveryNicResourceGroupName;
        return this;
    }

    /**
     * Get the reuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during
     * failover subject to availability.
     *
     * @return the reuseExistingNic value.
     */
    public Boolean reuseExistingNic() {
        return this.reuseExistingNic;
    }

    /**
     * Set the reuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during
     * failover subject to availability.
     *
     * @param reuseExistingNic the reuseExistingNic value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withReuseExistingNic(Boolean reuseExistingNic) {
        this.reuseExistingNic = reuseExistingNic;
        return this;
    }

    /**
     * Get the tfoRecoveryNicName property: The name of the NIC to be used when creating target NICs in TFO.
     *
     * @return the tfoRecoveryNicName value.
     */
    public String tfoRecoveryNicName() {
        return this.tfoRecoveryNicName;
    }

    /**
     * Set the tfoRecoveryNicName property: The name of the NIC to be used when creating target NICs in TFO.
     *
     * @param tfoRecoveryNicName the tfoRecoveryNicName value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withTfoRecoveryNicName(String tfoRecoveryNicName) {
        this.tfoRecoveryNicName = tfoRecoveryNicName;
        return this;
    }

    /**
     * Get the tfoRecoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target
     * NICs in TFO.
     *
     * @return the tfoRecoveryNicResourceGroupName value.
     */
    public String tfoRecoveryNicResourceGroupName() {
        return this.tfoRecoveryNicResourceGroupName;
    }

    /**
     * Set the tfoRecoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target
     * NICs in TFO.
     *
     * @param tfoRecoveryNicResourceGroupName the tfoRecoveryNicResourceGroupName value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withTfoRecoveryNicResourceGroupName(String tfoRecoveryNicResourceGroupName) {
        this.tfoRecoveryNicResourceGroupName = tfoRecoveryNicResourceGroupName;
        return this;
    }

    /**
     * Get the tfoReuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during
     * test failover subject to availability.
     *
     * @return the tfoReuseExistingNic value.
     */
    public Boolean tfoReuseExistingNic() {
        return this.tfoReuseExistingNic;
    }

    /**
     * Set the tfoReuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during
     * test failover subject to availability.
     *
     * @param tfoReuseExistingNic the tfoReuseExistingNic value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withTfoReuseExistingNic(Boolean tfoReuseExistingNic) {
        this.tfoReuseExistingNic = tfoReuseExistingNic;
        return this;
    }

    /**
     * Get the targetNicName property: Target NIC name.
     *
     * @return the targetNicName value.
     */
    public String targetNicName() {
        return this.targetNicName;
    }

    /**
     * Set the targetNicName property: Target NIC name.
     *
     * @param targetNicName the targetNicName value to set.
     * @return the VMNicDetails object itself.
     */
    public VMNicDetails withTargetNicName(String targetNicName) {
        this.targetNicName = targetNicName;
        return this;
    }

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