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

com.azure.resourcemanager.storagecache.models.NamespaceJunction Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob storage, for use on demand. These operations create and manage Azure Managed Lustre file systems. Package tag package-2024-03.

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.storagecache.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;

/**
 * A namespace junction.
 */
@Fluent
public final class NamespaceJunction implements JsonSerializable {
    /*
     * Namespace path on a cache for a Storage Target.
     */
    private String namespacePath;

    /*
     * Path in Storage Target to which namespacePath points.
     */
    private String targetPath;

    /*
     * NFS export where targetPath exists.
     */
    private String nfsExport;

    /*
     * Name of the access policy applied to this junction.
     */
    private String nfsAccessPolicy;

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

    /**
     * Get the namespacePath property: Namespace path on a cache for a Storage Target.
     * 
     * @return the namespacePath value.
     */
    public String namespacePath() {
        return this.namespacePath;
    }

    /**
     * Set the namespacePath property: Namespace path on a cache for a Storage Target.
     * 
     * @param namespacePath the namespacePath value to set.
     * @return the NamespaceJunction object itself.
     */
    public NamespaceJunction withNamespacePath(String namespacePath) {
        this.namespacePath = namespacePath;
        return this;
    }

    /**
     * Get the targetPath property: Path in Storage Target to which namespacePath points.
     * 
     * @return the targetPath value.
     */
    public String targetPath() {
        return this.targetPath;
    }

    /**
     * Set the targetPath property: Path in Storage Target to which namespacePath points.
     * 
     * @param targetPath the targetPath value to set.
     * @return the NamespaceJunction object itself.
     */
    public NamespaceJunction withTargetPath(String targetPath) {
        this.targetPath = targetPath;
        return this;
    }

    /**
     * Get the nfsExport property: NFS export where targetPath exists.
     * 
     * @return the nfsExport value.
     */
    public String nfsExport() {
        return this.nfsExport;
    }

    /**
     * Set the nfsExport property: NFS export where targetPath exists.
     * 
     * @param nfsExport the nfsExport value to set.
     * @return the NamespaceJunction object itself.
     */
    public NamespaceJunction withNfsExport(String nfsExport) {
        this.nfsExport = nfsExport;
        return this;
    }

    /**
     * Get the nfsAccessPolicy property: Name of the access policy applied to this junction.
     * 
     * @return the nfsAccessPolicy value.
     */
    public String nfsAccessPolicy() {
        return this.nfsAccessPolicy;
    }

    /**
     * Set the nfsAccessPolicy property: Name of the access policy applied to this junction.
     * 
     * @param nfsAccessPolicy the nfsAccessPolicy value to set.
     * @return the NamespaceJunction object itself.
     */
    public NamespaceJunction withNfsAccessPolicy(String nfsAccessPolicy) {
        this.nfsAccessPolicy = nfsAccessPolicy;
        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("namespacePath", this.namespacePath);
        jsonWriter.writeStringField("targetPath", this.targetPath);
        jsonWriter.writeStringField("nfsExport", this.nfsExport);
        jsonWriter.writeStringField("nfsAccessPolicy", this.nfsAccessPolicy);
        return jsonWriter.writeEndObject();
    }

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

                if ("namespacePath".equals(fieldName)) {
                    deserializedNamespaceJunction.namespacePath = reader.getString();
                } else if ("targetPath".equals(fieldName)) {
                    deserializedNamespaceJunction.targetPath = reader.getString();
                } else if ("nfsExport".equals(fieldName)) {
                    deserializedNamespaceJunction.nfsExport = reader.getString();
                } else if ("nfsAccessPolicy".equals(fieldName)) {
                    deserializedNamespaceJunction.nfsAccessPolicy = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedNamespaceJunction;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy