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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Represents a logFile. */
@Fluent
public final class LogFileInner extends ProxyResource {
    /*
     * The properties of a logFile.
     */
    @JsonProperty(value = "properties")
    private LogFileProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: The properties of a logFile.
     *
     * @return the innerProperties value.
     */
    private LogFileProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the createdTime property: Creation timestamp of the log file.
     *
     * @return the createdTime value.
     */
    public OffsetDateTime createdTime() {
        return this.innerProperties() == null ? null : this.innerProperties().createdTime();
    }

    /**
     * Set the createdTime property: Creation timestamp of the log file.
     *
     * @param createdTime the createdTime value to set.
     * @return the LogFileInner object itself.
     */
    public LogFileInner withCreatedTime(OffsetDateTime createdTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LogFileProperties();
        }
        this.innerProperties().withCreatedTime(createdTime);
        return this;
    }

    /**
     * Get the lastModifiedTime property: Last modified timestamp of the log file.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
    }

    /**
     * Set the lastModifiedTime property: Last modified timestamp of the log file.
     *
     * @param lastModifiedTime the lastModifiedTime value to set.
     * @return the LogFileInner object itself.
     */
    public LogFileInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LogFileProperties();
        }
        this.innerProperties().withLastModifiedTime(lastModifiedTime);
        return this;
    }

    /**
     * Get the sizeInKb property: The size in kb of the logFile.
     *
     * @return the sizeInKb value.
     */
    public Long sizeInKb() {
        return this.innerProperties() == null ? null : this.innerProperties().sizeInKb();
    }

    /**
     * Set the sizeInKb property: The size in kb of the logFile.
     *
     * @param sizeInKb the sizeInKb value to set.
     * @return the LogFileInner object itself.
     */
    public LogFileInner withSizeInKb(Long sizeInKb) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LogFileProperties();
        }
        this.innerProperties().withSizeInKb(sizeInKb);
        return this;
    }

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

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

    /**
     * Get the url property: The url to download the log file from.
     *
     * @return the url value.
     */
    public String url() {
        return this.innerProperties() == null ? null : this.innerProperties().url();
    }

    /**
     * Set the url property: The url to download the log file from.
     *
     * @param url the url value to set.
     * @return the LogFileInner object itself.
     */
    public LogFileInner withUrl(String url) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LogFileProperties();
        }
        this.innerProperties().withUrl(url);
        return this;
    }

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