// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.synapse.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.synapse.models.EntityResource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Library response details. */
@Fluent
public final class LibraryResourceInner extends EntityResource {
    /*
     * Information about a library/package created at the workspace level.
     *
     * Library/package properties.
     */
    @JsonProperty(value = "properties", required = true)
    private LibraryInfo innerProperties = new LibraryInfo();

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

    /**
     * Get the innerProperties property: Information about a library/package created at the workspace level.
     *
     * <p>Library/package properties.
     *
     * @return the innerProperties value.
     */
    private LibraryInfo innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the name property: Name of the library.
     *
     * @return the name value.
     */
    public String namePropertiesName() {
        return this.innerProperties() == null ? null : this.innerProperties().name();
    }

    /**
     * Set the name property: Name of the library.
     *
     * @param name the name value to set.
     * @return the LibraryResourceInner object itself.
     */
    public LibraryResourceInner withNamePropertiesName(String name) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LibraryInfo();
        }
        this.innerProperties().withName(name);
        return this;
    }

    /**
     * Get the path property: Storage blob path of library.
     *
     * @return the path value.
     */
    public String path() {
        return this.innerProperties() == null ? null : this.innerProperties().path();
    }

    /**
     * Set the path property: Storage blob path of library.
     *
     * @param path the path value to set.
     * @return the LibraryResourceInner object itself.
     */
    public LibraryResourceInner withPath(String path) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LibraryInfo();
        }
        this.innerProperties().withPath(path);
        return this;
    }

    /**
     * Get the containerName property: Storage blob container name.
     *
     * @return the containerName value.
     */
    public String containerName() {
        return this.innerProperties() == null ? null : this.innerProperties().containerName();
    }

    /**
     * Set the containerName property: Storage blob container name.
     *
     * @param containerName the containerName value to set.
     * @return the LibraryResourceInner object itself.
     */
    public LibraryResourceInner withContainerName(String containerName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LibraryInfo();
        }
        this.innerProperties().withContainerName(containerName);
        return this;
    }

    /**
     * Get the uploadedTimestamp property: The last update time of the library.
     *
     * @return the uploadedTimestamp value.
     */
    public OffsetDateTime uploadedTimestamp() {
        return this.innerProperties() == null ? null : this.innerProperties().uploadedTimestamp();
    }

    /**
     * Get the type property: Type of the library.
     *
     * @return the type value.
     */
    public String typePropertiesType() {
        return this.innerProperties() == null ? null : this.innerProperties().type();
    }

    /**
     * Set the type property: Type of the library.
     *
     * @param type the type value to set.
     * @return the LibraryResourceInner object itself.
     */
    public LibraryResourceInner withTypePropertiesType(String type) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LibraryInfo();
        }
        this.innerProperties().withType(type);
        return this;
    }

    /**
     * Get the provisioningStatus property: Provisioning status of the library/package.
     *
     * @return the provisioningStatus value.
     */
    public String provisioningStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningStatus();
    }

    /**
     * Get the creatorId property: Creator Id of the library/package.
     *
     * @return the creatorId value.
     */
    public String creatorId() {
        return this.innerProperties() == null ? null : this.innerProperties().creatorId();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model LibraryResourceInner"));
        } else {
            innerProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(LibraryResourceInner.class);
}
