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

com.azure.resourcemanager.deviceupdate.models.RemotePrivateEndpoint 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.deviceupdate.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;

/**
 * Remote private endpoint details.
 */
@Fluent
public final class RemotePrivateEndpoint implements JsonSerializable {
    /*
     * Remote endpoint resource ID.
     */
    private String id;

    /*
     * ARM location of the remote private endpoint.
     */
    private String location;

    /*
     * Original subscription ID needed by Microsoft.Network.
     */
    private String immutableSubscriptionId;

    /*
     * Original resource ID needed by Microsoft.Network.
     */
    private String immutableResourceId;

    /*
     * Virtual network traffic tag.
     */
    private String vnetTrafficTag;

    /*
     * List of private link service connections that need manual approval.
     */
    private List manualPrivateLinkServiceConnections;

    /*
     * List of automatically approved private link service connections.
     */
    private List privateLinkServiceConnections;

    /*
     * List of private link service proxies.
     */
    private List privateLinkServiceProxies;

    /*
     * List of connection details.
     */
    private List connectionDetails;

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

    /**
     * Get the id property: Remote endpoint resource ID.
     * 
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Remote endpoint resource ID.
     * 
     * @param id the id value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the location property: ARM location of the remote private endpoint.
     * 
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: ARM location of the remote private endpoint.
     * 
     * @param location the location value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the immutableSubscriptionId property: Original subscription ID needed by Microsoft.Network.
     * 
     * @return the immutableSubscriptionId value.
     */
    public String immutableSubscriptionId() {
        return this.immutableSubscriptionId;
    }

    /**
     * Set the immutableSubscriptionId property: Original subscription ID needed by Microsoft.Network.
     * 
     * @param immutableSubscriptionId the immutableSubscriptionId value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint withImmutableSubscriptionId(String immutableSubscriptionId) {
        this.immutableSubscriptionId = immutableSubscriptionId;
        return this;
    }

    /**
     * Get the immutableResourceId property: Original resource ID needed by Microsoft.Network.
     * 
     * @return the immutableResourceId value.
     */
    public String immutableResourceId() {
        return this.immutableResourceId;
    }

    /**
     * Set the immutableResourceId property: Original resource ID needed by Microsoft.Network.
     * 
     * @param immutableResourceId the immutableResourceId value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint withImmutableResourceId(String immutableResourceId) {
        this.immutableResourceId = immutableResourceId;
        return this;
    }

    /**
     * Get the vnetTrafficTag property: Virtual network traffic tag.
     * 
     * @return the vnetTrafficTag value.
     */
    public String vnetTrafficTag() {
        return this.vnetTrafficTag;
    }

    /**
     * Set the vnetTrafficTag property: Virtual network traffic tag.
     * 
     * @param vnetTrafficTag the vnetTrafficTag value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint withVnetTrafficTag(String vnetTrafficTag) {
        this.vnetTrafficTag = vnetTrafficTag;
        return this;
    }

    /**
     * Get the manualPrivateLinkServiceConnections property: List of private link service connections that need manual
     * approval.
     * 
     * @return the manualPrivateLinkServiceConnections value.
     */
    public List manualPrivateLinkServiceConnections() {
        return this.manualPrivateLinkServiceConnections;
    }

    /**
     * Set the manualPrivateLinkServiceConnections property: List of private link service connections that need manual
     * approval.
     * 
     * @param manualPrivateLinkServiceConnections the manualPrivateLinkServiceConnections value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint withManualPrivateLinkServiceConnections(
        List manualPrivateLinkServiceConnections) {
        this.manualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections;
        return this;
    }

    /**
     * Get the privateLinkServiceConnections property: List of automatically approved private link service connections.
     * 
     * @return the privateLinkServiceConnections value.
     */
    public List privateLinkServiceConnections() {
        return this.privateLinkServiceConnections;
    }

