All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.recoveryservicesdatareplication.models.VMwareToAzStackHciProtectedNicProperties Maven / Gradle / Ivy

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

package com.azure.resourcemanager.recoveryservicesdatareplication.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * VMwareToAzStackHCI NIC properties.
 */
@Fluent
public final class VMwareToAzStackHciProtectedNicProperties
    implements JsonSerializable {
    /*
     * Gets or sets the NIC Id.
     */
    private String nicId;

    /*
     * Gets or sets the NIC mac address.
     */
    private String macAddress;

    /*
     * Gets or sets the NIC label.
     */
    private String label;

    /*
     * Gets or sets a value indicating whether this is the primary NIC.
     */
    private Boolean isPrimaryNic;

    /*
     * Gets or sets the network name.
     */
    private String networkName;

    /*
     * Gets or sets the target network Id within AzStackHCI Cluster.
     */
    private String targetNetworkId;

    /*
     * Gets or sets the target test network Id within AzStackHCI Cluster.
     */
    private String testNetworkId;

    /*
     * Gets or sets the selection type of the NIC.
     */
    private VMNicSelection selectionTypeForFailover;

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

    /**
     * Get the nicId property: Gets or sets the NIC Id.
     * 
     * @return the nicId value.
     */
    public String nicId() {
        return this.nicId;
    }

    /**
     * Get the macAddress property: Gets or sets the NIC mac address.
     * 
     * @return the macAddress value.
     */
    public String macAddress() {
        return this.macAddress;
    }

    /**
     * Get the label property: Gets or sets the NIC label.
     * 
     * @return the label value.
     */
    public String label() {
        return this.label;
    }

    /**
     * Get the isPrimaryNic property: Gets or sets a value indicating whether this is the primary NIC.
     * 
     * @return the isPrimaryNic value.
     */
    public Boolean isPrimaryNic() {
        return this.isPrimaryNic;
    }

    /**
     * Set the isPrimaryNic property: Gets or sets a value indicating whether this is the primary NIC.
     * 
     * @param isPrimaryNic the isPrimaryNic value to set.
     * @return the VMwareToAzStackHciProtectedNicProperties object itself.
     */
    public VMwareToAzStackHciProtectedNicProperties withIsPrimaryNic(Boolean isPrimaryNic) {
        this.isPrimaryNic = isPrimaryNic;
        return this;
    }

    /**
     * Get the networkName property: Gets or sets the network name.
     * 
     * @return the networkName value.
     */
    public String networkName() {
        return this.networkName;
    }

    /**
     * Get the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster.
     * 
     * @return the targetNetworkId value.
     */
    public String targetNetworkId() {
        return this.targetNetworkId;
    }

    /**
     * Get the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster.
     * 
     * @return the testNetworkId value.
     */
    public String testNetworkId() {
        return this.testNetworkId;
    }

    /**
     * Get the selectionTypeForFailover property: Gets or sets the selection type of the NIC.
     * 
     * @return the selectionTypeForFailover value.
     */
    public VMNicSelection selectionTypeForFailover() {
        return this.selectionTypeForFailover;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeBooleanField("isPrimaryNic", this.isPrimaryNic);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of VMwareToAzStackHciProtectedNicProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of VMwareToAzStackHciProtectedNicProperties if the JsonReader was pointing to an instance of
     * it, or null if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the VMwareToAzStackHciProtectedNicProperties.
     */
    public static VMwareToAzStackHciProtectedNicProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            VMwareToAzStackHciProtectedNicProperties deserializedVMwareToAzStackHciProtectedNicProperties
                = new VMwareToAzStackHciProtectedNicProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("nicId".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.nicId = reader.getString();
                } else if ("macAddress".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.macAddress = reader.getString();
                } else if ("label".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.label = reader.getString();
                } else if ("isPrimaryNic".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.isPrimaryNic
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("networkName".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.networkName = reader.getString();
                } else if ("targetNetworkId".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.targetNetworkId = reader.getString();
                } else if ("testNetworkId".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.testNetworkId = reader.getString();
                } else if ("selectionTypeForFailover".equals(fieldName)) {
                    deserializedVMwareToAzStackHciProtectedNicProperties.selectionTypeForFailover
                        = VMNicSelection.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedVMwareToAzStackHciProtectedNicProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy