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

com.azure.resourcemanager.netapp.fluent.models.ClusterPeerCommandResponseInner 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.fluent.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;

/**
 * Information about cluster peering process.
 */
@Fluent
public final class ClusterPeerCommandResponseInner implements JsonSerializable {
    /*
     * A command that needs to be run on the external ONTAP to accept cluster peering. Will only be present if
     * clusterPeeringStatus is pending
     */
    private String peerAcceptCommand;

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

    /**
     * Get the peerAcceptCommand property: A command that needs to be run on the external ONTAP to accept cluster
     * peering. Will only be present if <code>clusterPeeringStatus</code> is
     * <code>pending</code>.
     * 
     * @return the peerAcceptCommand value.
     */
    public String peerAcceptCommand() {
        return this.peerAcceptCommand;
    }

    /**
     * Set the peerAcceptCommand property: A command that needs to be run on the external ONTAP to accept cluster
     * peering. Will only be present if <code>clusterPeeringStatus</code> is
     * <code>pending</code>.
     * 
     * @param peerAcceptCommand the peerAcceptCommand value to set.
     * @return the ClusterPeerCommandResponseInner object itself.
     */
    public ClusterPeerCommandResponseInner withPeerAcceptCommand(String peerAcceptCommand) {
        this.peerAcceptCommand = peerAcceptCommand;
        return this;
    }

    /**
     * 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.writeStringField("peerAcceptCommand", this.peerAcceptCommand);
        return jsonWriter.writeEndObject();
    }

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

                if ("peerAcceptCommand".equals(fieldName)) {
                    deserializedClusterPeerCommandResponseInner.peerAcceptCommand = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedClusterPeerCommandResponseInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy