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

com.azure.resourcemanager.netapp.models.PeerClusterForVolumeMigrationRequest Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-2024-03.

There is a newer version: 1.4.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.netapp.models;

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

/**
 * Source Cluster properties for a cluster peer request.
 */
@Fluent
public final class PeerClusterForVolumeMigrationRequest
    implements JsonSerializable {
    /*
     * A list of IC-LIF IPs that can be used to connect to the On-prem cluster
     */
    private List peerIpAddresses;

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

    /**
     * Get the peerIpAddresses property: A list of IC-LIF IPs that can be used to connect to the On-prem cluster.
     * 
     * @return the peerIpAddresses value.
     */
    public List peerIpAddresses() {
        return this.peerIpAddresses;
    }

    /**
     * Set the peerIpAddresses property: A list of IC-LIF IPs that can be used to connect to the On-prem cluster.
     * 
     * @param peerIpAddresses the peerIpAddresses value to set.
     * @return the PeerClusterForVolumeMigrationRequest object itself.
     */
    public PeerClusterForVolumeMigrationRequest withPeerIpAddresses(List peerIpAddresses) {
        this.peerIpAddresses = peerIpAddresses;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (peerIpAddresses() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property peerIpAddresses in model PeerClusterForVolumeMigrationRequest"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(PeerClusterForVolumeMigrationRequest.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeArrayField("peerIpAddresses", this.peerIpAddresses,
            (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("peerIpAddresses".equals(fieldName)) {
                    List peerIpAddresses = reader.readArray(reader1 -> reader1.getString());
                    deserializedPeerClusterForVolumeMigrationRequest.peerIpAddresses = peerIpAddresses;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedPeerClusterForVolumeMigrationRequest;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy