# coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** 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__ = ['AutoDeployerArgs', 'AutoDeployer']

@pulumi.input_type
class AutoDeployerArgs:
    def __init__(__self__, *,
                 downstream_refs: pulumi.Input[Sequence[pulumi.Input[str]]],
                 organization: pulumi.Input[str],
                 project: pulumi.Input[str],
                 stack: pulumi.Input[str]):
        """
        The set of arguments for constructing a AutoDeployer resource.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] downstream_refs: A list of `AutoDeployer.DownstreamRef` indicating which stacks should
               automatically be updated via Pulumi Deployments when this stack is successfully updated.
        :param pulumi.Input[str] organization: The organization name for the AutoDeployer stack.
        :param pulumi.Input[str] project: The project name for the AutoDeployer stack.
        :param pulumi.Input[str] stack: The stack name for this AutoDeployer.
        """
        pulumi.set(__self__, "downstream_refs", downstream_refs)
        pulumi.set(__self__, "organization", organization)
        pulumi.set(__self__, "project", project)
        pulumi.set(__self__, "stack", stack)

    @property
    @pulumi.getter(name="downstreamRefs")
    def downstream_refs(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
        """
        A list of `AutoDeployer.DownstreamRef` indicating which stacks should
        automatically be updated via Pulumi Deployments when this stack is successfully updated.
        """
        return pulumi.get(self, "downstream_refs")

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

    @property
    @pulumi.getter
    def organization(self) -> pulumi.Input[str]:
        """
        The organization name for the AutoDeployer stack.
        """
        return pulumi.get(self, "organization")

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

    @property
    @pulumi.getter
    def project(self) -> pulumi.Input[str]:
        """
        The project name for the AutoDeployer stack.
        """
        return pulumi.get(self, "project")

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

    @property
    @pulumi.getter
    def stack(self) -> pulumi.Input[str]:
        """
        The stack name for this AutoDeployer.
        """
        return pulumi.get(self, "stack")

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


class AutoDeployer(pulumi.ComponentResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 downstream_refs: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 stack: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Automatically trigger downstream updates on dependent stacks via Pulumi Deployments.
        AutoDeployer requires that stacks have Deployment Settings configured.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] downstream_refs: A list of `AutoDeployer.DownstreamRef` indicating which stacks should
               automatically be updated via Pulumi Deployments when this stack is successfully updated.
        :param pulumi.Input[str] organization: The organization name for the AutoDeployer stack.
        :param pulumi.Input[str] project: The project name for the AutoDeployer stack.
        :param pulumi.Input[str] stack: The stack name for this AutoDeployer.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AutoDeployerArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Automatically trigger downstream updates on dependent stacks via Pulumi Deployments.
        AutoDeployer requires that stacks have Deployment Settings configured.

        :param str resource_name: The name of the resource.
        :param AutoDeployerArgs 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(AutoDeployerArgs, 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,
                 downstream_refs: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 stack: Optional[pulumi.Input[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 not None:
            raise ValueError('ComponentResource classes do not support opts.id')
        else:
            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__ = AutoDeployerArgs.__new__(AutoDeployerArgs)

            if downstream_refs is None and not opts.urn:
                raise TypeError("Missing required property 'downstream_refs'")
            __props__.__dict__["downstream_refs"] = downstream_refs
            if organization is None and not opts.urn:
                raise TypeError("Missing required property 'organization'")
            __props__.__dict__["organization"] = organization
            if project is None and not opts.urn:
                raise TypeError("Missing required property 'project'")
            __props__.__dict__["project"] = project
            if stack is None and not opts.urn:
                raise TypeError("Missing required property 'stack'")
            __props__.__dict__["stack"] = stack
            __props__.__dict__["downstream_webhooks"] = None
            __props__.__dict__["ref"] = None
        super(AutoDeployer, __self__).__init__(
            'auto-deploy:index:AutoDeployer',
            resource_name,
            __props__,
            opts,
            remote=True)

    @property
    @pulumi.getter(name="downstreamRefs")
    def downstream_refs(self) -> pulumi.Output[Sequence[str]]:
        """
        A list of `AutoDeployer.DownstreamRef` indicating which stacks should
        automatically be updated via Pulumi Deployments when this stack is successfully updated.
        """
        return pulumi.get(self, "downstream_refs")

    @property
    @pulumi.getter(name="downstreamWebhooks")
    def downstream_webhooks(self) -> pulumi.Output[Sequence[str]]:
        """
        A list of webhook URLs configured on this stack to trigger downstream deployments.
        """
        return pulumi.get(self, "downstream_webhooks")

    @property
    @pulumi.getter
    def organization(self) -> pulumi.Output[str]:
        """
        The organization name for the AutoDeployer stack.
        """
        return pulumi.get(self, "organization")

    @property
    @pulumi.getter
    def project(self) -> pulumi.Output[str]:
        """
        The project name for the AutoDeployer stack.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter
    def ref(self) -> pulumi.Output[str]:
        """
        The output reference that can be passed to another AutoDeployer's downstreamRefs list
        to configure depedent updates.
        """
        return pulumi.get(self, "ref")

    @property
    @pulumi.getter
    def stack(self) -> pulumi.Output[str]:
        """
        The stack name for this AutoDeployer.
        """
        return pulumi.get(self, "stack")

