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

com.azure.resourcemanager.hdinsight.models.NetworkProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for HDInsight Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Management Client. Package tag package-2024-08-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.hdinsight.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;

/**
 * The network properties.
 */
@Fluent
public final class NetworkProperties implements JsonSerializable {
    /*
     * A value to describe how the outbound dependencies of a HDInsight cluster are managed. 'Managed' means that the
     * outbound dependencies are managed by the HDInsight service. 'External' means that the outbound dependencies are
     * managed by a customer specific solution.
     */
    private OutboundDependenciesManagedType outboundDependenciesManagedType;

    /*
     * The direction for the resource provider connection.
     */
    private ResourceProviderConnection resourceProviderConnection;

    /*
     * Indicates whether or not private link is enabled.
     */
    private PrivateLink privateLink;

    /*
     * Gets or sets the IP tag for the public IPs created along with the HDInsight Clusters.
     */
    private IpTag publicIpTag;

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

    /**
     * Get the outboundDependenciesManagedType property: A value to describe how the outbound dependencies of a
     * HDInsight cluster are managed. 'Managed' means that the outbound dependencies are managed by the HDInsight
     * service. 'External' means that the outbound dependencies are managed by a customer specific solution.
     * 
     * @return the outboundDependenciesManagedType value.
     */
    public OutboundDependenciesManagedType outboundDependenciesManagedType() {
        return this.outboundDependenciesManagedType;
    }

    /**
     * Set the outboundDependenciesManagedType property: A value to describe how the outbound dependencies of a
     * HDInsight cluster are managed. 'Managed' means that the outbound dependencies are managed by the HDInsight
     * service. 'External' means that the outbound dependencies are managed by a customer specific solution.
     * 
     * @param outboundDependenciesManagedType the outboundDependenciesManagedType value to set.
     * @return the NetworkProperties object itself.
     */
    public NetworkProperties
        withOutboundDependenciesManagedType(OutboundDependenciesManagedType outboundDependenciesManagedType) {
        this.outboundDependenciesManagedType = outboundDependenciesManagedType;
        return this;
    }

    /**
     * Get the resourceProviderConnection property: The direction for the resource provider connection.
     * 
     * @return the resourceProviderConnection value.
     */
    public ResourceProviderConnection resourceProviderConnection() {
        return this.resourceProviderConnection;
    }

    /**
     * Set the resourceProviderConnection property: The direction for the resource provider connection.
     * 
     * @param resourceProviderConnection the resourceProviderConnection value to set.
     * @return the NetworkProperties object itself.
     */
    public NetworkProperties withResourceProviderConnection(ResourceProviderConnection resourceProviderConnection) {
        this.resourceProviderConnection = resourceProviderConnection;
        return this;
    }

    /**
     * Get the privateLink property: Indicates whether or not private link is enabled.
     * 
     * @return the privateLink value.
     */
    public PrivateLink privateLink() {
        return this.privateLink;
    }

    /**
     * Set the privateLink property: Indicates whether or not private link is enabled.
     * 
     * @param privateLink the privateLink value to set.
     * @return the NetworkProperties object itself.
     */
    public NetworkProperties withPrivateLink(PrivateLink privateLink) {
        this.privateLink = privateLink;
        return this;
    }

    /**
     * Get the publicIpTag property: Gets or sets the IP tag for the public IPs created along with the HDInsight
     * Clusters.
     * 
     * @return the publicIpTag value.
     */
    public IpTag publicIpTag() {
        return this.publicIpTag;
    }

    /**
     * Set the publicIpTag property: Gets or sets the IP tag for the public IPs created along with the HDInsight
     * Clusters.
     * 
     * @param publicIpTag the publicIpTag value to set.
     * @return the NetworkProperties object itself.
     */
    public NetworkProperties withPublicIpTag(IpTag publicIpTag) {
        this.publicIpTag = publicIpTag;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("outboundDependenciesManagedType",
            this.outboundDependenciesManagedType == null ? null : this.outboundDependenciesManagedType.toString());
        jsonWriter.writeStringField("resourceProviderConnection",
            this.resourceProviderConnection == null ? null : this.resourceProviderConnection.toString());
        jsonWriter.writeStringField("privateLink", this.privateLink == null ? null : this.privateLink.toString());
        jsonWriter.writeJsonField("publicIpTag", this.publicIpTag);
        return jsonWriter.writeEndObject();
    }

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

                if ("outboundDependenciesManagedType".equals(fieldName)) {
                    deserializedNetworkProperties.outboundDependenciesManagedType
                        = OutboundDependenciesManagedType.fromString(reader.getString());
                } else if ("resourceProviderConnection".equals(fieldName)) {
                    deserializedNetworkProperties.resourceProviderConnection
                        = ResourceProviderConnection.fromString(reader.getString());
                } else if ("privateLink".equals(fieldName)) {
                    deserializedNetworkProperties.privateLink = PrivateLink.fromString(reader.getString());
                } else if ("publicIpTag".equals(fieldName)) {
                    deserializedNetworkProperties.publicIpTag = IpTag.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedNetworkProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy