# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class UserContactMethod(pulumi.CustomResource):
    address: pulumi.Output[str]
    """
    The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
    """
    blacklisted: pulumi.Output[bool]
    """
    If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
    """
    country_code: pulumi.Output[float]
    """
    The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.
    """
    enabled: pulumi.Output[bool]
    """
    If true, this phone is capable of receiving SMS messages.
    """
    label: pulumi.Output[str]
    """
    The label (e.g., "Work", "Mobile", etc.).
    """
    send_short_email: pulumi.Output[bool]
    """
    Send an abbreviated email message instead of the standard email output.
    """
    type: pulumi.Output[str]
    """
    The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).
    """
    user_id: pulumi.Output[str]
    """
    The ID of the user.
    """
    def __init__(__self__, resource_name, opts=None, address=None, country_code=None, label=None, send_short_email=None, type=None, user_id=None, __props__=None, __name__=None, __opts__=None):
        """
        A [contact method](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Users/get_users_id_contact_methods) is a contact method for a PagerDuty user (email, phone or SMS).


        ## Example Usage



        ```python
        import pulumi
        import pulumi_pagerduty as pagerduty

        example = pagerduty.User("example",
            email="<EMAIL>",
            teams=[pagerduty_team["example"]["id"]])
        email = pagerduty.UserContactMethod("email",
            address="<EMAIL>",
            label="Work",
            type="email_contact_method",
            user_id=example.id)
        phone = pagerduty.UserContactMethod("phone",
            address="2025550199",
            country_code="+1",
            label="Work",
            type="phone_contact_method",
            user_id=example.id)
        sms = pagerduty.UserContactMethod("sms",
            address="2025550199",
            country_code="+1",
            label="Work",
            type="sms_contact_method",
            user_id=example.id)
        ```


        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] address: The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
        :param pulumi.Input[float] country_code: The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.
        :param pulumi.Input[str] label: The label (e.g., "Work", "Mobile", etc.).
        :param pulumi.Input[bool] send_short_email: Send an abbreviated email message instead of the standard email output.
        :param pulumi.Input[str] type: The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).
        :param pulumi.Input[str] user_id: The ID of the user.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        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__ = dict()

            if address is None:
                raise TypeError("Missing required property 'address'")
            __props__['address'] = address
            __props__['country_code'] = country_code
            if label is None:
                raise TypeError("Missing required property 'label'")
            __props__['label'] = label
            __props__['send_short_email'] = send_short_email
            if type is None:
                raise TypeError("Missing required property 'type'")
            __props__['type'] = type
            if user_id is None:
                raise TypeError("Missing required property 'user_id'")
            __props__['user_id'] = user_id
            __props__['blacklisted'] = None
            __props__['enabled'] = None
        super(UserContactMethod, __self__).__init__(
            'pagerduty:index/userContactMethod:UserContactMethod',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, address=None, blacklisted=None, country_code=None, enabled=None, label=None, send_short_email=None, type=None, user_id=None):
        """
        Get an existing UserContactMethod 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] address: The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
        :param pulumi.Input[bool] blacklisted: If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
        :param pulumi.Input[float] country_code: The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.
        :param pulumi.Input[bool] enabled: If true, this phone is capable of receiving SMS messages.
        :param pulumi.Input[str] label: The label (e.g., "Work", "Mobile", etc.).
        :param pulumi.Input[bool] send_short_email: Send an abbreviated email message instead of the standard email output.
        :param pulumi.Input[str] type: The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).
        :param pulumi.Input[str] user_id: The ID of the user.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["address"] = address
        __props__["blacklisted"] = blacklisted
        __props__["country_code"] = country_code
        __props__["enabled"] = enabled
        __props__["label"] = label
        __props__["send_short_email"] = send_short_email
        __props__["type"] = type
        __props__["user_id"] = user_id
        return UserContactMethod(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop


# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class UserContactMethod(pulumi.CustomResource):
    address: pulumi.Output[str]
    """
    The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
    """
    blacklisted: pulumi.Output[bool]
    """
    If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
    """
    country_code: pulumi.Output[float]
    """
    The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.
    """
    enabled: pulumi.Output[bool]
    """
    If true, this phone is capable of receiving SMS messages.
    """
    label: pulumi.Output[str]
    """
    The label (e.g., "Work", "Mobile", etc.).
    """
    send_short_email: pulumi.Output[bool]
    """
    Send an abbreviated email message instead of the standard email output.
    """
    type: pulumi.Output[str]
    """
    The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).
    """
    user_id: pulumi.Output[str]
    """
    The ID of the user.
    """
    def __init__(__self__, resource_name, opts=None, address=None, country_code=None, label=None, send_short_email=None, type=None, user_id=None, __props__=None, __name__=None, __opts__=None):
        """
        A [contact method](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Users/get_users_id_contact_methods) is a contact method for a PagerDuty user (email, phone or SMS).


        ## Example Usage



        ```python
        import pulumi
        import pulumi_pagerduty as pagerduty

        example = pagerduty.User("example",
            email="<EMAIL>",
            teams=[pagerduty_team["example"]["id"]])
        email = pagerduty.UserContactMethod("email",
            address="<EMAIL>",
            label="Work",
            type="email_contact_method",
            user_id=example.id)
        phone = pagerduty.UserContactMethod("phone",
            address="2025550199",
            country_code="+1",
            label="Work",
            type="phone_contact_method",
            user_id=example.id)
        sms = pagerduty.UserContactMethod("sms",
            address="2025550199",
            country_code="+1",
            label="Work",
            type="sms_contact_method",
            user_id=example.id)
        ```


        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] address: The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
        :param pulumi.Input[float] country_code: The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.
        :param pulumi.Input[str] label: The label (e.g., "Work", "Mobile", etc.).
        :param pulumi.Input[bool] send_short_email: Send an abbreviated email message instead of the standard email output.
        :param pulumi.Input[str] type: The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).
        :param pulumi.Input[str] user_id: The ID of the user.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        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__ = dict()

            if address is None:
                raise TypeError("Missing required property 'address'")
            __props__['address'] = address
            __props__['country_code'] = country_code
            if label is None:
                raise TypeError("Missing required property 'label'")
            __props__['label'] = label
            __props__['send_short_email'] = send_short_email
            if type is None:
                raise TypeError("Missing required property 'type'")
            __props__['type'] = type
            if user_id is None:
                raise TypeError("Missing required property 'user_id'")
            __props__['user_id'] = user_id
            __props__['blacklisted'] = None
            __props__['enabled'] = None
        super(UserContactMethod, __self__).__init__(
            'pagerduty:index/userContactMethod:UserContactMethod',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, address=None, blacklisted=None, country_code=None, enabled=None, label=None, send_short_email=None, type=None, user_id=None):
        """
        Get an existing UserContactMethod 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] address: The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
        :param pulumi.Input[bool] blacklisted: If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
        :param pulumi.Input[float] country_code: The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.
        :param pulumi.Input[bool] enabled: If true, this phone is capable of receiving SMS messages.
        :param pulumi.Input[str] label: The label (e.g., "Work", "Mobile", etc.).
        :param pulumi.Input[bool] send_short_email: Send an abbreviated email message instead of the standard email output.
        :param pulumi.Input[str] type: The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).
        :param pulumi.Input[str] user_id: The ID of the user.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["address"] = address
        __props__["blacklisted"] = blacklisted
        __props__["country_code"] = country_code
        __props__["enabled"] = enabled
        __props__["label"] = label
        __props__["send_short_email"] = send_short_email
        __props__["type"] = type
        __props__["user_id"] = user_id
        return UserContactMethod(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop


# 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! *** The "address" to deliver to: `email`, `phone number`, etc., depending on the type. If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it. The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`. If true, this phone is capable of receiving SMS messages. The label (e.g., "Work", "Mobile", etc.). Send an abbreviated email message instead of the standard email output. The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`). The ID of the user. A [contact method](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Users/get_users_id_contact_methods) is a contact method for a PagerDuty user (email, phone or SMS).           ## Example Usage            ```python         import pulumi         import pulumi_pagerduty as pagerduty          example = pagerduty.User("example",             email="<EMAIL>",             teams=[pagerduty_team["example"]["id"]])         email = pagerduty.UserContactMethod("email",             address="<EMAIL>",             label="Work",             type="email_contact_method",             user_id=example.id)         phone = pagerduty.UserContactMethod("phone",             address="2025550199",             country_code="+1",             label="Work",             type="phone_contact_method",             user_id=example.id)         sms = pagerduty.UserContactMethod("sms",             address="2025550199",             country_code="+1",             label="Work",             type="sms_contact_method",             user_id=example.id)         ```           :param str resource_name: The name of the resource.         :param pulumi.ResourceOptions opts: Options for the resource.         :param pulumi.Input[str] address: The "address" to deliver to: `email`, `phone number`, etc., depending on the type.         :param pulumi.Input[float] country_code: The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.         :param pulumi.Input[str] label: The label (e.g., "Work", "Mobile", etc.).         :param pulumi.Input[bool] send_short_email: Send an abbreviated email message instead of the standard email output.         :param pulumi.Input[str] type: The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).         :param pulumi.Input[str] user_id: The ID of the user. Get an existing UserContactMethod 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 str id: The unique provider ID of the resource to lookup.         :param pulumi.ResourceOptions opts: Options for the resource.         :param pulumi.Input[str] address: The "address" to deliver to: `email`, `phone number`, etc., depending on the type.         :param pulumi.Input[bool] blacklisted: If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.         :param pulumi.Input[float] country_code: The 1-to-3 digit country calling code. Required when using `phone_contact_method` or `sms_contact_method`.         :param pulumi.Input[bool] enabled: If true, this phone is capable of receiving SMS messages.         :param pulumi.Input[str] label: The label (e.g., "Work", "Mobile", etc.).         :param pulumi.Input[bool] send_short_email: Send an abbreviated email message instead of the standard email output.         :param pulumi.Input[str] type: The contact method type. May be (`email_contact_method`, `phone_contact_method`, `sms_contact_method`, `push_notification_contact_method`).         :param pulumi.Input[str] user_id: The ID of the user.