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

__all__ = ['OrganizationProjectArgs', 'OrganizationProject']

@pulumi.input_type
class OrganizationProjectArgs:
    def __init__(__self__, *,
                 billing_group_id: pulumi.Input[str],
                 organization_id: pulumi.Input[str],
                 project_id: pulumi.Input[str],
                 parent_id: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]]] = None,
                 technical_emails: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        The set of arguments for constructing a OrganizationProject resource.
        :param pulumi.Input[str] billing_group_id: Billing group ID to assign to the project.
        :param pulumi.Input[str] organization_id: ID of an organization. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] project_id: Unique identifier for the project that also serves as the project name.
        :param pulumi.Input[str] parent_id: Link a project to an [organization or organizational unit](https://aiven.io/docs/platform/concepts/orgs-units-projects) by using its ID. To set up proper dependencies please refer to this variable as a reference.
        :param pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]] tags: Tags are key-value pairs that allow you to categorize projects.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] technical_emails: The email addresses for [project contacts](https://aiven.io/docs/platform/howto/technical-emails), who will receive important alerts and updates about this project and its services. You can also set email contacts at the service level. It's good practice to keep these up-to-date to be aware of any potential issues with your project.
        """
        pulumi.set(__self__, "billing_group_id", billing_group_id)
        pulumi.set(__self__, "organization_id", organization_id)
        pulumi.set(__self__, "project_id", project_id)
        if parent_id is not None:
            pulumi.set(__self__, "parent_id", parent_id)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if technical_emails is not None:
            pulumi.set(__self__, "technical_emails", technical_emails)

    @property
    @pulumi.getter(name="billingGroupId")
    def billing_group_id(self) -> pulumi.Input[str]:
        """
        Billing group ID to assign to the project.
        """
        return pulumi.get(self, "billing_group_id")

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

    @property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> pulumi.Input[str]:
        """
        ID of an organization. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "organization_id")

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

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Input[str]:
        """
        Unique identifier for the project that also serves as the project name.
        """
        return pulumi.get(self, "project_id")

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

    @property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> Optional[pulumi.Input[str]]:
        """
        Link a project to an [organization or organizational unit](https://aiven.io/docs/platform/concepts/orgs-units-projects) by using its ID. To set up proper dependencies please refer to this variable as a reference.
        """
        return pulumi.get(self, "parent_id")

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

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]]]:
        """
        Tags are key-value pairs that allow you to categorize projects.
        """
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]]]):
        pulumi.set(self, "tags", value)

    @property
    @pulumi.getter(name="technicalEmails")
    def technical_emails(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The email addresses for [project contacts](https://aiven.io/docs/platform/howto/technical-emails), who will receive important alerts and updates about this project and its services. You can also set email contacts at the service level. It's good practice to keep these up-to-date to be aware of any potential issues with your project.
        """
        return pulumi.get(self, "technical_emails")

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


@pulumi.input_type
class _OrganizationProjectState:
    def __init__(__self__, *,
                 billing_group_id: Optional[pulumi.Input[str]] = None,
                 organization_id: Optional[pulumi.Input[str]] = None,
                 parent_id: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]]] = None,
                 technical_emails: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        Input properties used for looking up and filtering OrganizationProject resources.
        :param pulumi.Input[str] billing_group_id: Billing group ID to assign to the project.
        :param pulumi.Input[str] organization_id: ID of an organization. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] parent_id: Link a project to an [organization or organizational unit](https://aiven.io/docs/platform/concepts/orgs-units-projects) by using its ID. To set up proper dependencies please refer to this variable as a reference.
        :param pulumi.Input[str] project_id: Unique identifier for the project that also serves as the project name.
        :param pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]] tags: Tags are key-value pairs that allow you to categorize projects.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] technical_emails: The email addresses for [project contacts](https://aiven.io/docs/platform/howto/technical-emails), who will receive important alerts and updates about this project and its services. You can also set email contacts at the service level. It's good practice to keep these up-to-date to be aware of any potential issues with your project.
        """
        if billing_group_id is not None:
            pulumi.set(__self__, "billing_group_id", billing_group_id)
        if organization_id is not None:
            pulumi.set(__self__, "organization_id", organization_id)
        if parent_id is not None:
            pulumi.set(__self__, "parent_id", parent_id)
        if project_id is not None:
            pulumi.set(__self__, "project_id", project_id)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if technical_emails is not None:
            pulumi.set(__self__, "technical_emails", technical_emails)

    @property
    @pulumi.getter(name="billingGroupId")
    def billing_group_id(self) -> Optional[pulumi.Input[str]]:
        """
        Billing group ID to assign to the project.
        """
        return pulumi.get(self, "billing_group_id")

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

    @property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> Optional[pulumi.Input[str]]:
        """
        ID of an organization. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "organization_id")

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

    @property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> Optional[pulumi.Input[str]]:
        """
        Link a project to an [organization or organizational unit](https://aiven.io/docs/platform/concepts/orgs-units-projects) by using its ID. To set up proper dependencies please refer to this variable as a reference.
        """
        return pulumi.get(self, "parent_id")

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

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[pulumi.Input[str]]:
        """
        Unique identifier for the project that also serves as the project name.
        """
        return pulumi.get(self, "project_id")

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

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]]]:
        """
        Tags are key-value pairs that allow you to categorize projects.
        """
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['OrganizationProjectTagArgs']]]]):
        pulumi.set(self, "tags", value)

    @property
    @pulumi.getter(name="technicalEmails")
    def technical_emails(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The email addresses for [project contacts](https://aiven.io/docs/platform/howto/technical-emails), who will receive important alerts and updates about this project and its services. You can also set email contacts at the service level. It's good practice to keep these up-to-date to be aware of any potential issues with your project.
        """
        return pulumi.get(self, "technical_emails")

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


class OrganizationProject(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 billing_group_id: Optional[pulumi.Input[str]] = None,
                 organization_id: Optional[pulumi.Input[str]] = None,
                 parent_id: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OrganizationProjectTagArgs', 'OrganizationProjectTagArgsDict']]]]] = None,
                 technical_emails: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 __props__=None):
        """
        Creates and manages an [Aiven project](https://aiven.io/docs/platform/concepts/orgs-units-projects#projects).

        **This resource is in the beta stage and may change without notice.** Set
        the `PROVIDER_AIVEN_ENABLE_BETA` environment variable to use the resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aiven as aiven

        foo = aiven.OrganizationProject("foo",
            project_id="example-project",
            organization_id=foo_aiven_organization["id"],
            billing_group_id=foo_aiven_billing_group["id"],
            tags=[{
                "key": "key_1",
                "value": "value_1",
            }])
        ```

        ## Import

        ```sh
        $ pulumi import aiven:index/organizationProject:OrganizationProject main ORGANIZATION_ID/PROJECT_ID
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] billing_group_id: Billing group ID to assign to the project.
        :param pulumi.Input[str] organization_id: ID of an organization. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] parent_id: Link a project to an [organization or organizational unit](https://aiven.io/docs/platform/concepts/orgs-units-projects) by using its ID. To set up proper dependencies please refer to this variable as a reference.
        :param pulumi.Input[str] project_id: Unique identifier for the project that also serves as the project name.
        :param pulumi.Input[Sequence[pulumi.Input[Union['OrganizationProjectTagArgs', 'OrganizationProjectTagArgsDict']]]] tags: Tags are key-value pairs that allow you to categorize projects.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] technical_emails: The email addresses for [project contacts](https://aiven.io/docs/platform/howto/technical-emails), who will receive important alerts and updates about this project and its services. You can also set email contacts at the service level. It's good practice to keep these up-to-date to be aware of any potential issues with your project.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: OrganizationProjectArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Creates and manages an [Aiven project](https://aiven.io/docs/platform/concepts/orgs-units-projects#projects).

        **This resource is in the beta stage and may change without notice.** Set
        the `PROVIDER_AIVEN_ENABLE_BETA` environment variable to use the resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aiven as aiven

        foo = aiven.OrganizationProject("foo",
            project_id="example-project",
            organization_id=foo_aiven_organization["id"],
            billing_group_id=foo_aiven_billing_group["id"],
            tags=[{
                "key": "key_1",
                "value": "value_1",
            }])
        ```

        ## Import

        ```sh
        $ pulumi import aiven:index/organizationProject:OrganizationProject main ORGANIZATION_ID/PROJECT_ID
        ```

        :param str resource_name: The name of the resource.
        :param OrganizationProjectArgs 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(OrganizationProjectArgs, 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,
                 billing_group_id: Optional[pulumi.Input[str]] = None,
                 organization_id: Optional[pulumi.Input[str]] = None,
                 parent_id: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OrganizationProjectTagArgs', 'OrganizationProjectTagArgsDict']]]]] = None,
                 technical_emails: 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__ = OrganizationProjectArgs.__new__(OrganizationProjectArgs)

            if billing_group_id is None and not opts.urn:
                raise TypeError("Missing required property 'billing_group_id'")
            __props__.__dict__["billing_group_id"] = billing_group_id
            if organization_id is None and not opts.urn:
                raise TypeError("Missing required property 'organization_id'")
            __props__.__dict__["organization_id"] = organization_id
            __props__.__dict__["parent_id"] = parent_id
            if project_id is None and not opts.urn:
                raise TypeError("Missing required property 'project_id'")
            __props__.__dict__["project_id"] = project_id
            __props__.__dict__["tags"] = tags
            __props__.__dict__["technical_emails"] = technical_emails
        super(OrganizationProject, __self__).__init__(
            'aiven:index/organizationProject:OrganizationProject',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            billing_group_id: Optional[pulumi.Input[str]] = None,
            organization_id: Optional[pulumi.Input[str]] = None,
            parent_id: Optional[pulumi.Input[str]] = None,
            project_id: Optional[pulumi.Input[str]] = None,
            tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OrganizationProjectTagArgs', 'OrganizationProjectTagArgsDict']]]]] = None,
            technical_emails: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'OrganizationProject':
        """
        Get an existing OrganizationProject 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] billing_group_id: Billing group ID to assign to the project.
        :param pulumi.Input[str] organization_id: ID of an organization. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] parent_id: Link a project to an [organization or organizational unit](https://aiven.io/docs/platform/concepts/orgs-units-projects) by using its ID. To set up proper dependencies please refer to this variable as a reference.
        :param pulumi.Input[str] project_id: Unique identifier for the project that also serves as the project name.
        :param pulumi.Input[Sequence[pulumi.Input[Union['OrganizationProjectTagArgs', 'OrganizationProjectTagArgsDict']]]] tags: Tags are key-value pairs that allow you to categorize projects.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] technical_emails: The email addresses for [project contacts](https://aiven.io/docs/platform/howto/technical-emails), who will receive important alerts and updates about this project and its services. You can also set email contacts at the service level. It's good practice to keep these up-to-date to be aware of any potential issues with your project.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _OrganizationProjectState.__new__(_OrganizationProjectState)

        __props__.__dict__["billing_group_id"] = billing_group_id
        __props__.__dict__["organization_id"] = organization_id
        __props__.__dict__["parent_id"] = parent_id
        __props__.__dict__["project_id"] = project_id
        __props__.__dict__["tags"] = tags
        __props__.__dict__["technical_emails"] = technical_emails
        return OrganizationProject(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="billingGroupId")
    def billing_group_id(self) -> pulumi.Output[str]:
        """
        Billing group ID to assign to the project.
        """
        return pulumi.get(self, "billing_group_id")

    @property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> pulumi.Output[str]:
        """
        ID of an organization. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "organization_id")

    @property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> pulumi.Output[str]:
        """
        Link a project to an [organization or organizational unit](https://aiven.io/docs/platform/concepts/orgs-units-projects) by using its ID. To set up proper dependencies please refer to this variable as a reference.
        """
        return pulumi.get(self, "parent_id")

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Output[str]:
        """
        Unique identifier for the project that also serves as the project name.
        """
        return pulumi.get(self, "project_id")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Sequence['outputs.OrganizationProjectTag']]]:
        """
        Tags are key-value pairs that allow you to categorize projects.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="technicalEmails")
    def technical_emails(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        The email addresses for [project contacts](https://aiven.io/docs/platform/howto/technical-emails), who will receive important alerts and updates about this project and its services. You can also set email contacts at the service level. It's good practice to keep these up-to-date to be aware of any potential issues with your project.
        """
        return pulumi.get(self, "technical_emails")

