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

com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-07.

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.hybridcompute.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;
import java.util.List;

/**
 * Properties that define a Azure Arc PrivateLinkScope resource.
 */
@Fluent
public final class HybridComputePrivateLinkScopeProperties
    implements JsonSerializable {
    /*
     * Indicates whether machines associated with the private link scope can also use public Azure Arc service
     * endpoints.
     */
    private PublicNetworkAccessType publicNetworkAccess;

    /*
     * Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is
     * defined. Users cannot change this value but are able to read from it. Values will include Provisioning
     * ,Succeeded, Canceled and Failed.
     */
    private String provisioningState;

    /*
     * The Guid id of the private link scope.
     */
    private String privateLinkScopeId;

    /*
     * The collection of associated Private Endpoint Connections.
     */
    private List privateEndpointConnections;

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

    /**
     * Get the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also
     * use public Azure Arc service endpoints.
     * 
     * @return the publicNetworkAccess value.
     */
    public PublicNetworkAccessType publicNetworkAccess() {
        return this.publicNetworkAccess;
    }

    /**
     * Set the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also
     * use public Azure Arc service endpoints.
     * 
     * @param publicNetworkAccess the publicNetworkAccess value to set.
     * @return the HybridComputePrivateLinkScopeProperties object itself.
     */
    public HybridComputePrivateLinkScopeProperties
        withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess) {
        this.publicNetworkAccess = publicNetworkAccess;
        return this;
    }

    /**
     * Get the provisioningState property: Current state of this PrivateLinkScope: whether or not is has been
     * provisioned within the resource group it is defined. Users cannot change this value but are able to read from it.
     * Values will include Provisioning ,Succeeded, Canceled and Failed.
     * 
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the privateLinkScopeId property: The Guid id of the private link scope.
     * 
     * @return the privateLinkScopeId value.
     */
    public String privateLinkScopeId() {
        return this.privateLinkScopeId;
    }

    /**
     * Get the privateEndpointConnections property: The collection of associated Private Endpoint Connections.
     * 
     * @return the privateEndpointConnections value.
     */
    public List privateEndpointConnections() {
        return this.privateEndpointConnections;
    }

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

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

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

                if ("publicNetworkAccess".equals(fieldName)) {
                    deserializedHybridComputePrivateLinkScopeProperties.publicNetworkAccess
                        = PublicNetworkAccessType.fromString(reader.getString());
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedHybridComputePrivateLinkScopeProperties.provisioningState = reader.getString();
                } else if ("privateLinkScopeId".equals(fieldName)) {
                    deserializedHybridComputePrivateLinkScopeProperties.privateLinkScopeId = reader.getString();
                } else if ("privateEndpointConnections".equals(fieldName)) {
                    List privateEndpointConnections
                        = reader.readArray(reader1 -> PrivateEndpointConnectionDataModel.fromJson(reader1));
                    deserializedHybridComputePrivateLinkScopeProperties.privateEndpointConnections
                        = privateEndpointConnections;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedHybridComputePrivateLinkScopeProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy