# 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__ = ['PasswordExpirationPolicyArgs', 'PasswordExpirationPolicy']

@pulumi.input_type
class PasswordExpirationPolicyArgs:
    def __init__(__self__, *,
                 enabled: pulumi.Input[bool],
                 notify_by_email: pulumi.Input[bool],
                 password_max_age: pulumi.Input[int],
                 name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a PasswordExpirationPolicy resource.
        :param pulumi.Input[bool] enabled: Enable Password Expiration Policy. This only applies to internal user passwords.
        :param pulumi.Input[bool] notify_by_email: Send mail notification before password expiration. Users will receive an email notification X days before password will expire. Mail server must be enabled and configured correctly.
        :param pulumi.Input[int] password_max_age: Password expires every N days. The time interval in which users will be obligated to change their password.
        :param pulumi.Input[str] name: Name of the resource. Only used for importing.
        """
        pulumi.set(__self__, "enabled", enabled)
        pulumi.set(__self__, "notify_by_email", notify_by_email)
        pulumi.set(__self__, "password_max_age", password_max_age)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def enabled(self) -> pulumi.Input[bool]:
        """
        Enable Password Expiration Policy. This only applies to internal user passwords.
        """
        return pulumi.get(self, "enabled")

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

    @property
    @pulumi.getter(name="notifyByEmail")
    def notify_by_email(self) -> pulumi.Input[bool]:
        """
        Send mail notification before password expiration. Users will receive an email notification X days before password will expire. Mail server must be enabled and configured correctly.
        """
        return pulumi.get(self, "notify_by_email")

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

    @property
    @pulumi.getter(name="passwordMaxAge")
    def password_max_age(self) -> pulumi.Input[int]:
        """
        Password expires every N days. The time interval in which users will be obligated to change their password.
        """
        return pulumi.get(self, "password_max_age")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the resource. Only used for importing.
        """
        return pulumi.get(self, "name")

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


@pulumi.input_type
class _PasswordExpirationPolicyState:
    def __init__(__self__, *,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notify_by_email: Optional[pulumi.Input[bool]] = None,
                 password_max_age: Optional[pulumi.Input[int]] = None):
        """
        Input properties used for looking up and filtering PasswordExpirationPolicy resources.
        :param pulumi.Input[bool] enabled: Enable Password Expiration Policy. This only applies to internal user passwords.
        :param pulumi.Input[str] name: Name of the resource. Only used for importing.
        :param pulumi.Input[bool] notify_by_email: Send mail notification before password expiration. Users will receive an email notification X days before password will expire. Mail server must be enabled and configured correctly.
        :param pulumi.Input[int] password_max_age: Password expires every N days. The time interval in which users will be obligated to change their password.
        """
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if notify_by_email is not None:
            pulumi.set(__self__, "notify_by_email", notify_by_email)
        if password_max_age is not None:
            pulumi.set(__self__, "password_max_age", password_max_age)

    @property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Enable Password Expiration Policy. This only applies to internal user passwords.
        """
        return pulumi.get(self, "enabled")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the resource. Only used for importing.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="notifyByEmail")
    def notify_by_email(self) -> Optional[pulumi.Input[bool]]:
        """
        Send mail notification before password expiration. Users will receive an email notification X days before password will expire. Mail server must be enabled and configured correctly.
        """
        return pulumi.get(self, "notify_by_email")

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

    @property
    @pulumi.getter(name="passwordMaxAge")
    def password_max_age(self) -> Optional[pulumi.Input[int]]:
        """
        Password expires every N days. The time interval in which users will be obligated to change their password.
        """
        return pulumi.get(self, "password_max_age")

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


class PasswordExpirationPolicy(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notify_by_email: Optional[pulumi.Input[bool]] = None,
                 password_max_age: Optional[pulumi.Input[int]] = None,
                 __props__=None):
        """
        Provides an Artifactory Password Expiration Policy resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_artifactory as artifactory

        my_password_expiration_policy = artifactory.PasswordExpirationPolicy("my-password-expiration-policy",
            name="my-password-expiration-policy",
            enabled=True,
            password_max_age=120,
            notify_by_email=True)
        ```

        ## Import

        ```sh
        $ pulumi import artifactory:index/passwordExpirationPolicy:PasswordExpirationPolicy my-password-expiration-policy my-password-expiration-policy
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[bool] enabled: Enable Password Expiration Policy. This only applies to internal user passwords.
        :param pulumi.Input[str] name: Name of the resource. Only used for importing.
        :param pulumi.Input[bool] notify_by_email: Send mail notification before password expiration. Users will receive an email notification X days before password will expire. Mail server must be enabled and configured correctly.
        :param pulumi.Input[int] password_max_age: Password expires every N days. The time interval in which users will be obligated to change their password.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: PasswordExpirationPolicyArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides an Artifactory Password Expiration Policy resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_artifactory as artifactory

        my_password_expiration_policy = artifactory.PasswordExpirationPolicy("my-password-expiration-policy",
            name="my-password-expiration-policy",
            enabled=True,
            password_max_age=120,
            notify_by_email=True)
        ```

        ## Import

        ```sh
        $ pulumi import artifactory:index/passwordExpirationPolicy:PasswordExpirationPolicy my-password-expiration-policy my-password-expiration-policy
        ```

        :param str resource_name: The name of the resource.
        :param PasswordExpirationPolicyArgs 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(PasswordExpirationPolicyArgs, 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,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notify_by_email: Optional[pulumi.Input[bool]] = None,
                 password_max_age: Optional[pulumi.Input[int]] = 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__ = PasswordExpirationPolicyArgs.__new__(PasswordExpirationPolicyArgs)

            if enabled is None and not opts.urn:
                raise TypeError("Missing required property 'enabled'")
            __props__.__dict__["enabled"] = enabled
            __props__.__dict__["name"] = name
            if notify_by_email is None and not opts.urn:
                raise TypeError("Missing required property 'notify_by_email'")
            __props__.__dict__["notify_by_email"] = notify_by_email
            if password_max_age is None and not opts.urn:
                raise TypeError("Missing required property 'password_max_age'")
            __props__.__dict__["password_max_age"] = password_max_age
        super(PasswordExpirationPolicy, __self__).__init__(
            'artifactory:index/passwordExpirationPolicy:PasswordExpirationPolicy',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            enabled: Optional[pulumi.Input[bool]] = None,
            name: Optional[pulumi.Input[str]] = None,
            notify_by_email: Optional[pulumi.Input[bool]] = None,
            password_max_age: Optional[pulumi.Input[int]] = None) -> 'PasswordExpirationPolicy':
        """
        Get an existing PasswordExpirationPolicy 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[bool] enabled: Enable Password Expiration Policy. This only applies to internal user passwords.
        :param pulumi.Input[str] name: Name of the resource. Only used for importing.
        :param pulumi.Input[bool] notify_by_email: Send mail notification before password expiration. Users will receive an email notification X days before password will expire. Mail server must be enabled and configured correctly.
        :param pulumi.Input[int] password_max_age: Password expires every N days. The time interval in which users will be obligated to change their password.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _PasswordExpirationPolicyState.__new__(_PasswordExpirationPolicyState)

        __props__.__dict__["enabled"] = enabled
        __props__.__dict__["name"] = name
        __props__.__dict__["notify_by_email"] = notify_by_email
        __props__.__dict__["password_max_age"] = password_max_age
        return PasswordExpirationPolicy(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[bool]:
        """
        Enable Password Expiration Policy. This only applies to internal user passwords.
        """
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Name of the resource. Only used for importing.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="notifyByEmail")
    def notify_by_email(self) -> pulumi.Output[bool]:
        """
        Send mail notification before password expiration. Users will receive an email notification X days before password will expire. Mail server must be enabled and configured correctly.
        """
        return pulumi.get(self, "notify_by_email")

    @property
    @pulumi.getter(name="passwordMaxAge")
    def password_max_age(self) -> pulumi.Output[int]:
        """
        Password expires every N days. The time interval in which users will be obligated to change their password.
        """
        return pulumi.get(self, "password_max_age")

