# 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__ = ['ProjectSecureFileArgs', 'ProjectSecureFile']

@pulumi.input_type
class ProjectSecureFileArgs:
    def __init__(__self__, *,
                 content: pulumi.Input[_builtins.str],
                 project: pulumi.Input[_builtins.str],
                 name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a ProjectSecureFile resource.
        :param pulumi.Input[_builtins.str] content: The contents of the secure file
        :param pulumi.Input[_builtins.str] project: The ID or full path of the project to environment is created for.
        :param pulumi.Input[_builtins.str] name: The name for the secure file, unique per project
        """
        pulumi.set(__self__, "content", content)
        pulumi.set(__self__, "project", project)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @_builtins.property
    @pulumi.getter
    def content(self) -> pulumi.Input[_builtins.str]:
        """
        The contents of the secure file
        """
        return pulumi.get(self, "content")

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

    @_builtins.property
    @pulumi.getter
    def project(self) -> pulumi.Input[_builtins.str]:
        """
        The ID or full path of the project to environment is created for.
        """
        return pulumi.get(self, "project")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name for the secure file, unique per project
        """
        return pulumi.get(self, "name")

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


@pulumi.input_type
class _ProjectSecureFileState:
    def __init__(__self__, *,
                 checksum: Optional[pulumi.Input[_builtins.str]] = None,
                 checksum_algorithm: Optional[pulumi.Input[_builtins.str]] = None,
                 content: Optional[pulumi.Input[_builtins.str]] = None,
                 created_at: Optional[pulumi.Input[_builtins.str]] = None,
                 expires_at: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 project: Optional[pulumi.Input[_builtins.str]] = None,
                 secure_file_id: Optional[pulumi.Input[_builtins.int]] = None):
        """
        Input properties used for looking up and filtering ProjectSecureFile resources.
        :param pulumi.Input[_builtins.str] checksum: The checksum of the file
        :param pulumi.Input[_builtins.str] checksum_algorithm: The checksum algorithm used
        :param pulumi.Input[_builtins.str] content: The contents of the secure file
        :param pulumi.Input[_builtins.str] created_at: The time the secure file was uploaded
        :param pulumi.Input[_builtins.str] expires_at: The time the secure file will expire
        :param pulumi.Input[_builtins.str] name: The name for the secure file, unique per project
        :param pulumi.Input[_builtins.str] project: The ID or full path of the project to environment is created for.
        :param pulumi.Input[_builtins.int] secure_file_id: The id of the secure file in gitlab
        """
        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 is not None:
            pulumi.set(__self__, "content", content)
        if created_at is not None:
            pulumi.set(__self__, "created_at", created_at)
        if expires_at is not None:
            pulumi.set(__self__, "expires_at", expires_at)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if secure_file_id is not None:
            pulumi.set(__self__, "secure_file_id", secure_file_id)

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

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

    @_builtins.property
    @pulumi.getter(name="checksumAlgorithm")
    def checksum_algorithm(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The checksum algorithm used
        """
        return pulumi.get(self, "checksum_algorithm")

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

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

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

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The time the secure file was uploaded
        """
        return pulumi.get(self, "created_at")

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

    @_builtins.property
    @pulumi.getter(name="expiresAt")
    def expires_at(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The time the secure file will expire
        """
        return pulumi.get(self, "expires_at")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name for the secure file, unique per project
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID or full path of the project to environment is created for.
        """
        return pulumi.get(self, "project")

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

    @_builtins.property
    @pulumi.getter(name="secureFileId")
    def secure_file_id(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The id of the secure file in gitlab
        """
        return pulumi.get(self, "secure_file_id")

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


@pulumi.type_token("gitlab:index/projectSecureFile:ProjectSecureFile")
class ProjectSecureFile(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 content: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 project: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        The `ProjectSecureFile` resource allows users to manage the lifecycle of a secure file in gitlab.

        **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/secure_files/)

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab
        import pulumi_std as std

        this = gitlab.Group("this",
            name="example",
            path="example",
            description="An example group")
        this_project = gitlab.Project("this",
            name="example",
            namespace_id=this.id,
            initialize_with_readme=True)
        this_project_secure_file = gitlab.ProjectSecureFile("this",
            name="my-secure-file",
            project=this_project.id,
            content=std.file(input="example.txt").result)
        disable_poll_for_metadata = gitlab.ProjectSecureFile("disable_poll_for_metadata",
            name="my-secure-file",
            project=this_project.id,
            content=std.file(input="example.txt").result,
            poll_for_metadata_duration_in_seconds=0)
        ```

        ## Import

        Starting in Terraform v1.5.0, you can use an import block to import `gitlab_project_secure_file`. For example:

        terraform

        import {

          to = gitlab_project_secure_file.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        GitLab secure files can be imported using an id made up of `projectId:secureFileId`, e.g.

        ```sh
        $ pulumi import gitlab:index/projectSecureFile:ProjectSecureFile bar 123:321
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] content: The contents of the secure file
        :param pulumi.Input[_builtins.str] name: The name for the secure file, unique per project
        :param pulumi.Input[_builtins.str] project: The ID or full path of the project to environment is created for.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ProjectSecureFileArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `ProjectSecureFile` resource allows users to manage the lifecycle of a secure file in gitlab.

        **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/secure_files/)

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab
        import pulumi_std as std

        this = gitlab.Group("this",
            name="example",
            path="example",
            description="An example group")
        this_project = gitlab.Project("this",
            name="example",
            namespace_id=this.id,
            initialize_with_readme=True)
        this_project_secure_file = gitlab.ProjectSecureFile("this",
            name="my-secure-file",
            project=this_project.id,
            content=std.file(input="example.txt").result)
        disable_poll_for_metadata = gitlab.ProjectSecureFile("disable_poll_for_metadata",
            name="my-secure-file",
            project=this_project.id,
            content=std.file(input="example.txt").result,
            poll_for_metadata_duration_in_seconds=0)
        ```

        ## Import

        Starting in Terraform v1.5.0, you can use an import block to import `gitlab_project_secure_file`. For example:

        terraform

        import {

          to = gitlab_project_secure_file.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        GitLab secure files can be imported using an id made up of `projectId:secureFileId`, e.g.

        ```sh
        $ pulumi import gitlab:index/projectSecureFile:ProjectSecureFile bar 123:321
        ```

        :param str resource_name: The name of the resource.
        :param ProjectSecureFileArgs 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(ProjectSecureFileArgs, 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,
                 content: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 project: 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__ = ProjectSecureFileArgs.__new__(ProjectSecureFileArgs)

            if content is None and not opts.urn:
                raise TypeError("Missing required property 'content'")
            __props__.__dict__["content"] = None if content is None else pulumi.Output.secret(content)
            __props__.__dict__["name"] = name
            if project is None and not opts.urn:
                raise TypeError("Missing required property 'project'")
            __props__.__dict__["project"] = project
            __props__.__dict__["checksum"] = None
            __props__.__dict__["checksum_algorithm"] = None
            __props__.__dict__["created_at"] = None
            __props__.__dict__["expires_at"] = None
            __props__.__dict__["secure_file_id"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["content"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(ProjectSecureFile, __self__).__init__(
            'gitlab:index/projectSecureFile:ProjectSecureFile',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            checksum: Optional[pulumi.Input[_builtins.str]] = None,
            checksum_algorithm: Optional[pulumi.Input[_builtins.str]] = None,
            content: Optional[pulumi.Input[_builtins.str]] = None,
            created_at: Optional[pulumi.Input[_builtins.str]] = None,
            expires_at: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            project: Optional[pulumi.Input[_builtins.str]] = None,
            secure_file_id: Optional[pulumi.Input[_builtins.int]] = None) -> 'ProjectSecureFile':
        """
        Get an existing ProjectSecureFile 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] checksum: The checksum of the file
        :param pulumi.Input[_builtins.str] checksum_algorithm: The checksum algorithm used
        :param pulumi.Input[_builtins.str] content: The contents of the secure file
        :param pulumi.Input[_builtins.str] created_at: The time the secure file was uploaded
        :param pulumi.Input[_builtins.str] expires_at: The time the secure file will expire
        :param pulumi.Input[_builtins.str] name: The name for the secure file, unique per project
        :param pulumi.Input[_builtins.str] project: The ID or full path of the project to environment is created for.
        :param pulumi.Input[_builtins.int] secure_file_id: The id of the secure file in gitlab
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ProjectSecureFileState.__new__(_ProjectSecureFileState)

        __props__.__dict__["checksum"] = checksum
        __props__.__dict__["checksum_algorithm"] = checksum_algorithm
        __props__.__dict__["content"] = content
        __props__.__dict__["created_at"] = created_at
        __props__.__dict__["expires_at"] = expires_at
        __props__.__dict__["name"] = name
        __props__.__dict__["project"] = project
        __props__.__dict__["secure_file_id"] = secure_file_id
        return ProjectSecureFile(resource_name, opts=opts, __props__=__props__)

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

    @_builtins.property
    @pulumi.getter(name="checksumAlgorithm")
    def checksum_algorithm(self) -> pulumi.Output[_builtins.str]:
        """
        The checksum algorithm used
        """
        return pulumi.get(self, "checksum_algorithm")

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

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> pulumi.Output[_builtins.str]:
        """
        The time the secure file was uploaded
        """
        return pulumi.get(self, "created_at")

    @_builtins.property
    @pulumi.getter(name="expiresAt")
    def expires_at(self) -> pulumi.Output[_builtins.str]:
        """
        The time the secure file will expire
        """
        return pulumi.get(self, "expires_at")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        The name for the secure file, unique per project
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def project(self) -> pulumi.Output[_builtins.str]:
        """
        The ID or full path of the project to environment is created for.
        """
        return pulumi.get(self, "project")

    @_builtins.property
    @pulumi.getter(name="secureFileId")
    def secure_file_id(self) -> pulumi.Output[_builtins.int]:
        """
        The id of the secure file in gitlab
        """
        return pulumi.get(self, "secure_file_id")

