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

com.azure.resourcemanager.datafactory.models.ManagedPrivateEndpoint Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datafactory.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.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Properties of a managed private endpoint.
 */
@Fluent
public final class ManagedPrivateEndpoint implements JsonSerializable {
    /*
     * The managed private endpoint connection state
     */
    private ConnectionStateProperties connectionState;

    /*
     * Fully qualified domain names
     */
    private List fqdns;

    /*
     * The groupId to which the managed private endpoint is created
     */
    private String groupId;

    /*
     * Denotes whether the managed private endpoint is reserved
     */
    private Boolean isReserved;

    /*
     * The ARM resource ID of the resource to which the managed private endpoint is created
     */
    private String privateLinkResourceId;

    /*
     * The managed private endpoint provisioning state
     */
    private String provisioningState;

    /*
     * Properties of a managed private endpoint
     */
    private Map additionalProperties;

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

    /**
     * Get the connectionState property: The managed private endpoint connection state.
     * 
     * @return the connectionState value.
     */
    public ConnectionStateProperties connectionState() {
        return this.connectionState;
    }

    /**
     * Set the connectionState property: The managed private endpoint connection state.
     * 
     * @param connectionState the connectionState value to set.
     * @return the ManagedPrivateEndpoint object itself.
     */
    public ManagedPrivateEndpoint withConnectionState(ConnectionStateProperties connectionState) {
        this.connectionState = connectionState;
        return this;
    }

    /**
     * Get the fqdns property: Fully qualified domain names.
     * 
     * @return the fqdns value.
     */
    public List fqdns() {
        return this.fqdns;
    }

    /**
     * Set the fqdns property: Fully qualified domain names.
     * 
     * @param fqdns the fqdns value to set.
     * @return the ManagedPrivateEndpoint object itself.
     */
    public ManagedPrivateEndpoint withFqdns(List fqdns) {
        this.fqdns = fqdns;
        return this;
    }

    /**
     * Get the groupId property: The groupId to which the managed private endpoint is created.
     * 
     * @return the groupId value.
     */
    public String groupId() {
        return this.groupId;
    }

    /**
     * Set the groupId property: The groupId to which the managed private endpoint is created.
     * 
     * @param groupId the groupId value to set.
     * @return the ManagedPrivateEndpoint object itself.
     */
    public ManagedPrivateEndpoint withGroupId(String groupId) {
        this.groupId = groupId;
        return this;
    }

    /**
     * Get the isReserved property: Denotes whether the managed private endpoint is reserved.
     * 
     * @return the isReserved value.
     */
    public Boolean isReserved() {
        return this.isReserved;
    }

    /**
     * Get the privateLinkResourceId property: The ARM resource ID of the resource to which the managed private endpoint
     * is created.
     * 
     * @return the privateLinkResourceId value.
     */
    public String privateLinkResourceId() {
        return this.privateLinkResourceId;
    }

    /**
     * Set the privateLinkResourceId property: The ARM resource ID of the resource to which the managed private endpoint
     * is created.
     * 
     * @param privateLinkResourceId the privateLinkResourceId value to set.
     * @return the ManagedPrivateEndpoint object itself.
     */
    public ManagedPrivateEndpoint withPrivateLinkResourceId(String privateLinkResourceId) {
        this.privateLinkResourceId = privateLinkResourceId;
        return this;
    }

    /**
     * Get the provisioningState property: The managed private endpoint provisioning state.
     * 
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the additionalProperties property: Properties of a managed private endpoint.
     * 
     * @return the additionalProperties value.
     */
    public Map additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: Properties of a managed private endpoint.
     * 
     * @param additionalProperties the additionalProperties value to set.
     * @return the ManagedPrivateEndpoint object itself.
     */
    public ManagedPrivateEndpoint withAdditionalProperties(Map additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("connectionState", this.connectionState);
        jsonWriter.writeArrayField("fqdns", this.fqdns, (writer, element) -> writer.writeString(element));
        jsonWriter.writeStringField("groupId", this.groupId);
        jsonWriter.writeStringField("privateLinkResourceId", this.privateLinkResourceId);
        if (additionalProperties != null) {
            for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
                jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
            }
        }
        return jsonWriter.writeEndObject();
    }

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

                if ("connectionState".equals(fieldName)) {
                    deserializedManagedPrivateEndpoint.connectionState = ConnectionStateProperties.fromJson(reader);
                } else if ("fqdns".equals(fieldName)) {
                    List fqdns = reader.readArray(reader1 -> reader1.getString());
                    deserializedManagedPrivateEndpoint.fqdns = fqdns;
                } else if ("groupId".equals(fieldName)) {
                    deserializedManagedPrivateEndpoint.groupId = reader.getString();
                } else if ("isReserved".equals(fieldName)) {
                    deserializedManagedPrivateEndpoint.isReserved = reader.getNullable(JsonReader::getBoolean);
                } else if ("privateLinkResourceId".equals(fieldName)) {
                    deserializedManagedPrivateEndpoint.privateLinkResourceId = reader.getString();
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedManagedPrivateEndpoint.provisioningState = reader.getString();
                } else {
                    if (additionalProperties == null) {
                        additionalProperties = new LinkedHashMap<>();
                    }

                    additionalProperties.put(fieldName, reader.readUntyped());
                }
            }
            deserializedManagedPrivateEndpoint.additionalProperties = additionalProperties;

            return deserializedManagedPrivateEndpoint;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy