# 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 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__ = ['AlertArgs', 'Alert']

@pulumi.input_type
class AlertArgs:
    def __init__(__self__, *,
                 subtype: pulumi.Input[str],
                 type: pulumi.Input[str],
                 name: Optional[pulumi.Input[str]] = None,
                 notification_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 record_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 zone_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        The set of arguments for constructing a Alert resource.
        :param pulumi.Input[str] subtype: The type of the alert.
        :param pulumi.Input[str] type: The type of the alert.
        :param pulumi.Input[str] name: The free-form display name for the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] notification_lists: A list of id's for notification lists whose notifiers will be triggered by the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] record_ids: A list of record id's this alert applies to.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] zone_names: A list of zones this alert applies to.
        """
        pulumi.set(__self__, "subtype", subtype)
        pulumi.set(__self__, "type", type)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if notification_lists is not None:
            pulumi.set(__self__, "notification_lists", notification_lists)
        if record_ids is not None:
            pulumi.set(__self__, "record_ids", record_ids)
        if zone_names is not None:
            pulumi.set(__self__, "zone_names", zone_names)

    @property
    @pulumi.getter
    def subtype(self) -> pulumi.Input[str]:
        """
        The type of the alert.
        """
        return pulumi.get(self, "subtype")

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

    @property
    @pulumi.getter
    def type(self) -> pulumi.Input[str]:
        """
        The type of the alert.
        """
        return pulumi.get(self, "type")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The free-form display name for the alert.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="notificationLists")
    def notification_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of id's for notification lists whose notifiers will be triggered by the alert.
        """
        return pulumi.get(self, "notification_lists")

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

    @property
    @pulumi.getter(name="recordIds")
    def record_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of record id's this alert applies to.
        """
        return pulumi.get(self, "record_ids")

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

    @property
    @pulumi.getter(name="zoneNames")
    def zone_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of zones this alert applies to.
        """
        return pulumi.get(self, "zone_names")

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


@pulumi.input_type
class _AlertState:
    def __init__(__self__, *,
                 created_at: Optional[pulumi.Input[int]] = None,
                 created_by: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notification_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 record_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 subtype: Optional[pulumi.Input[str]] = None,
                 type: Optional[pulumi.Input[str]] = None,
                 updated_at: Optional[pulumi.Input[int]] = None,
                 updated_by: Optional[pulumi.Input[str]] = None,
                 zone_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        Input properties used for looking up and filtering Alert resources.
        :param pulumi.Input[int] created_at: (Read Only) The Unix timestamp representing when the alert configuration was created.
        :param pulumi.Input[str] created_by: (Read Only) The user or apikey that created this alert.
        :param pulumi.Input[str] name: The free-form display name for the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] notification_lists: A list of id's for notification lists whose notifiers will be triggered by the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] record_ids: A list of record id's this alert applies to.
        :param pulumi.Input[str] subtype: The type of the alert.
        :param pulumi.Input[str] type: The type of the alert.
        :param pulumi.Input[int] updated_at: (Read Only) The Unix timestamp representing when the alert configuration was last modified.
        :param pulumi.Input[str] updated_by: (Read Only) The user or apikey that last modified this alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] zone_names: A list of zones this alert applies to.
        """
        if created_at is not None:
            pulumi.set(__self__, "created_at", created_at)
        if created_by is not None:
            pulumi.set(__self__, "created_by", created_by)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if notification_lists is not None:
            pulumi.set(__self__, "notification_lists", notification_lists)
        if record_ids is not None:
            pulumi.set(__self__, "record_ids", record_ids)
        if subtype is not None:
            pulumi.set(__self__, "subtype", subtype)
        if type is not None:
            pulumi.set(__self__, "type", type)
        if updated_at is not None:
            pulumi.set(__self__, "updated_at", updated_at)
        if updated_by is not None:
            pulumi.set(__self__, "updated_by", updated_by)
        if zone_names is not None:
            pulumi.set(__self__, "zone_names", zone_names)

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> Optional[pulumi.Input[int]]:
        """
        (Read Only) The Unix timestamp representing when the alert configuration was created.
        """
        return pulumi.get(self, "created_at")

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

    @property
    @pulumi.getter(name="createdBy")
    def created_by(self) -> Optional[pulumi.Input[str]]:
        """
        (Read Only) The user or apikey that created this alert.
        """
        return pulumi.get(self, "created_by")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The free-form display name for the alert.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="notificationLists")
    def notification_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of id's for notification lists whose notifiers will be triggered by the alert.
        """
        return pulumi.get(self, "notification_lists")

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

    @property
    @pulumi.getter(name="recordIds")
    def record_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of record id's this alert applies to.
        """
        return pulumi.get(self, "record_ids")

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

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

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

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

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

    @property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> Optional[pulumi.Input[int]]:
        """
        (Read Only) The Unix timestamp representing when the alert configuration was last modified.
        """
        return pulumi.get(self, "updated_at")

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

    @property
    @pulumi.getter(name="updatedBy")
    def updated_by(self) -> Optional[pulumi.Input[str]]:
        """
        (Read Only) The user or apikey that last modified this alert.
        """
        return pulumi.get(self, "updated_by")

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

    @property
    @pulumi.getter(name="zoneNames")
    def zone_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of zones this alert applies to.
        """
        return pulumi.get(self, "zone_names")

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


