# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = ['FileArgs', 'File']

@pulumi.input_type
class FileArgs:
    def __init__(__self__, *,
                 content_type: pulumi.Input[str],
                 datastore_id: pulumi.Input[str],
                 node_name: pulumi.Input[str],
                 url: pulumi.Input[str],
                 checksum: Optional[pulumi.Input[str]] = None,
                 checksum_algorithm: Optional[pulumi.Input[str]] = None,
                 decompression_algorithm: Optional[pulumi.Input[str]] = None,
                 file_name: Optional[pulumi.Input[str]] = None,
                 overwrite: Optional[pulumi.Input[bool]] = None,
                 overwrite_unmanaged: Optional[pulumi.Input[bool]] = None,
                 upload_timeout: Optional[pulumi.Input[int]] = None,
                 verify: Optional[pulumi.Input[bool]] = None):
        """
        The set of arguments for constructing a File resource.
        :param pulumi.Input[str] content_type: The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
        :param pulumi.Input[str] datastore_id: The identifier for the target datastore.
        :param pulumi.Input[str] node_name: The node name.
        :param pulumi.Input[str] url: The URL to download the file from. Format `https?://.*`.
        :param pulumi.Input[str] checksum: The expected checksum of the file.
        :param pulumi.Input[str] checksum_algorithm: The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
        :param pulumi.Input[str] decompression_algorithm: Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
        :param pulumi.Input[str] file_name: The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
        :param pulumi.Input[bool] overwrite: If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
        :param pulumi.Input[bool] overwrite_unmanaged: If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
        :param pulumi.Input[int] upload_timeout: The file download timeout seconds. Default is 600 (10min).
        :param pulumi.Input[bool] verify: By default `true`. If `false`, no SSL/TLS certificates will be verified.
        """
        pulumi.set(__self__, "content_type", content_type)
        pulumi.set(__self__, "datastore_id", datastore_id)
        pulumi.set(__self__, "node_name", node_name)
        pulumi.set(__self__, "url", url)
        if checksum is not None:
            pulumi.set(__self__, "checksum", checksum)
        if checksum_algorithm is not None:
            pulumi.set(__self__, "checksum_algorithm", checksum_algorithm)
        if decompression_algorithm is not None:
            pulumi.set(__self__, "decompression_algorithm", decompression_algorithm)
        if file_name is not None:
            pulumi.set(__self__, "file_name", file_name)
        if overwrite is not None:
            pulumi.set(__self__, "overwrite", overwrite)
        if overwrite_unmanaged is not None:
            pulumi.set(__self__, "overwrite_unmanaged", overwrite_unmanaged)
        if upload_timeout is not None:
            pulumi.set(__self__, "upload_timeout", upload_timeout)
        if verify is not None:
            pulumi.set(__self__, "verify", verify)

    @property
    @pulumi.getter(name="contentType")
    def content_type(self) -> pulumi.Input[str]:
        """
        The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
        """
        return pulumi.get(self, "content_type")

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

    @property
    @pulumi.getter(name="datastoreId")
    def datastore_id(self) -> pulumi.Input[str]:
        """
        The identifier for the target datastore.
        """
        return pulumi.get(self, "datastore_id")

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

    @property
    @pulumi.getter(name="nodeName")
    def node_name(self) -> pulumi.Input[str]:
        """
        The node name.
        """
        return pulumi.get(self, "node_name")

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

    @property
    @pulumi.getter
    def url(self) -> pulumi.Input[str]:
        """
        The URL to download the file from. Format `https?://.*`.
        """
        return pulumi.get(self, "url")

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

    @property
    @pulumi.getter
    def checksum(self) -> Optional[pulumi.Input[str]]:
        """
        The expected checksum of the file.
        """
        return pulumi.get(self, "checksum")

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

    @property
    @pulumi.getter(name="checksumAlgorithm")
    def checksum_algorithm(self) -> Optional[pulumi.Input[str]]:
        """
        The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
        """
        return pulumi.get(self, "checksum_algorithm")

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

    @property
    @pulumi.getter(name="decompressionAlgorithm")
    def decompression_algorithm(self) -> Optional[pulumi.Input[str]]:
        """
        Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
        """
        return pulumi.get(self, "decompression_algorithm")

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

    @property
    @pulumi.getter(name="fileName")
    def file_name(self) -> Optional[pulumi.Input[str]]:
        """
        The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
        """
        return pulumi.get(self, "file_name")

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

    @property
    @pulumi.getter
    def overwrite(self) -> Optional[pulumi.Input[bool]]:
        """
        If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
        """
        return pulumi.get(self, "overwrite")

    @overwrite.setter
    def overwrite(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "overwrite", value)

    @property
    @pulumi.getter(name="overwriteUnmanaged")
    def overwrite_unmanaged(self) -> Optional[pulumi.Input[bool]]:
        """
        If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
        """
        return pulumi.get(self, "overwrite_unmanaged")

    @overwrite_unmanaged.setter
    def overwrite_unmanaged(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "overwrite_unmanaged", value)

    @property
    @pulumi.getter(name="uploadTimeout")
    def upload_timeout(self) -> Optional[pulumi.Input[int]]:
        """
        The file download timeout seconds. Default is 600 (10min).
        """
        return pulumi.get(self, "upload_timeout")

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

    @property
    @pulumi.getter
    def verify(self) -> Optional[pulumi.Input[bool]]:
        """
        By default `true`. If `false`, no SSL/TLS certificates will be verified.
        """
        return pulumi.get(self, "verify")

    @verify.setter
    def verify(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "verify", value)


@pulumi.input_type
class _FileState:
    def __init__(__self__, *,
                 checksum: Optional[pulumi.Input[str]] = None,
                 checksum_algorithm: Optional[pulumi.Input[str]] = None,
                 content_type: Optional[pulumi.Input[str]] = None,
                 datastore_id: Optional[pulumi.Input[str]] = None,
                 decompression_algorithm: Optional[pulumi.Input[str]] = None,
                 file_name: Optional[pulumi.Input[str]] = None,
                 node_name: Optional[pulumi.Input[str]] = None,
                 overwrite: Optional[pulumi.Input[bool]] = None,
                 overwrite_unmanaged: Optional[pulumi.Input[bool]] = None,
                 size: Optional[pulumi.Input[int]] = None,
                 upload_timeout: Optional[pulumi.Input[int]] = None,
                 url: Optional[pulumi.Input[str]] = None,
                 verify: Optional[pulumi.Input[bool]] = None):
        """
        Input properties used for looking up and filtering File resources.
        :param pulumi.Input[str] checksum: The expected checksum of the file.
        :param pulumi.Input[str] checksum_algorithm: The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
        :param pulumi.Input[str] content_type: The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
        :param pulumi.Input[str] datastore_id: The identifier for the target datastore.
        :param pulumi.Input[str] decompression_algorithm: Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
        :param pulumi.Input[str] file_name: The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
        :param pulumi.Input[str] node_name: The node name.
        :param pulumi.Input[bool] overwrite: If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
        :param pulumi.Input[bool] overwrite_unmanaged: If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
        :param pulumi.Input[int] size: The file size.
        :param pulumi.Input[int] upload_timeout: The file download timeout seconds. Default is 600 (10min).
        :param pulumi.Input[str] url: The URL to download the file from. Format `https?://.*`.
        :param pulumi.Input[bool] verify: By default `true`. If `false`, no SSL/TLS certificates will be verified.
        """
        if checksum is not None:
            pulumi.set(__self__, "checksum", checksum)
        if checksum_algorithm is not None:
            pulumi.set(__self__, "checksum_algorithm", checksum_algorithm)
        if content_type is not None:
            pulumi.set(__self__, "content_type", content_type)
        if datastore_id is not None:
            pulumi.set(__self__, "datastore_id", datastore_id)
        if decompression_algorithm is not None:
            pulumi.set(__self__, "decompression_algorithm", decompression_algorithm)
        if file_name is not None:
            pulumi.set(__self__, "file_name", file_name)
        if node_name is not None:
            pulumi.set(__self__, "node_name", node_name)
        if overwrite is not None:
            pulumi.set(__self__, "overwrite", overwrite)
        if overwrite_unmanaged is not None:
            pulumi.set(__self__, "overwrite_unmanaged", overwrite_unmanaged)
        if size is not None:
            pulumi.set(__self__, "size", size)
        if upload_timeout is not None:
            pulumi.set(__self__, "upload_timeout", upload_timeout)
        if url is not None:
            pulumi.set(__self__, "url", url)
        if verify is not None:
            pulumi.set(__self__, "verify", verify)

    @property
    @pulumi.getter
    def checksum(self) -> Optional[pulumi.Input[str]]:
        """
        The expected checksum of the file.
        """
        return pulumi.get(self, "checksum")

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

    @property
    @pulumi.getter(name="checksumAlgorithm")
    def checksum_algorithm(self) -> Optional[pulumi.Input[str]]:
        """
        The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
        """
        return pulumi.get(self, "checksum_algorithm")

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

    @property
    @pulumi.getter(name="contentType")
    def content_type(self) -> Optional[pulumi.Input[str]]:
        """
        The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
        """
        return pulumi.get(self, "content_type")

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

    @property
    @pulumi.getter(name="datastoreId")
    def datastore_id(self) -> Optional[pulumi.Input[str]]:
        """
        The identifier for the target datastore.
        """
        return pulumi.get(self, "datastore_id")

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

    @property
    @pulumi.getter(name="decompressionAlgorithm")
    def decompression_algorithm(self) -> Optional[pulumi.Input[str]]:
        """
        Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
        """
        return pulumi.get(self, "decompression_algorithm")

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

    @property
    @pulumi.getter(name="fileName")
    def file_name(self) -> Optional[pulumi.Input[str]]:
        """
        The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
        """
        return pulumi.get(self, "file_name")

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

    @property
    @pulumi.getter(name="nodeName")
    def node_name(self) -> Optional[pulumi.Input[str]]:
        """
        The node name.
        """
        return pulumi.get(self, "node_name")

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

    @property
    @pulumi.getter
    def overwrite(self) -> Optional[pulumi.Input[bool]]:
        """
        If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
        """
        return pulumi.get(self, "overwrite")

    @overwrite.setter
    def overwrite(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "overwrite", value)

    @property
    @pulumi.getter(name="overwriteUnmanaged")
    def overwrite_unmanaged(self) -> Optional[pulumi.Input[bool]]:
        """
        If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
        """
        return pulumi.get(self, "overwrite_unmanaged")

    @overwrite_unmanaged.setter
    def overwrite_unmanaged(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "overwrite_unmanaged", value)

    @property
    @pulumi.getter
    def size(self) -> Optional[pulumi.Input[int]]:
        """
        The file size.
        """
        return pulumi.get(self, "size")

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

    @property
    @pulumi.getter(name="uploadTimeout")
    def upload_timeout(self) -> Optional[pulumi.Input[int]]:
        """
        The file download timeout seconds. Default is 600 (10min).
        """
        return pulumi.get(self, "upload_timeout")

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

    @property
    @pulumi.getter
    def url(self) -> Optional[pulumi.Input[str]]:
        """
        The URL to download the file from. Format `https?://.*`.
        """
        return pulumi.get(self, "url")

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

    @property
    @pulumi.getter
    def verify(self) -> Optional[pulumi.Input[bool]]:
        """
        By default `true`. If `false`, no SSL/TLS certificates will be verified.
        """
        return pulumi.get(self, "verify")

    @verify.setter
    def verify(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "verify", value)


class File(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 checksum: Optional[pulumi.Input[str]] = None,
                 checksum_algorithm: Optional[pulumi.Input[str]] = None,
                 content_type: Optional[pulumi.Input[str]] = None,
                 datastore_id: Optional[pulumi.Input[str]] = None,
                 decompression_algorithm: Optional[pulumi.Input[str]] = None,
                 file_name: Optional[pulumi.Input[str]] = None,
                 node_name: Optional[pulumi.Input[str]] = None,
                 overwrite: Optional[pulumi.Input[bool]] = None,
                 overwrite_unmanaged: Optional[pulumi.Input[bool]] = None,
                 upload_timeout: Optional[pulumi.Input[int]] = None,
                 url: Optional[pulumi.Input[str]] = None,
                 verify: Optional[pulumi.Input[bool]] = None,
                 __props__=None):
        """
        Manages files upload using PVE download-url API. It can be fully compatible and faster replacement for image files created using `Storage.File`. Supports images for VMs (ISO images) and LXC (CT Templates).

        ## Example Usage

        <!--Start PulumiCodeChooser -->
        ```python
        import pulumi
        import pulumi_proxmoxve as proxmoxve

        release20231228_debian12_bookworm_qcow2_img = proxmoxve.download.File("release20231228Debian12BookwormQcow2Img",
            checksum="d2fbcf11fb28795842e91364d8c7b69f1870db09ff299eb94e4fbbfa510eb78d141e74c1f4bf6dfa0b7e33d0c3b66e6751886feadb4e9916f778bab1776bdf1b",
            checksum_algorithm="sha512",
            content_type="iso",
            datastore_id="local",
            file_name="debian-12-generic-amd64-20231228-1609.img",
            node_name="pve",
            url="https://cloud.debian.org/images/cloud/bookworm/20231228-1609/debian-12-generic-amd64-20231228-1609.qcow2")
        latest_debian12_bookworm_qcow2_img = proxmoxve.download.File("latestDebian12BookwormQcow2Img",
            content_type="iso",
            datastore_id="local",
            file_name="debian-12-generic-amd64.qcow2.img",
            node_name="pve",
            url="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2")
        latest_ubuntu22_jammy_qcow2_img = proxmoxve.download.File("latestUbuntu22JammyQcow2Img",
            content_type="iso",
            datastore_id="local",
            node_name="pve",
            url="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img")
        latest_static_ubuntu24_noble_qcow2_img = proxmoxve.download.File("latestStaticUbuntu24NobleQcow2Img",
            content_type="iso",
            datastore_id="local",
            node_name="pve",
            overwrite=False,
            url="https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img")
        release20231211_ubuntu22_jammy_lxc_img = proxmoxve.download.File("release20231211Ubuntu22JammyLxcImg",
            checksum="c9997dcfea5d826fd04871f960c513665f2e87dd7450bba99f68a97e60e4586e",
            checksum_algorithm="sha256",
            content_type="vztmpl",
            datastore_id="local",
            node_name="pve",
            upload_timeout=4444,
            url="https://cloud-images.ubuntu.com/releases/22.04/release-20231211/ubuntu-22.04-server-cloudimg-amd64-root.tar.xz")
        latest_ubuntu22_jammy_lxc_img = proxmoxve.download.File("latestUbuntu22JammyLxcImg",
            content_type="vztmpl",
            datastore_id="local",
            node_name="pve",
            url="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.tar.gz")
        ```
        <!--End PulumiCodeChooser -->

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] checksum: The expected checksum of the file.
        :param pulumi.Input[str] checksum_algorithm: The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
        :param pulumi.Input[str] content_type: The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
        :param pulumi.Input[str] datastore_id: The identifier for the target datastore.
        :param pulumi.Input[str] decompression_algorithm: Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
        :param pulumi.Input[str] file_name: The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
        :param pulumi.Input[str] node_name: The node name.
        :param pulumi.Input[bool] overwrite: If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
        :param pulumi.Input[bool] overwrite_unmanaged: If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
        :param pulumi.Input[int] upload_timeout: The file download timeout seconds. Default is 600 (10min).
        :param pulumi.Input[str] url: The URL to download the file from. Format `https?://.*`.
        :param pulumi.Input[bool] verify: By default `true`. If `false`, no SSL/TLS certificates will be verified.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: FileArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages files upload using PVE download-url API. It can be fully compatible and faster replacement for image files created using `Storage.File`. Supports images for VMs (ISO images) and LXC (CT Templates).

        ## Example Usage

        <!--Start PulumiCodeChooser -->
        ```python
        import pulumi
        import pulumi_proxmoxve as proxmoxve

        release20231228_debian12_bookworm_qcow2_img = proxmoxve.download.File("release20231228Debian12BookwormQcow2Img",
            checksum="d2fbcf11fb28795842e91364d8c7b69f1870db09ff299eb94e4fbbfa510eb78d141e74c1f4bf6dfa0b7e33d0c3b66e6751886feadb4e9916f778bab1776bdf1b",
            checksum_algorithm="sha512",
            content_type="iso",
            datastore_id="local",
            file_name="debian-12-generic-amd64-20231228-1609.img",
            node_name="pve",
            url="https://cloud.debian.org/images/cloud/bookworm/20231228-1609/debian-12-generic-amd64-20231228-1609.qcow2")
        latest_debian12_bookworm_qcow2_img = proxmoxve.download.File("latestDebian12BookwormQcow2Img",
            content_type="iso",
            datastore_id="local",
            file_name="debian-12-generic-amd64.qcow2.img",
            node_name="pve",
            url="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2")
        latest_ubuntu22_jammy_qcow2_img = proxmoxve.download.File("latestUbuntu22JammyQcow2Img",
            content_type="iso",
            datastore_id="local",
            node_name="pve",
            url="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img")
        latest_static_ubuntu24_noble_qcow2_img = proxmoxve.download.File("latestStaticUbuntu24NobleQcow2Img",
            content_type="iso",
            datastore_id="local",
            node_name="pve",
            overwrite=False,
            url="https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img")
        release20231211_ubuntu22_jammy_lxc_img = proxmoxve.download.File("release20231211Ubuntu22JammyLxcImg",
            checksum="c9997dcfea5d826fd04871f960c513665f2e87dd7450bba99f68a97e60e4586e",
            checksum_algorithm="sha256",
            content_type="vztmpl",
            datastore_id="local",
            node_name="pve",
            upload_timeout=4444,
            url="https://cloud-images.ubuntu.com/releases/22.04/release-20231211/ubuntu-22.04-server-cloudimg-amd64-root.tar.xz")
        latest_ubuntu22_jammy_lxc_img = proxmoxve.download.File("latestUbuntu22JammyLxcImg",
            content_type="vztmpl",
            datastore_id="local",
            node_name="pve",
            url="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.tar.gz")
        ```
        <!--End PulumiCodeChooser -->

        :param str resource_name: The name of the resource.
        :param FileArgs 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(FileArgs, 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,
                 checksum: Optional[pulumi.Input[str]] = None,
                 checksum_algorithm: Optional[pulumi.Input[str]] = None,
                 content_type: Optional[pulumi.Input[str]] = None,
                 datastore_id: Optional[pulumi.Input[str]] = None,
                 decompression_algorithm: Optional[pulumi.Input[str]] = None,
                 file_name: Optional[pulumi.Input[str]] = None,
                 node_name: Optional[pulumi.Input[str]] = None,
                 overwrite: Optional[pulumi.Input[bool]] = None,
                 overwrite_unmanaged: Optional[pulumi.Input[bool]] = None,
                 upload_timeout: Optional[pulumi.Input[int]] = None,
                 url: Optional[pulumi.Input[str]] = None,
                 verify: Optional[pulumi.Input[bool]] = 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__ = FileArgs.__new__(FileArgs)

            __props__.__dict__["checksum"] = checksum
            __props__.__dict__["checksum_algorithm"] = checksum_algorithm
            if content_type is None and not opts.urn:
                raise TypeError("Missing required property 'content_type'")
            __props__.__dict__["content_type"] = content_type
            if datastore_id is None and not opts.urn:
                raise TypeError("Missing required property 'datastore_id'")
            __props__.__dict__["datastore_id"] = datastore_id
            __props__.__dict__["decompression_algorithm"] = decompression_algorithm
            __props__.__dict__["file_name"] = file_name
            if node_name is None and not opts.urn:
                raise TypeError("Missing required property 'node_name'")
            __props__.__dict__["node_name"] = node_name
            __props__.__dict__["overwrite"] = overwrite
            __props__.__dict__["overwrite_unmanaged"] = overwrite_unmanaged
            __props__.__dict__["upload_timeout"] = upload_timeout
            if url is None and not opts.urn:
                raise TypeError("Missing required property 'url'")
            __props__.__dict__["url"] = url
            __props__.__dict__["verify"] = verify
            __props__.__dict__["size"] = None
        super(File, __self__).__init__(
            'proxmoxve:Download/file:File',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            checksum: Optional[pulumi.Input[str]] = None,
            checksum_algorithm: Optional[pulumi.Input[str]] = None,
            content_type: Optional[pulumi.Input[str]] = None,
            datastore_id: Optional[pulumi.Input[str]] = None,
            decompression_algorithm: Optional[pulumi.Input[str]] = None,
            file_name: Optional[pulumi.Input[str]] = None,
            node_name: Optional[pulumi.Input[str]] = None,
            overwrite: Optional[pulumi.Input[bool]] = None,
            overwrite_unmanaged: Optional[pulumi.Input[bool]] = None,
            size: Optional[pulumi.Input[int]] = None,
            upload_timeout: Optional[pulumi.Input[int]] = None,
            url: Optional[pulumi.Input[str]] = None,
            verify: Optional[pulumi.Input[bool]] = None) -> 'File':
        """
        Get an existing File 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[str] checksum: The expected checksum of the file.
        :param pulumi.Input[str] checksum_algorithm: The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
        :param pulumi.Input[str] content_type: The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
        :param pulumi.Input[str] datastore_id: The identifier for the target datastore.
        :param pulumi.Input[str] decompression_algorithm: Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
        :param pulumi.Input[str] file_name: The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
        :param pulumi.Input[str] node_name: The node name.
        :param pulumi.Input[bool] overwrite: If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
        :param pulumi.Input[bool] overwrite_unmanaged: If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
        :param pulumi.Input[int] size: The file size.
        :param pulumi.Input[int] upload_timeout: The file download timeout seconds. Default is 600 (10min).
        :param pulumi.Input[str] url: The URL to download the file from. Format `https?://.*`.
        :param pulumi.Input[bool] verify: By default `true`. If `false`, no SSL/TLS certificates will be verified.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _FileState.__new__(_FileState)

        __props__.__dict__["checksum"] = checksum
        __props__.__dict__["checksum_algorithm"] = checksum_algorithm
        __props__.__dict__["content_type"] = content_type
        __props__.__dict__["datastore_id"] = datastore_id
        __props__.__dict__["decompression_algorithm"] = decompression_algorithm
        __props__.__dict__["file_name"] = file_name
        __props__.__dict__["node_name"] = node_name
        __props__.__dict__["overwrite"] = overwrite
        __props__.__dict__["overwrite_unmanaged"] = overwrite_unmanaged
        __props__.__dict__["size"] = size
        __props__.__dict__["upload_timeout"] = upload_timeout
        __props__.__dict__["url"] = url
        __props__.__dict__["verify"] = verify
        return File(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def checksum(self) -> pulumi.Output[Optional[str]]:
        """
        The expected checksum of the file.
        """
        return pulumi.get(self, "checksum")

    @property
    @pulumi.getter(name="checksumAlgorithm")
    def checksum_algorithm(self) -> pulumi.Output[Optional[str]]:
        """
        The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
        """
        return pulumi.get(self, "checksum_algorithm")

    @property
    @pulumi.getter(name="contentType")
    def content_type(self) -> pulumi.Output[str]:
        """
        The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
        """
        return pulumi.get(self, "content_type")

    @property
    @pulumi.getter(name="datastoreId")
    def datastore_id(self) -> pulumi.Output[str]:
        """
        The identifier for the target datastore.
        """
        return pulumi.get(self, "datastore_id")

    @property
    @pulumi.getter(name="decompressionAlgorithm")
    def decompression_algorithm(self) -> pulumi.Output[Optional[str]]:
        """
        Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
        """
        return pulumi.get(self, "decompression_algorithm")

    @property
    @pulumi.getter(name="fileName")
    def file_name(self) -> pulumi.Output[str]:
        """
        The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
        """
        return pulumi.get(self, "file_name")

    @property
    @pulumi.getter(name="nodeName")
    def node_name(self) -> pulumi.Output[str]:
        """
        The node name.
        """
        return pulumi.get(self, "node_name")

    @property
    @pulumi.getter
    def overwrite(self) -> pulumi.Output[bool]:
        """
        If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
        """
        return pulumi.get(self, "overwrite")

    @property
    @pulumi.getter(name="overwriteUnmanaged")
    def overwrite_unmanaged(self) -> pulumi.Output[bool]:
        """
        If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
        """
        return pulumi.get(self, "overwrite_unmanaged")

    @property
    @pulumi.getter
    def size(self) -> pulumi.Output[int]:
        """
        The file size.
        """
        return pulumi.get(self, "size")

    @property
    @pulumi.getter(name="uploadTimeout")
    def upload_timeout(self) -> pulumi.Output[int]:
        """
        The file download timeout seconds. Default is 600 (10min).
        """
        return pulumi.get(self, "upload_timeout")

    @property
    @pulumi.getter
    def url(self) -> pulumi.Output[str]:
        """
        The URL to download the file from. Format `https?://.*`.
        """
        return pulumi.get(self, "url")

    @property
    @pulumi.getter
    def verify(self) -> pulumi.Output[bool]:
        """
        By default `true`. If `false`, no SSL/TLS certificates will be verified.
        """
        return pulumi.get(self, "verify")

