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

com.azure.resourcemanager.netapp.fluent.models.SubvolumeModelInner 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.fluent.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.time.OffsetDateTime;

/**
 * Result of the post subvolume and action is to get metadata of the subvolume.
 */
@Fluent
public final class SubvolumeModelInner implements JsonSerializable {
    /*
     * Resource Id
     */
    private String id;

    /*
     * Resource name
     */
    private String name;

    /*
     * Resource type
     */
    private String type;

    /*
     * It represents the minimal properties of the subvolume.
     */
    private SubvolumeModelProperties innerProperties;

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

    /**
     * Get the id property: Resource Id.
     * 
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

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

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

    /**
     * Get the innerProperties property: It represents the minimal properties of the subvolume.
     * 
     * @return the innerProperties value.
     */
    private SubvolumeModelProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the path property: Path to the subvolume.
     * 
     * @return the path value.
     */
    public String path() {
        return this.innerProperties() == null ? null : this.innerProperties().path();
    }

    /**
     * Set the path property: Path to the subvolume.
     * 
     * @param path the path value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withPath(String path) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withPath(path);
        return this;
    }

    /**
     * Get the parentPath property: Path to the parent subvolume.
     * 
     * @return the parentPath value.
     */
    public String parentPath() {
        return this.innerProperties() == null ? null : this.innerProperties().parentPath();
    }

    /**
     * Set the parentPath property: Path to the parent subvolume.
     * 
     * @param parentPath the parentPath value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withParentPath(String parentPath) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withParentPath(parentPath);
        return this;
    }

    /**
     * Get the size property: Size of subvolume.
     * 
     * @return the size value.
     */
    public Long size() {
        return this.innerProperties() == null ? null : this.innerProperties().size();
    }

    /**
     * Set the size property: Size of subvolume.
     * 
     * @param size the size value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withSize(Long size) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withSize(size);
        return this;
    }

    /**
     * Get the bytesUsed property: Bytes used.
     * 
     * @return the bytesUsed value.
     */
    public Long bytesUsed() {
        return this.innerProperties() == null ? null : this.innerProperties().bytesUsed();
    }

    /**
     * Set the bytesUsed property: Bytes used.
     * 
     * @param bytesUsed the bytesUsed value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withBytesUsed(Long bytesUsed) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withBytesUsed(bytesUsed);
        return this;
    }

    /**
     * Get the permissions property: Permissions of the subvolume.
     * 
     * @return the permissions value.
     */
    public String permissions() {
        return this.innerProperties() == null ? null : this.innerProperties().permissions();
    }

    /**
     * Set the permissions property: Permissions of the subvolume.
     * 
     * @param permissions the permissions value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withPermissions(String permissions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withPermissions(permissions);
        return this;
    }

    /**
     * Get the creationTimestamp property: Creation time and date.
     * 
     * @return the creationTimestamp value.
     */
    public OffsetDateTime creationTimestamp() {
        return this.innerProperties() == null ? null : this.innerProperties().creationTimestamp();
    }

    /**
     * Set the creationTimestamp property: Creation time and date.
     * 
     * @param creationTimestamp the creationTimestamp value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withCreationTimestamp(OffsetDateTime creationTimestamp) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withCreationTimestamp(creationTimestamp);
        return this;
    }

    /**
     * Get the accessedTimestamp property: Most recent access time and date.
     * 
     * @return the accessedTimestamp value.
     */
    public OffsetDateTime accessedTimestamp() {
        return this.innerProperties() == null ? null : this.innerProperties().accessedTimestamp();
    }

    /**
     * Set the accessedTimestamp property: Most recent access time and date.
     * 
     * @param accessedTimestamp the accessedTimestamp value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withAccessedTimestamp(OffsetDateTime accessedTimestamp) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withAccessedTimestamp(accessedTimestamp);
        return this;
    }

    /**
     * Get the modifiedTimestamp property: Most recent modification time and date.
     * 
     * @return the modifiedTimestamp value.
     */
    public OffsetDateTime modifiedTimestamp() {
        return this.innerProperties() == null ? null : this.innerProperties().modifiedTimestamp();
    }

    /**
     * Set the modifiedTimestamp property: Most recent modification time and date.
     * 
     * @param modifiedTimestamp the modifiedTimestamp value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withModifiedTimestamp(OffsetDateTime modifiedTimestamp) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withModifiedTimestamp(modifiedTimestamp);
        return this;
    }

    /**
     * Get the changedTimestamp property: Most recent change time and date.
     * 
     * @return the changedTimestamp value.
     */
    public OffsetDateTime changedTimestamp() {
        return this.innerProperties() == null ? null : this.innerProperties().changedTimestamp();
    }

    /**
     * Set the changedTimestamp property: Most recent change time and date.
     * 
     * @param changedTimestamp the changedTimestamp value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withChangedTimestamp(OffsetDateTime changedTimestamp) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withChangedTimestamp(changedTimestamp);
        return this;
    }

    /**
     * Get the provisioningState property: Azure lifecycle management.
     * 
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Set the provisioningState property: Azure lifecycle management.
     * 
     * @param provisioningState the provisioningState value to set.
     * @return the SubvolumeModelInner object itself.
     */
    public SubvolumeModelInner withProvisioningState(String provisioningState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SubvolumeModelProperties();
        }
        this.innerProperties().withProvisioningState(provisioningState);
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedSubvolumeModelInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedSubvolumeModelInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedSubvolumeModelInner.type = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedSubvolumeModelInner.innerProperties = SubvolumeModelProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSubvolumeModelInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy