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

com.azure.resourcemanager.netapp.models.KeyVaultPrivateEndpoint 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-2024-03.

There is a newer version: 1.4.0
Show 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.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * keyVaultPrivateEndpoint
 * 
 * Pairs of virtual network ID and private endpoint ID. Every virtual network that has volumes encrypted with
 * customer-managed keys needs its own key vault private endpoint.
 */
@Fluent
public final class KeyVaultPrivateEndpoint implements JsonSerializable {
    /*
     * Identifier for the virtual network id
     */
    private String virtualNetworkId;

    /*
     * Identifier of the private endpoint to reach the Azure Key Vault
     */
    private String privateEndpointId;

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

    /**
     * Get the virtualNetworkId property: Identifier for the virtual network id.
     * 
     * @return the virtualNetworkId value.
     */
    public String virtualNetworkId() {
        return this.virtualNetworkId;
    }

    /**
     * Set the virtualNetworkId property: Identifier for the virtual network id.
     * 
     * @param virtualNetworkId the virtualNetworkId value to set.
     * @return the KeyVaultPrivateEndpoint object itself.
     */
    public KeyVaultPrivateEndpoint withVirtualNetworkId(String virtualNetworkId) {
        this.virtualNetworkId = virtualNetworkId;
        return this;
    }

    /**
     * Get the privateEndpointId property: Identifier of the private endpoint to reach the Azure Key Vault.
     * 
     * @return the privateEndpointId value.
     */
    public String privateEndpointId() {
        return this.privateEndpointId;
    }

    /**
     * Set the privateEndpointId property: Identifier of the private endpoint to reach the Azure Key Vault.
     * 
     * @param privateEndpointId the privateEndpointId value to set.
     * @return the KeyVaultPrivateEndpoint object itself.
     */
    public KeyVaultPrivateEndpoint withPrivateEndpointId(String privateEndpointId) {
        this.privateEndpointId = privateEndpointId;
        return this;
    }

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

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

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

                if ("virtualNetworkId".equals(fieldName)) {
                    deserializedKeyVaultPrivateEndpoint.virtualNetworkId = reader.getString();
                } else if ("privateEndpointId".equals(fieldName)) {
                    deserializedKeyVaultPrivateEndpoint.privateEndpointId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedKeyVaultPrivateEndpoint;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy