# 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
from . import outputs
from ._inputs import *

__all__ = ['ProjectRollingReleaseArgs', 'ProjectRollingRelease']

@pulumi.input_type
class ProjectRollingReleaseArgs:
    def __init__(__self__, *,
                 advancement_type: pulumi.Input[_builtins.str],
                 project_id: pulumi.Input[_builtins.str],
                 stages: pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]],
                 team_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a ProjectRollingRelease resource.
        :param pulumi.Input[_builtins.str] advancement_type: The type of advancement for the rolling release. Must be either 'automatic' or 'manual-approval'.
        :param pulumi.Input[_builtins.str] project_id: The ID of the project.
        :param pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]] stages: The stages for the rolling release configuration. The last stage must have target_percentage = 100.
        :param pulumi.Input[_builtins.str] team_id: The ID of the Vercel team.
        """
        pulumi.set(__self__, "advancement_type", advancement_type)
        pulumi.set(__self__, "project_id", project_id)
        pulumi.set(__self__, "stages", stages)
        if team_id is not None:
            pulumi.set(__self__, "team_id", team_id)

    @_builtins.property
    @pulumi.getter(name="advancementType")
    def advancement_type(self) -> pulumi.Input[_builtins.str]:
        """
        The type of advancement for the rolling release. Must be either 'automatic' or 'manual-approval'.
        """
        return pulumi.get(self, "advancement_type")

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

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Input[_builtins.str]:
        """
        The ID of the project.
        """
        return pulumi.get(self, "project_id")

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

    @_builtins.property
    @pulumi.getter
    def stages(self) -> pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]]:
        """
        The stages for the rolling release configuration. The last stage must have target_percentage = 100.
        """
        return pulumi.get(self, "stages")

    @stages.setter
    def stages(self, value: pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]]):
        pulumi.set(self, "stages", value)

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the Vercel team.
        """
        return pulumi.get(self, "team_id")

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


@pulumi.input_type
class _ProjectRollingReleaseState:
    def __init__(__self__, *,
                 advancement_type: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.str]] = None,
                 stages: Optional[pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering ProjectRollingRelease resources.
        :param pulumi.Input[_builtins.str] advancement_type: The type of advancement for the rolling release. Must be either 'automatic' or 'manual-approval'.
        :param pulumi.Input[_builtins.str] project_id: The ID of the project.
        :param pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]] stages: The stages for the rolling release configuration. The last stage must have target_percentage = 100.
        :param pulumi.Input[_builtins.str] team_id: The ID of the Vercel team.
        """
        if advancement_type is not None:
            pulumi.set(__self__, "advancement_type", advancement_type)
        if project_id is not None:
            pulumi.set(__self__, "project_id", project_id)
        if stages is not None:
            pulumi.set(__self__, "stages", stages)
        if team_id is not None:
            pulumi.set(__self__, "team_id", team_id)

    @_builtins.property
    @pulumi.getter(name="advancementType")
    def advancement_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The type of advancement for the rolling release. Must be either 'automatic' or 'manual-approval'.
        """
        return pulumi.get(self, "advancement_type")

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

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the project.
        """
        return pulumi.get(self, "project_id")

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

    @_builtins.property
    @pulumi.getter
    def stages(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]]]:
        """
        The stages for the rolling release configuration. The last stage must have target_percentage = 100.
        """
        return pulumi.get(self, "stages")

    @stages.setter
    def stages(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ProjectRollingReleaseStageArgs']]]]):
        pulumi.set(self, "stages", value)

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the Vercel team.
        """
        return pulumi.get(self, "team_id")

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


@pulumi.type_token("vercel:index/projectRollingRelease:ProjectRollingRelease")
class ProjectRollingRelease(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 advancement_type: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.str]] = None,
                 stages: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ProjectRollingReleaseStageArgs', 'ProjectRollingReleaseStageArgsDict']]]]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Resource for a Vercel project rolling release configuration.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_vercel as vercel

        example = vercel.Project("example",
            name="example-project",
            skew_protection="12 hours")
        example_project_rolling_release = vercel.ProjectRollingRelease("example",
            project_id=example.id,
            advancement_type="manual-approval",
            stages=[
                {
                    "target_percentage": 20,
                },
                {
                    "target_percentage": 50,
                },
            ])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] advancement_type: The type of advancement for the rolling release. Must be either 'automatic' or 'manual-approval'.
        :param pulumi.Input[_builtins.str] project_id: The ID of the project.
        :param pulumi.Input[Sequence[pulumi.Input[Union['ProjectRollingReleaseStageArgs', 'ProjectRollingReleaseStageArgsDict']]]] stages: The stages for the rolling release configuration. The last stage must have target_percentage = 100.
        :param pulumi.Input[_builtins.str] team_id: The ID of the Vercel team.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ProjectRollingReleaseArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Resource for a Vercel project rolling release configuration.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_vercel as vercel

        example = vercel.Project("example",
            name="example-project",
            skew_protection="12 hours")
        example_project_rolling_release = vercel.ProjectRollingRelease("example",
            project_id=example.id,
            advancement_type="manual-approval",
            stages=[
                {
                    "target_percentage": 20,
                },
                {
                    "target_percentage": 50,
                },
            ])
        ```

        :param str resource_name: The name of the resource.
        :param ProjectRollingReleaseArgs 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(ProjectRollingReleaseArgs, 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,
                 advancement_type: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.str]] = None,
                 stages: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ProjectRollingReleaseStageArgs', 'ProjectRollingReleaseStageArgsDict']]]]] = None,
                 team_id: 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__ = ProjectRollingReleaseArgs.__new__(ProjectRollingReleaseArgs)

            if advancement_type is None and not opts.urn:
                raise TypeError("Missing required property 'advancement_type'")
            __props__.__dict__["advancement_type"] = advancement_type
            if project_id is None and not opts.urn:
                raise TypeError("Missing required property 'project_id'")
            __props__.__dict__["project_id"] = project_id
            if stages is None and not opts.urn:
                raise TypeError("Missing required property 'stages'")
            __props__.__dict__["stages"] = stages
            __props__.__dict__["team_id"] = team_id
        super(ProjectRollingRelease, __self__).__init__(
            'vercel:index/projectRollingRelease:ProjectRollingRelease',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            advancement_type: Optional[pulumi.Input[_builtins.str]] = None,
            project_id: Optional[pulumi.Input[_builtins.str]] = None,
            stages: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ProjectRollingReleaseStageArgs', 'ProjectRollingReleaseStageArgsDict']]]]] = None,
            team_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'ProjectRollingRelease':
        """
        Get an existing ProjectRollingRelease 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] advancement_type: The type of advancement for the rolling release. Must be either 'automatic' or 'manual-approval'.
        :param pulumi.Input[_builtins.str] project_id: The ID of the project.
        :param pulumi.Input[Sequence[pulumi.Input[Union['ProjectRollingReleaseStageArgs', 'ProjectRollingReleaseStageArgsDict']]]] stages: The stages for the rolling release configuration. The last stage must have target_percentage = 100.
        :param pulumi.Input[_builtins.str] team_id: The ID of the Vercel team.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ProjectRollingReleaseState.__new__(_ProjectRollingReleaseState)

        __props__.__dict__["advancement_type"] = advancement_type
        __props__.__dict__["project_id"] = project_id
        __props__.__dict__["stages"] = stages
        __props__.__dict__["team_id"] = team_id
        return ProjectRollingRelease(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="advancementType")
    def advancement_type(self) -> pulumi.Output[_builtins.str]:
        """
        The type of advancement for the rolling release. Must be either 'automatic' or 'manual-approval'.
        """
        return pulumi.get(self, "advancement_type")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the project.
        """
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter
    def stages(self) -> pulumi.Output[Sequence['outputs.ProjectRollingReleaseStage']]:
        """
        The stages for the rolling release configuration. The last stage must have target_percentage = 100.
        """
        return pulumi.get(self, "stages")

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the Vercel team.
        """
        return pulumi.get(self, "team_id")

