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

com.azure.resourcemanager.qumulo.models.FileSystemResourceUpdate Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Qumulo Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-06-19.

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.qumulo.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.Map;

/**
 * The type used for update operations of the FileSystemResource.
 */
@Fluent
public final class FileSystemResourceUpdate implements JsonSerializable {
    /*
     * The managed service identities assigned to this resource.
     */
    private ManagedServiceIdentity identity;

    /*
     * Resource tags.
     */
    private Map tags;

    /*
     * The updatable properties of the FileSystemResource.
     */
    private FileSystemResourceUpdateProperties properties;

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

    /**
     * Get the identity property: The managed service identities assigned to this resource.
     * 
     * @return the identity value.
     */
    public ManagedServiceIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The managed service identities assigned to this resource.
     * 
     * @param identity the identity value to set.
     * @return the FileSystemResourceUpdate object itself.
     */
    public FileSystemResourceUpdate withIdentity(ManagedServiceIdentity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the tags property: Resource tags.
     * 
     * @return the tags value.
     */
    public Map tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Resource tags.
     * 
     * @param tags the tags value to set.
     * @return the FileSystemResourceUpdate object itself.
     */
    public FileSystemResourceUpdate withTags(Map tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the properties property: The updatable properties of the FileSystemResource.
     * 
     * @return the properties value.
     */
    public FileSystemResourceUpdateProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: The updatable properties of the FileSystemResource.
     * 
     * @param properties the properties value to set.
     * @return the FileSystemResourceUpdate object itself.
     */
    public FileSystemResourceUpdate withProperties(FileSystemResourceUpdateProperties properties) {
        this.properties = properties;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("identity", this.identity);
        jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
        jsonWriter.writeJsonField("properties", this.properties);
        return jsonWriter.writeEndObject();
    }

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

                if ("identity".equals(fieldName)) {
                    deserializedFileSystemResourceUpdate.identity = ManagedServiceIdentity.fromJson(reader);
                } else if ("tags".equals(fieldName)) {
                    Map tags = reader.readMap(reader1 -> reader1.getString());
                    deserializedFileSystemResourceUpdate.tags = tags;
                } else if ("properties".equals(fieldName)) {
                    deserializedFileSystemResourceUpdate.properties
                        = FileSystemResourceUpdateProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedFileSystemResourceUpdate;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy