# 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__ = ['SentryOrganizationMemberArgs', 'SentryOrganizationMember']

@pulumi.input_type
class SentryOrganizationMemberArgs:
    def __init__(__self__, *,
                 email: pulumi.Input[str],
                 organization: pulumi.Input[str],
                 role: pulumi.Input[str],
                 teams: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        The set of arguments for constructing a SentryOrganizationMember resource.
        :param pulumi.Input[str] email: The email of the organization member.
        :param pulumi.Input[str] organization: The slug of the organization the user should be invited to.
        :param pulumi.Input[str] role: This is the role of the organization member.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] teams: The teams the organization member should be added to.
        """
        pulumi.set(__self__, "email", email)
        pulumi.set(__self__, "organization", organization)
        pulumi.set(__self__, "role", role)
        if teams is not None:
            pulumi.set(__self__, "teams", teams)

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

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

    @property
    @pulumi.getter
    def organization(self) -> pulumi.Input[str]:
        """
        The slug of the organization the user should be invited to.
        """
        return pulumi.get(self, "organization")

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

    @property
    @pulumi.getter
    def role(self) -> pulumi.Input[str]:
        """
        This is the role of the organization member.
        """
        return pulumi.get(self, "role")

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

    @property
    @pulumi.getter
    def teams(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The teams the organization member should be added to.
        """
        return pulumi.get(self, "teams")

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


@pulumi.input_type
class _SentryOrganizationMemberState:
    def __init__(__self__, *,
                 email: Optional[pulumi.Input[str]] = None,
                 expired: Optional[pulumi.Input[bool]] = None,
                 internal_id: Optional[pulumi.Input[str]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 pending: Optional[pulumi.Input[bool]] = None,
                 role: Optional[pulumi.Input[str]] = None,
                 teams: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        Input properties used for looking up and filtering SentryOrganizationMember resources.
        :param pulumi.Input[str] email: The email of the organization member.
        :param pulumi.Input[bool] expired: The invite has expired.
        :param pulumi.Input[str] internal_id: The internal ID for this organization membership.
        :param pulumi.Input[str] organization: The slug of the organization the user should be invited to.
        :param pulumi.Input[bool] pending: The invite is pending.
        :param pulumi.Input[str] role: This is the role of the organization member.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] teams: The teams the organization member should be added to.
        """
        if email is not None:
            pulumi.set(__self__, "email", email)
        if expired is not None:
            pulumi.set(__self__, "expired", expired)
        if internal_id is not None:
            pulumi.set(__self__, "internal_id", internal_id)
        if organization is not None:
            pulumi.set(__self__, "organization", organization)
        if pending is not None:
            pulumi.set(__self__, "pending", pending)
        if role is not None:
            pulumi.set(__self__, "role", role)
        if teams is not None:
            pulumi.set(__self__, "teams", teams)

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

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

    @property
    @pulumi.getter
    def expired(self) -> Optional[pulumi.Input[bool]]:
        """
        The invite has expired.
        """
        return pulumi.get(self, "expired")

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

    @property
    @pulumi.getter(name="internalId")
    def internal_id(self) -> Optional[pulumi.Input[str]]:
        """
        The internal ID for this organization membership.
        """
        return pulumi.get(self, "internal_id")

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

    @property
    @pulumi.getter
    def organization(self) -> Optional[pulumi.Input[str]]:
        """
        The slug of the organization the user should be invited to.
        """
        return pulumi.get(self, "organization")

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

    @property
    @pulumi.getter
    def pending(self) -> Optional[pulumi.Input[bool]]:
        """
        The invite is pending.
        """
        return pulumi.get(self, "pending")

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

    @property
    @pulumi.getter
    def role(self) -> Optional[pulumi.Input[str]]:
        """
        This is the role of the organization member.
        """
        return pulumi.get(self, "role")

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

    @property
    @pulumi.getter
    def teams(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The teams the organization member should be added to.
        """
        return pulumi.get(self, "teams")

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


class SentryOrganizationMember(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 email: Optional[pulumi.Input[str]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 role: Optional[pulumi.Input[str]] = None,
                 teams: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 __props__=None):
        """
        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_sentry as sentry

        # Create an organization member
        john_doe = sentry.SentryOrganizationMember("john_doe",
            organization="my-organization",
            email="test@example.com",
            role="member",
            teams=["my-team"])
        ```

        ## Import

        import using the organization, membership id from the URL:

        https://sentry.io/settings/[org-slug]/members/[member-id]/

        ```sh
        $ pulumi import sentry:index/sentryOrganizationMember:SentryOrganizationMember john_doe org-slug/member-id
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] email: The email of the organization member.
        :param pulumi.Input[str] organization: The slug of the organization the user should be invited to.
        :param pulumi.Input[str] role: This is the role of the organization member.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] teams: The teams the organization member should be added to.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SentryOrganizationMemberArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_sentry as sentry

        # Create an organization member
        john_doe = sentry.SentryOrganizationMember("john_doe",
            organization="my-organization",
            email="test@example.com",
            role="member",
            teams=["my-team"])
        ```

        ## Import

        import using the organization, membership id from the URL:

        https://sentry.io/settings/[org-slug]/members/[member-id]/

        ```sh
        $ pulumi import sentry:index/sentryOrganizationMember:SentryOrganizationMember john_doe org-slug/member-id
        ```

        :param str resource_name: The name of the resource.
        :param SentryOrganizationMemberArgs 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(SentryOrganizationMemberArgs, 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,
                 email: Optional[pulumi.Input[str]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 role: Optional[pulumi.Input[str]] = None,
                 teams: 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__ = SentryOrganizationMemberArgs.__new__(SentryOrganizationMemberArgs)

            if email is None and not opts.urn:
                raise TypeError("Missing required property 'email'")
            __props__.__dict__["email"] = email
            if organization is None and not opts.urn:
                raise TypeError("Missing required property 'organization'")
            __props__.__dict__["organization"] = organization
            if role is None and not opts.urn:
                raise TypeError("Missing required property 'role'")
            __props__.__dict__["role"] = role
            __props__.__dict__["teams"] = teams
            __props__.__dict__["expired"] = None
            __props__.__dict__["internal_id"] = None
            __props__.__dict__["pending"] = None
        super(SentryOrganizationMember, __self__).__init__(
            'sentry:index/sentryOrganizationMember:SentryOrganizationMember',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            email: Optional[pulumi.Input[str]] = None,
            expired: Optional[pulumi.Input[bool]] = None,
            internal_id: Optional[pulumi.Input[str]] = None,
            organization: Optional[pulumi.Input[str]] = None,
            pending: Optional[pulumi.Input[bool]] = None,
            role: Optional[pulumi.Input[str]] = None,
            teams: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'SentryOrganizationMember':
        """
        Get an existing SentryOrganizationMember 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[str] email: The email of the organization member.
        :param pulumi.Input[bool] expired: The invite has expired.
        :param pulumi.Input[str] internal_id: The internal ID for this organization membership.
        :param pulumi.Input[str] organization: The slug of the organization the user should be invited to.
        :param pulumi.Input[bool] pending: The invite is pending.
        :param pulumi.Input[str] role: This is the role of the organization member.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] teams: The teams the organization member should be added to.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SentryOrganizationMemberState.__new__(_SentryOrganizationMemberState)

        __props__.__dict__["email"] = email
        __props__.__dict__["expired"] = expired
        __props__.__dict__["internal_id"] = internal_id
        __props__.__dict__["organization"] = organization
        __props__.__dict__["pending"] = pending
        __props__.__dict__["role"] = role
        __props__.__dict__["teams"] = teams
        return SentryOrganizationMember(resource_name, opts=opts, __props__=__props__)

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

    @property
    @pulumi.getter
    def expired(self) -> pulumi.Output[bool]:
        """
        The invite has expired.
        """
        return pulumi.get(self, "expired")

    @property
    @pulumi.getter(name="internalId")
    def internal_id(self) -> pulumi.Output[str]:
        """
        The internal ID for this organization membership.
        """
        return pulumi.get(self, "internal_id")

    @property
    @pulumi.getter
    def organization(self) -> pulumi.Output[str]:
        """
        The slug of the organization the user should be invited to.
        """
        return pulumi.get(self, "organization")

    @property
    @pulumi.getter
    def pending(self) -> pulumi.Output[bool]:
        """
        The invite is pending.
        """
        return pulumi.get(self, "pending")

    @property
    @pulumi.getter
    def role(self) -> pulumi.Output[str]:
        """
        This is the role of the organization member.
        """
        return pulumi.get(self, "role")

    @property
    @pulumi.getter
    def teams(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        The teams the organization member should be added to.
        """
        return pulumi.get(self, "teams")