    /**
     * Set the privateLinkServiceConnections property: List of automatically approved private link service connections.
     * 
     * @param privateLinkServiceConnections the privateLinkServiceConnections value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint
        withPrivateLinkServiceConnections(List privateLinkServiceConnections) {
        this.privateLinkServiceConnections = privateLinkServiceConnections;
        return this;
    }

    /**
     * Get the privateLinkServiceProxies property: List of private link service proxies.
     * 
     * @return the privateLinkServiceProxies value.
     */
    public List privateLinkServiceProxies() {
        return this.privateLinkServiceProxies;
    }

    /**
     * Set the privateLinkServiceProxies property: List of private link service proxies.
     * 
     * @param privateLinkServiceProxies the privateLinkServiceProxies value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint
        withPrivateLinkServiceProxies(List privateLinkServiceProxies) {
        this.privateLinkServiceProxies = privateLinkServiceProxies;
        return this;
    }

    /**
     * Get the connectionDetails property: List of connection details.
     * 
     * @return the connectionDetails value.
     */
    public List connectionDetails() {
        return this.connectionDetails;
    }

    /**
     * Set the connectionDetails property: List of connection details.
     * 
     * @param connectionDetails the connectionDetails value to set.
     * @return the RemotePrivateEndpoint object itself.
     */
    public RemotePrivateEndpoint withConnectionDetails(List connectionDetails) {
        this.connectionDetails = connectionDetails;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("id", this.id);
        jsonWriter.writeStringField("location", this.location);
        jsonWriter.writeStringField("immutableSubscriptionId", this.immutableSubscriptionId);
        jsonWriter.writeStringField("immutableResourceId", this.immutableResourceId);
        jsonWriter.writeStringField("vnetTrafficTag", this.vnetTrafficTag);
        jsonWriter.writeArrayField("manualPrivateLinkServiceConnections", this.manualPrivateLinkServiceConnections,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("privateLinkServiceConnections", this.privateLinkServiceConnections,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("privateLinkServiceProxies", this.privateLinkServiceProxies,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("connectionDetails", this.connectionDetails,
            (writer, element) -> writer.writeJson(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedRemotePrivateEndpoint.id = reader.getString();
                } else if ("location".equals(fieldName)) {
                    deserializedRemotePrivateEndpoint.location = reader.getString();
                } else if ("immutableSubscriptionId".equals(fieldName)) {
                    deserializedRemotePrivateEndpoint.immutableSubscriptionId = reader.getString();
                } else if ("immutableResourceId".equals(fieldName)) {
                    deserializedRemotePrivateEndpoint.immutableResourceId = reader.getString();
                } else if ("vnetTrafficTag".equals(fieldName)) {
                    deserializedRemotePrivateEndpoint.vnetTrafficTag = reader.getString();
                } else if ("manualPrivateLinkServiceConnections".equals(fieldName)) {
                    List manualPrivateLinkServiceConnections
                        = reader.readArray(reader1 -> PrivateLinkServiceConnection.fromJson(reader1));
                    deserializedRemotePrivateEndpoint.manualPrivateLinkServiceConnections
                        = manualPrivateLinkServiceConnections;
                } else if ("privateLinkServiceConnections".equals(fieldName)) {
                    List privateLinkServiceConnections
                        = reader.readArray(reader1 -> PrivateLinkServiceConnection.fromJson(reader1));
                    deserializedRemotePrivateEndpoint.privateLinkServiceConnections = privateLinkServiceConnections;
                } else if ("privateLinkServiceProxies".equals(fieldName)) {
                    List privateLinkServiceProxies
                        = reader.readArray(reader1 -> PrivateLinkServiceProxy.fromJson(reader1));
                    deserializedRemotePrivateEndpoint.privateLinkServiceProxies = privateLinkServiceProxies;
                } else if ("connectionDetails".equals(fieldName)) {
                    List connectionDetails
                        = reader.readArray(reader1 -> ConnectionDetails.fromJson(reader1));
                    deserializedRemotePrivateEndpoint.connectionDetails = connectionDetails;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedRemotePrivateEndpoint;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy