# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities

__all__ = ['AlFileArgs', 'AlFile']

@pulumi.input_type
class AlFileArgs:
    def __init__(__self__, *,
                 file_path: pulumi.Input[_builtins.str],
                 site: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a AlFile resource.
        :param pulumi.Input[_builtins.str] file_path: Path to the file on the local filesystem to upload to the UniFi controller. The file must exist and be readable.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
        """
        pulumi.set(__self__, "file_path", file_path)
        if site is not None:
            pulumi.set(__self__, "site", site)

    @_builtins.property
    @pulumi.getter(name="filePath")
    def file_path(self) -> pulumi.Input[_builtins.str]:
        """
        Path to the file on the local filesystem to upload to the UniFi controller. The file must exist and be readable.
        """
        return pulumi.get(self, "file_path")

    @file_path.setter
    def file_path(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "file_path", value)

    @_builtins.property
    @pulumi.getter
    def site(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
        """
        return pulumi.get(self, "site")

    @site.setter
    def site(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "site", value)


@pulumi.input_type
class _AlFileState:
    def __init__(__self__, *,
                 content_type: Optional[pulumi.Input[_builtins.str]] = None,
                 file_path: Optional[pulumi.Input[_builtins.str]] = None,
                 file_size: Optional[pulumi.Input[_builtins.int]] = None,
                 filename: Optional[pulumi.Input[_builtins.str]] = None,
                 last_modified: Optional[pulumi.Input[_builtins.int]] = None,
                 md5: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 url: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering AlFile resources.
        :param pulumi.Input[_builtins.str] content_type: MIME type of the file.
        :param pulumi.Input[_builtins.str] file_path: Path to the file on the local filesystem to upload to the UniFi controller. The file must exist and be readable.
        :param pulumi.Input[_builtins.int] file_size: Size of the file in bytes.
        :param pulumi.Input[_builtins.str] filename: Name of the file as stored in the UniFi controller.
        :param pulumi.Input[_builtins.int] last_modified: Timestamp when the file was last modified.
        :param pulumi.Input[_builtins.str] md5: MD5 hash of the file content.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.str] url: URL where the file can be accessed on the UniFi controller.
        """
        if content_type is not None:
            pulumi.set(__self__, "content_type", content_type)
        if file_path is not None:
            pulumi.set(__self__, "file_path", file_path)
        if file_size is not None:
            pulumi.set(__self__, "file_size", file_size)
        if filename is not None:
            pulumi.set(__self__, "filename", filename)
        if last_modified is not None:
            pulumi.set(__self__, "last_modified", last_modified)
        if md5 is not None:
            pulumi.set(__self__, "md5", md5)
        if site is not None:
            pulumi.set(__self__, "site", site)
        if url is not None:
            pulumi.set(__self__, "url", url)

    @_builtins.property
    @pulumi.getter(name="contentType")
    def content_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        MIME type of the file.
        """
        return pulumi.get(self, "content_type")

    @content_type.setter
    def content_type(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "content_type", value)

    @_builtins.property
    @pulumi.getter(name="filePath")
    def file_path(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Path to the file on the local filesystem to upload to the UniFi controller. The file must exist and be readable.
        """
        return pulumi.get(self, "file_path")

    @file_path.setter
    def file_path(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "file_path", value)

    @_builtins.property
    @pulumi.getter(name="fileSize")
    def file_size(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        Size of the file in bytes.
        """
        return pulumi.get(self, "file_size")

    @file_size.setter
    def file_size(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "file_size", value)

    @_builtins.property
    @pulumi.getter
    def filename(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of the file as stored in the UniFi controller.
        """
        return pulumi.get(self, "filename")

    @filename.setter
    def filename(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "filename", value)

    @_builtins.property
    @pulumi.getter(name="lastModified")
    def last_modified(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        Timestamp when the file was last modified.
        """
        return pulumi.get(self, "last_modified")

    @last_modified.setter
    def last_modified(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "last_modified", value)

    @_builtins.property
    @pulumi.getter
    def md5(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        MD5 hash of the file content.
        """
        return pulumi.get(self, "md5")

    @md5.setter
    def md5(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "md5", value)

    @_builtins.property
    @pulumi.getter
    def site(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
        """
        return pulumi.get(self, "site")

    @site.setter
    def site(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "site", value)

    @_builtins.property
    @pulumi.getter
    def url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        URL where the file can be accessed on the UniFi controller.
        """
        return pulumi.get(self, "url")

    @url.setter
    def url(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "url", value)


@pulumi.type_token("unifi:port/alFile:AlFile")
class AlFile(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 file_path: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        The `port.AlFile` resource manages files uploaded to the UniFi guest portal. This resource allows you to upload images that can be used in customizing the UniFi guest portal interface.

        **Note:** This resource uploads files to the UniFi controller. The file must exist on the local filesystem where Terraform is executed.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_unifi as unifi

        file = unifi.port.AlFile("file", file_path="/Users/username/Downloads/portal.png")
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] file_path: Path to the file on the local filesystem to upload to the UniFi controller. The file must exist and be readable.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AlFileArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `port.AlFile` resource manages files uploaded to the UniFi guest portal. This resource allows you to upload images that can be used in customizing the UniFi guest portal interface.

        **Note:** This resource uploads files to the UniFi controller. The file must exist on the local filesystem where Terraform is executed.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_unifi as unifi

        file = unifi.port.AlFile("file", file_path="/Users/username/Downloads/portal.png")
        ```

        :param str resource_name: The name of the resource.
        :param AlFileArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(AlFileArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 file_path: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = AlFileArgs.__new__(AlFileArgs)

            if file_path is None and not opts.urn:
                raise TypeError("Missing required property 'file_path'")
            __props__.__dict__["file_path"] = file_path
            __props__.__dict__["site"] = site
            __props__.__dict__["content_type"] = None
            __props__.__dict__["file_size"] = None
            __props__.__dict__["filename"] = None
            __props__.__dict__["last_modified"] = None
            __props__.__dict__["md5"] = None
            __props__.__dict__["url"] = None
        super(AlFile, __self__).__init__(
            'unifi:port/alFile:AlFile',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            content_type: Optional[pulumi.Input[_builtins.str]] = None,
            file_path: Optional[pulumi.Input[_builtins.str]] = None,
            file_size: Optional[pulumi.Input[_builtins.int]] = None,
            filename: Optional[pulumi.Input[_builtins.str]] = None,
            last_modified: Optional[pulumi.Input[_builtins.int]] = None,
            md5: Optional[pulumi.Input[_builtins.str]] = None,
            site: Optional[pulumi.Input[_builtins.str]] = None,
            url: Optional[pulumi.Input[_builtins.str]] = None) -> 'AlFile':
        """
        Get an existing AlFile resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] content_type: MIME type of the file.
        :param pulumi.Input[_builtins.str] file_path: Path to the file on the local filesystem to upload to the UniFi controller. The file must exist and be readable.
        :param pulumi.Input[_builtins.int] file_size: Size of the file in bytes.
        :param pulumi.Input[_builtins.str] filename: Name of the file as stored in the UniFi controller.
        :param pulumi.Input[_builtins.int] last_modified: Timestamp when the file was last modified.
        :param pulumi.Input[_builtins.str] md5: MD5 hash of the file content.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.str] url: URL where the file can be accessed on the UniFi controller.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _AlFileState.__new__(_AlFileState)

        __props__.__dict__["content_type"] = content_type
        __props__.__dict__["file_path"] = file_path
        __props__.__dict__["file_size"] = file_size
        __props__.__dict__["filename"] = filename
        __props__.__dict__["last_modified"] = last_modified
        __props__.__dict__["md5"] = md5
        __props__.__dict__["site"] = site
        __props__.__dict__["url"] = url
        return AlFile(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="contentType")
    def content_type(self) -> pulumi.Output[_builtins.str]:
        """
        MIME type of the file.
        """
        return pulumi.get(self, "content_type")

    @_builtins.property
    @pulumi.getter(name="filePath")
    def file_path(self) -> pulumi.Output[_builtins.str]:
        """
        Path to the file on the local filesystem to upload to the UniFi controller. The file must exist and be readable.
        """
        return pulumi.get(self, "file_path")

    @_builtins.property
    @pulumi.getter(name="fileSize")
    def file_size(self) -> pulumi.Output[_builtins.int]:
        """
        Size of the file in bytes.
        """
        return pulumi.get(self, "file_size")

    @_builtins.property
    @pulumi.getter
    def filename(self) -> pulumi.Output[_builtins.str]:
        """
        Name of the file as stored in the UniFi controller.
        """
        return pulumi.get(self, "filename")

    @_builtins.property
    @pulumi.getter(name="lastModified")
    def last_modified(self) -> pulumi.Output[_builtins.int]:
        """
        Timestamp when the file was last modified.
        """
        return pulumi.get(self, "last_modified")

    @_builtins.property
    @pulumi.getter
    def md5(self) -> pulumi.Output[_builtins.str]:
        """
        MD5 hash of the file content.
        """
        return pulumi.get(self, "md5")

    @_builtins.property
    @pulumi.getter
    def site(self) -> pulumi.Output[_builtins.str]:
        """
        The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
        """
        return pulumi.get(self, "site")

    @_builtins.property
    @pulumi.getter
    def url(self) -> pulumi.Output[_builtins.str]:
        """
        URL where the file can be accessed on the UniFi controller.
        """
        return pulumi.get(self, "url")