class Alert(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notification_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 record_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 subtype: Optional[pulumi.Input[str]] = None,
                 type: Optional[pulumi.Input[str]] = None,
                 zone_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 __props__=None):
        """
        Provides a NS1 Alert resource. This can be used to create, modify, and delete alerts.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_ns1 as ns1

        example = ns1.Alert("example",
            name="Example Alert",
            type="zone",
            subtype="transfer_failed",
            notification_lists=[],
            zone_names=[],
            record_ids=[])
        ```

        ## NS1 Documentation

        [Alerts Api Doc](https://ns1.com/api#alerts)

        ## Import

        ```sh
        $ pulumi import ns1:index/alert:Alert <name> <alert_id>`
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] name: The free-form display name for the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] notification_lists: A list of id's for notification lists whose notifiers will be triggered by the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] record_ids: A list of record id's this alert applies to.
        :param pulumi.Input[str] subtype: The type of the alert.
        :param pulumi.Input[str] type: The type of the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] zone_names: A list of zones this alert applies to.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AlertArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a NS1 Alert resource. This can be used to create, modify, and delete alerts.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_ns1 as ns1

        example = ns1.Alert("example",
            name="Example Alert",
            type="zone",
            subtype="transfer_failed",
            notification_lists=[],
            zone_names=[],
            record_ids=[])
        ```

        ## NS1 Documentation

        [Alerts Api Doc](https://ns1.com/api#alerts)

        ## Import

        ```sh
        $ pulumi import ns1:index/alert:Alert <name> <alert_id>`
        ```

        :param str resource_name: The name of the resource.
        :param AlertArgs 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(AlertArgs, 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,
                 name: Optional[pulumi.Input[str]] = None,
                 notification_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 record_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 subtype: Optional[pulumi.Input[str]] = None,
                 type: Optional[pulumi.Input[str]] = None,
                 zone_names: Optional[pulumi.Input[Sequence[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 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__ = AlertArgs.__new__(AlertArgs)

            __props__.__dict__["name"] = name
            __props__.__dict__["notification_lists"] = notification_lists
            __props__.__dict__["record_ids"] = record_ids
            if subtype is None and not opts.urn:
                raise TypeError("Missing required property 'subtype'")
            __props__.__dict__["subtype"] = subtype
            if type is None and not opts.urn:
                raise TypeError("Missing required property 'type'")
            __props__.__dict__["type"] = type
            __props__.__dict__["zone_names"] = zone_names
            __props__.__dict__["created_at"] = None
            __props__.__dict__["created_by"] = None
            __props__.__dict__["updated_at"] = None
            __props__.__dict__["updated_by"] = None
        super(Alert, __self__).__init__(
            'ns1:index/alert:Alert',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            created_at: Optional[pulumi.Input[int]] = None,
            created_by: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            notification_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            record_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            subtype: Optional[pulumi.Input[str]] = None,
            type: Optional[pulumi.Input[str]] = None,
            updated_at: Optional[pulumi.Input[int]] = None,
            updated_by: Optional[pulumi.Input[str]] = None,
            zone_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'Alert':
        """
        Get an existing Alert 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[int] created_at: (Read Only) The Unix timestamp representing when the alert configuration was created.
        :param pulumi.Input[str] created_by: (Read Only) The user or apikey that created this alert.
        :param pulumi.Input[str] name: The free-form display name for the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] notification_lists: A list of id's for notification lists whose notifiers will be triggered by the alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] record_ids: A list of record id's this alert applies to.
        :param pulumi.Input[str] subtype: The type of the alert.
        :param pulumi.Input[str] type: The type of the alert.
        :param pulumi.Input[int] updated_at: (Read Only) The Unix timestamp representing when the alert configuration was last modified.
        :param pulumi.Input[str] updated_by: (Read Only) The user or apikey that last modified this alert.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] zone_names: A list of zones this alert applies to.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _AlertState.__new__(_AlertState)

        __props__.__dict__["created_at"] = created_at
        __props__.__dict__["created_by"] = created_by
        __props__.__dict__["name"] = name
        __props__.__dict__["notification_lists"] = notification_lists
        __props__.__dict__["record_ids"] = record_ids
        __props__.__dict__["subtype"] = subtype
        __props__.__dict__["type"] = type
        __props__.__dict__["updated_at"] = updated_at
        __props__.__dict__["updated_by"] = updated_by
        __props__.__dict__["zone_names"] = zone_names
        return Alert(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> pulumi.Output[int]:
        """
        (Read Only) The Unix timestamp representing when the alert configuration was created.
        """
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter(name="createdBy")
    def created_by(self) -> pulumi.Output[str]:
        """
        (Read Only) The user or apikey that created this alert.
        """
        return pulumi.get(self, "created_by")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The free-form display name for the alert.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="notificationLists")
    def notification_lists(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        A list of id's for notification lists whose notifiers will be triggered by the alert.
        """
        return pulumi.get(self, "notification_lists")

    @property
    @pulumi.getter(name="recordIds")
    def record_ids(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        A list of record id's this alert applies to.
        """
        return pulumi.get(self, "record_ids")

    @property
    @pulumi.getter
    def subtype(self) -> pulumi.Output[str]:
        """
        The type of the alert.
        """
        return pulumi.get(self, "subtype")

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

    @property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> pulumi.Output[int]:
        """
        (Read Only) The Unix timestamp representing when the alert configuration was last modified.
        """
        return pulumi.get(self, "updated_at")

    @property
    @pulumi.getter(name="updatedBy")
    def updated_by(self) -> pulumi.Output[str]:
        """
        (Read Only) The user or apikey that last modified this alert.
        """
        return pulumi.get(self, "updated_by")

    @property
    @pulumi.getter(name="zoneNames")
    def zone_names(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        A list of zones this alert applies to.
        """
        return pulumi.get(self, "zone_names")

