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

com.azure.resourcemanager.netapp.models.QueryNetworkSiblingSetRequest 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-preview-2024-07-01-preview.

The 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;

/**
 * QueryNetworkSiblingSetRequest
 * 
 * Network sibling set query.
 */
@Fluent
public final class QueryNetworkSiblingSetRequest implements JsonSerializable {
    /*
     * Network Sibling Set ID for a group of volumes sharing networking resources in a subnet.
     */
    private String networkSiblingSetId;

    /*
     * The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example
     * /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/
     * subnets/{mySubnet}
     */
    private String subnetId;

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

    /**
     * Get the networkSiblingSetId property: Network Sibling Set ID for a group of volumes sharing networking resources
     * in a subnet.
     * 
     * @return the networkSiblingSetId value.
     */
    public String networkSiblingSetId() {
        return this.networkSiblingSetId;
    }

    /**
     * Set the networkSiblingSetId property: Network Sibling Set ID for a group of volumes sharing networking resources
     * in a subnet.
     * 
     * @param networkSiblingSetId the networkSiblingSetId value to set.
     * @return the QueryNetworkSiblingSetRequest object itself.
     */
    public QueryNetworkSiblingSetRequest withNetworkSiblingSetId(String networkSiblingSetId) {
        this.networkSiblingSetId = networkSiblingSetId;
        return this;
    }

    /**
     * Get the subnetId property: The Azure Resource URI for a delegated subnet. Must have the delegation
     * Microsoft.NetApp/volumes. Example
     * /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}.
     * 
     * @return the subnetId value.
     */
    public String subnetId() {
        return this.subnetId;
    }

    /**
     * Set the subnetId property: The Azure Resource URI for a delegated subnet. Must have the delegation
     * Microsoft.NetApp/volumes. Example
     * /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet}.
     * 
     * @param subnetId the subnetId value to set.
     * @return the QueryNetworkSiblingSetRequest object itself.
     */
    public QueryNetworkSiblingSetRequest withSubnetId(String subnetId) {
        this.subnetId = subnetId;
        return this;
    }

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

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

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

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

                if ("networkSiblingSetId".equals(fieldName)) {
                    deserializedQueryNetworkSiblingSetRequest.networkSiblingSetId = reader.getString();
                } else if ("subnetId".equals(fieldName)) {
                    deserializedQueryNetworkSiblingSetRequest.subnetId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedQueryNetworkSiblingSetRequest;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy