# 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
from . import outputs
from ._inputs import *

__all__ = ['OrganizationGroupProjectArgs', 'OrganizationGroupProject']

@pulumi.input_type
class OrganizationGroupProjectArgs:
    def __init__(__self__, *,
                 group_id: pulumi.Input[str],
                 project: pulumi.Input[str],
                 role: pulumi.Input[str],
                 timeouts: Optional[pulumi.Input['OrganizationGroupProjectTimeoutsArgs']] = None):
        """
        The set of arguments for constructing a OrganizationGroupProject resource.
        :param pulumi.Input[str] group_id: The ID of the user group.
        :param pulumi.Input[str] project: The project that the users in the group are members of.
        :param pulumi.Input[str] role: Role assigned to all users in the group for the project.
        """
        pulumi.set(__self__, "group_id", group_id)
        pulumi.set(__self__, "project", project)
        pulumi.set(__self__, "role", role)
        if timeouts is not None:
            pulumi.set(__self__, "timeouts", timeouts)

    @property
    @pulumi.getter(name="groupId")
    def group_id(self) -> pulumi.Input[str]:
        """
        The ID of the user group.
        """
        return pulumi.get(self, "group_id")

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

    @property
    @pulumi.getter
    def project(self) -> pulumi.Input[str]:
        """
        The project that the users in the group are members of.
        """
        return pulumi.get(self, "project")

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

    @property
    @pulumi.getter
    def role(self) -> pulumi.Input[str]:
        """
        Role assigned to all users in the group for the project.
        """
        return pulumi.get(self, "role")

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

    @property
    @pulumi.getter
    def timeouts(self) -> Optional[pulumi.Input['OrganizationGroupProjectTimeoutsArgs']]:
        return pulumi.get(self, "timeouts")

    @timeouts.setter
    def timeouts(self, value: Optional[pulumi.Input['OrganizationGroupProjectTimeoutsArgs']]):
        pulumi.set(self, "timeouts", value)


@pulumi.input_type
class _OrganizationGroupProjectState:
    def __init__(__self__, *,
                 group_id: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 role: Optional[pulumi.Input[str]] = None,
                 timeouts: Optional[pulumi.Input['OrganizationGroupProjectTimeoutsArgs']] = None):
        """
        Input properties used for looking up and filtering OrganizationGroupProject resources.
        :param pulumi.Input[str] group_id: The ID of the user group.
        :param pulumi.Input[str] project: The project that the users in the group are members of.
        :param pulumi.Input[str] role: Role assigned to all users in the group for the project.
        """
        if group_id is not None:
            pulumi.set(__self__, "group_id", group_id)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if role is not None:
            pulumi.set(__self__, "role", role)
        if timeouts is not None:
            pulumi.set(__self__, "timeouts", timeouts)

    @property
    @pulumi.getter(name="groupId")
    def group_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the user group.
        """
        return pulumi.get(self, "group_id")

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

    @property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[str]]:
        """
        The project that the users in the group are members of.
        """
        return pulumi.get(self, "project")

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

    @property
    @pulumi.getter
    def role(self) -> Optional[pulumi.Input[str]]:
        """
        Role assigned to all users in the group for the project.
        """
        return pulumi.get(self, "role")

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

    @property
    @pulumi.getter
    def timeouts(self) -> Optional[pulumi.Input['OrganizationGroupProjectTimeoutsArgs']]:
        return pulumi.get(self, "timeouts")

    @timeouts.setter
    def timeouts(self, value: Optional[pulumi.Input['OrganizationGroupProjectTimeoutsArgs']]):
        pulumi.set(self, "timeouts", value)


class OrganizationGroupProject(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 group_id: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 role: Optional[pulumi.Input[str]] = None,
                 timeouts: Optional[pulumi.Input[pulumi.InputType['OrganizationGroupProjectTimeoutsArgs']]] = None,
                 __props__=None):
        """
        Adds and manages a [group](https://aiven.io/docs/platform/concepts/projects_accounts_access#groups) of users as [members of a project](https://aiven.io/docs/platform/reference/project-member-privileges).

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aiven as aiven

        example_project = aiven.Project("example_project",
            project="example-project",
            parent_id=main["id"])
        example = aiven.OrganizationUserGroup("example",
            description="Example group of users.",
            organization_id=main["id"],
            name="Example group")
        project_admin = aiven.OrganizationUserGroupMember("project_admin",
            group_id=example.group_id,
            organization_id=main["id"],
            user_id="u123a456b7890c")
        example_organization_group_project = aiven.OrganizationGroupProject("example",
            group_id=example.group_id,
            project=example_project_aiven_project["project"],
            role="admin")
        ```

        ## Import

        ```sh
        $ pulumi import aiven:index/organizationGroupProject:OrganizationGroupProject example PROJECT/USER_GROUP_ID
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] group_id: The ID of the user group.
        :param pulumi.Input[str] project: The project that the users in the group are members of.
        :param pulumi.Input[str] role: Role assigned to all users in the group for the project.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: OrganizationGroupProjectArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Adds and manages a [group](https://aiven.io/docs/platform/concepts/projects_accounts_access#groups) of users as [members of a project](https://aiven.io/docs/platform/reference/project-member-privileges).

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aiven as aiven

        example_project = aiven.Project("example_project",
            project="example-project",
            parent_id=main["id"])
        example = aiven.OrganizationUserGroup("example",
            description="Example group of users.",
            organization_id=main["id"],
            name="Example group")
        project_admin = aiven.OrganizationUserGroupMember("project_admin",
            group_id=example.group_id,
            organization_id=main["id"],
            user_id="u123a456b7890c")
        example_organization_group_project = aiven.OrganizationGroupProject("example",
            group_id=example.group_id,
            project=example_project_aiven_project["project"],
            role="admin")
        ```

        ## Import

        ```sh
        $ pulumi import aiven:index/organizationGroupProject:OrganizationGroupProject example PROJECT/USER_GROUP_ID
        ```

        :param str resource_name: The name of the resource.
        :param OrganizationGroupProjectArgs 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(OrganizationGroupProjectArgs, 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,
                 group_id: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 role: Optional[pulumi.Input[str]] = None,
                 timeouts: Optional[pulumi.Input[pulumi.InputType['OrganizationGroupProjectTimeoutsArgs']]] = 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__ = OrganizationGroupProjectArgs.__new__(OrganizationGroupProjectArgs)

            if group_id is None and not opts.urn:
                raise TypeError("Missing required property 'group_id'")
            __props__.__dict__["group_id"] = group_id
            if project is None and not opts.urn:
                raise TypeError("Missing required property 'project'")
            __props__.__dict__["project"] = project
            if role is None and not opts.urn:
                raise TypeError("Missing required property 'role'")
            __props__.__dict__["role"] = role
            __props__.__dict__["timeouts"] = timeouts
        super(OrganizationGroupProject, __self__).__init__(
            'aiven:index/organizationGroupProject:OrganizationGroupProject',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            group_id: Optional[pulumi.Input[str]] = None,
            project: Optional[pulumi.Input[str]] = None,
            role: Optional[pulumi.Input[str]] = None,
            timeouts: Optional[pulumi.Input[pulumi.InputType['OrganizationGroupProjectTimeoutsArgs']]] = None) -> 'OrganizationGroupProject':
        """
        Get an existing OrganizationGroupProject 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] group_id: The ID of the user group.
        :param pulumi.Input[str] project: The project that the users in the group are members of.
        :param pulumi.Input[str] role: Role assigned to all users in the group for the project.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _OrganizationGroupProjectState.__new__(_OrganizationGroupProjectState)

        __props__.__dict__["group_id"] = group_id
        __props__.__dict__["project"] = project
        __props__.__dict__["role"] = role
        __props__.__dict__["timeouts"] = timeouts
        return OrganizationGroupProject(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="groupId")
    def group_id(self) -> pulumi.Output[str]:
        """
        The ID of the user group.
        """
        return pulumi.get(self, "group_id")

    @property
    @pulumi.getter
    def project(self) -> pulumi.Output[str]:
        """
        The project that the users in the group are members of.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter
    def role(self) -> pulumi.Output[str]:
        """
        Role assigned to all users in the group for the project.
        """
        return pulumi.get(self, "role")

    @property
    @pulumi.getter
    def timeouts(self) -> pulumi.Output[Optional['outputs.OrganizationGroupProjectTimeouts']]:
        return pulumi.get(self, "timeouts")

