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

com.azure.resourcemanager.recoveryservicesdatareplication.models.HyperVToAzStackHciProtectedNicProperties 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.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * HyperVToAzStackHCI NIC properties.
 */
@Immutable
public final class HyperVToAzStackHciProtectedNicProperties
    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 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 HyperVToAzStackHciProtectedNicProperties class.
     */
    public HyperVToAzStackHciProtectedNicProperties() {
    }

    /**
     * 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 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();
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of HyperVToAzStackHciProtectedNicProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of HyperVToAzStackHciProtectedNicProperties 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 HyperVToAzStackHciProtectedNicProperties.
     */
    public static HyperVToAzStackHciProtectedNicProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            HyperVToAzStackHciProtectedNicProperties deserializedHyperVToAzStackHciProtectedNicProperties
                = new HyperVToAzStackHciProtectedNicProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("nicId".equals(fieldName)) {
                    deserializedHyperVToAzStackHciProtectedNicProperties.nicId = reader.getString();
                } else if ("macAddress".equals(fieldName)) {
                    deserializedHyperVToAzStackHciProtectedNicProperties.macAddress = reader.getString();
                } else if ("networkName".equals(fieldName)) {
                    deserializedHyperVToAzStackHciProtectedNicProperties.networkName = reader.getString();
                } else if ("targetNetworkId".equals(fieldName)) {
                    deserializedHyperVToAzStackHciProtectedNicProperties.targetNetworkId = reader.getString();
                } else if ("testNetworkId".equals(fieldName)) {
                    deserializedHyperVToAzStackHciProtectedNicProperties.testNetworkId = reader.getString();
                } else if ("selectionTypeForFailover".equals(fieldName)) {
                    deserializedHyperVToAzStackHciProtectedNicProperties.selectionTypeForFailover
                        = VMNicSelection.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedHyperVToAzStackHciProtectedNicProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy