<filename>sdk/python/pulumi_grafana/organization.py
# 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 Organization(pulumi.CustomResource):
    admin_user: pulumi.Output[str]
    admins: pulumi.Output[list]
    """
    A list of email addresses corresponding to users who
    should be given `admin` access to the organization. Note: users specified
    here must already exist in Grafana unless 'create_users' is set to true.
    """
    create_users: pulumi.Output[bool]
    """
    Whether or not to create Grafana users specified
    in the organization's membership if they don't already exist in Grafana. If
    unspecified, this parameter defaults to `true`, creating placeholder users
    with the `name`, `login`, and `email` set to the email of the user, and a
    random password. Setting this option to `false` will cause an error to be
    thrown for any users that do not already exist in Grafana.
    """
    editors: pulumi.Output[list]
    """
    A list of email addresses corresponding to users who
    should be given `editor` access to the organization. Note: users specified
    here must already exist in Grafana unless 'create_users' is set to true.
    """
    name: pulumi.Output[str]
    """
    The display name for the Grafana organization created.
    """
    org_id: pulumi.Output[float]
    """
    The organization id assigned to this organization by Grafana.
    """
    viewers: pulumi.Output[list]
    """
    A list of email addresses corresponding to users who
    should be given `viewer` access to the organization. Note: users specified
    here must already exist in Grafana unless 'create_users' is set to true.
    """
    def __init__(__self__, resource_name, opts=None, admin_user=None, admins=None, create_users=None, editors=None, name=None, viewers=None, __props__=None, __name__=None, __opts__=None):
        """
        The organization resource allows Grafana organizations and their membership to
        be created and managed.
        
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[list] admins: A list of email addresses corresponding to users who
               should be given `admin` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[bool] create_users: Whether or not to create Grafana users specified
               in the organization's membership if they don't already exist in Grafana. If
               unspecified, this parameter defaults to `true`, creating placeholder users
               with the `name`, `login`, and `email` set to the email of the user, and a
               random password. Setting this option to `false` will cause an error to be
               thrown for any users that do not already exist in Grafana.
        :param pulumi.Input[list] editors: A list of email addresses corresponding to users who
               should be given `editor` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[str] name: The display name for the Grafana organization created.
        :param pulumi.Input[list] viewers: A list of email addresses corresponding to users who
               should be given `viewer` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-grafana/blob/master/website/docs/r/organization.html.markdown.
        """
        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()

            __props__['admin_user'] = admin_user
            __props__['admins'] = admins
            __props__['create_users'] = create_users
            __props__['editors'] = editors
            __props__['name'] = name
            __props__['viewers'] = viewers
            __props__['org_id'] = None
        super(Organization, __self__).__init__(
            'grafana:index/organization:Organization',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, admin_user=None, admins=None, create_users=None, editors=None, name=None, org_id=None, viewers=None):
        """
        Get an existing Organization 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[list] admins: A list of email addresses corresponding to users who
               should be given `admin` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[bool] create_users: Whether or not to create Grafana users specified
               in the organization's membership if they don't already exist in Grafana. If
               unspecified, this parameter defaults to `true`, creating placeholder users
               with the `name`, `login`, and `email` set to the email of the user, and a
               random password. Setting this option to `false` will cause an error to be
               thrown for any users that do not already exist in Grafana.
        :param pulumi.Input[list] editors: A list of email addresses corresponding to users who
               should be given `editor` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[str] name: The display name for the Grafana organization created.
        :param pulumi.Input[float] org_id: The organization id assigned to this organization by Grafana.
        :param pulumi.Input[list] viewers: A list of email addresses corresponding to users who
               should be given `viewer` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-grafana/blob/master/website/docs/r/organization.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["admin_user"] = admin_user
        __props__["admins"] = admins
        __props__["create_users"] = create_users
        __props__["editors"] = editors
        __props__["name"] = name
        __props__["org_id"] = org_id
        __props__["viewers"] = viewers
        return Organization(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


<filename>sdk/python/pulumi_grafana/organization.py
# 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 Organization(pulumi.CustomResource):
    admin_user: pulumi.Output[str]
    admins: pulumi.Output[list]
    """
    A list of email addresses corresponding to users who
    should be given `admin` access to the organization. Note: users specified
    here must already exist in Grafana unless 'create_users' is set to true.
    """
    create_users: pulumi.Output[bool]
    """
    Whether or not to create Grafana users specified
    in the organization's membership if they don't already exist in Grafana. If
    unspecified, this parameter defaults to `true`, creating placeholder users
    with the `name`, `login`, and `email` set to the email of the user, and a
    random password. Setting this option to `false` will cause an error to be
    thrown for any users that do not already exist in Grafana.
    """
    editors: pulumi.Output[list]
    """
    A list of email addresses corresponding to users who
    should be given `editor` access to the organization. Note: users specified
    here must already exist in Grafana unless 'create_users' is set to true.
    """
    name: pulumi.Output[str]
    """
    The display name for the Grafana organization created.
    """
    org_id: pulumi.Output[float]
    """
    The organization id assigned to this organization by Grafana.
    """
    viewers: pulumi.Output[list]
    """
    A list of email addresses corresponding to users who
    should be given `viewer` access to the organization. Note: users specified
    here must already exist in Grafana unless 'create_users' is set to true.
    """
    def __init__(__self__, resource_name, opts=None, admin_user=None, admins=None, create_users=None, editors=None, name=None, viewers=None, __props__=None, __name__=None, __opts__=None):
        """
        The organization resource allows Grafana organizations and their membership to
        be created and managed.
        
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[list] admins: A list of email addresses corresponding to users who
               should be given `admin` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[bool] create_users: Whether or not to create Grafana users specified
               in the organization's membership if they don't already exist in Grafana. If
               unspecified, this parameter defaults to `true`, creating placeholder users
               with the `name`, `login`, and `email` set to the email of the user, and a
               random password. Setting this option to `false` will cause an error to be
               thrown for any users that do not already exist in Grafana.
        :param pulumi.Input[list] editors: A list of email addresses corresponding to users who
               should be given `editor` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[str] name: The display name for the Grafana organization created.
        :param pulumi.Input[list] viewers: A list of email addresses corresponding to users who
               should be given `viewer` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-grafana/blob/master/website/docs/r/organization.html.markdown.
        """
        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()

            __props__['admin_user'] = admin_user
            __props__['admins'] = admins
            __props__['create_users'] = create_users
            __props__['editors'] = editors
            __props__['name'] = name
            __props__['viewers'] = viewers
            __props__['org_id'] = None
        super(Organization, __self__).__init__(
            'grafana:index/organization:Organization',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, admin_user=None, admins=None, create_users=None, editors=None, name=None, org_id=None, viewers=None):
        """
        Get an existing Organization 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[list] admins: A list of email addresses corresponding to users who
               should be given `admin` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[bool] create_users: Whether or not to create Grafana users specified
               in the organization's membership if they don't already exist in Grafana. If
               unspecified, this parameter defaults to `true`, creating placeholder users
               with the `name`, `login`, and `email` set to the email of the user, and a
               random password. Setting this option to `false` will cause an error to be
               thrown for any users that do not already exist in Grafana.
        :param pulumi.Input[list] editors: A list of email addresses corresponding to users who
               should be given `editor` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.
        :param pulumi.Input[str] name: The display name for the Grafana organization created.
        :param pulumi.Input[float] org_id: The organization id assigned to this organization by Grafana.
        :param pulumi.Input[list] viewers: A list of email addresses corresponding to users who
               should be given `viewer` access to the organization. Note: users specified
               here must already exist in Grafana unless 'create_users' is set to true.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-grafana/blob/master/website/docs/r/organization.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["admin_user"] = admin_user
        __props__["admins"] = admins
        __props__["create_users"] = create_users
        __props__["editors"] = editors
        __props__["name"] = name
        __props__["org_id"] = org_id
        __props__["viewers"] = viewers
        return Organization(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! *** A list of email addresses corresponding to users who     should be given `admin` access to the organization. Note: users specified     here must already exist in Grafana unless 'create_users' is set to true. Whether or not to create Grafana users specified     in the organization's membership if they don't already exist in Grafana. If     unspecified, this parameter defaults to `true`, creating placeholder users     with the `name`, `login`, and `email` set to the email of the user, and a     random password. Setting this option to `false` will cause an error to be     thrown for any users that do not already exist in Grafana. A list of email addresses corresponding to users who     should be given `editor` access to the organization. Note: users specified     here must already exist in Grafana unless 'create_users' is set to true. The display name for the Grafana organization created. The organization id assigned to this organization by Grafana. A list of email addresses corresponding to users who     should be given `viewer` access to the organization. Note: users specified     here must already exist in Grafana unless 'create_users' is set to true. The organization resource allows Grafana organizations and their membership to         be created and managed.                  :param str resource_name: The name of the resource.         :param pulumi.ResourceOptions opts: Options for the resource.         :param pulumi.Input[list] admins: A list of email addresses corresponding to users who                should be given `admin` access to the organization. Note: users specified                here must already exist in Grafana unless 'create_users' is set to true.         :param pulumi.Input[bool] create_users: Whether or not to create Grafana users specified                in the organization's membership if they don't already exist in Grafana. If                unspecified, this parameter defaults to `true`, creating placeholder users                with the `name`, `login`, and `email` set to the email of the user, and a                random password. Setting this option to `false` will cause an error to be                thrown for any users that do not already exist in Grafana.         :param pulumi.Input[list] editors: A list of email addresses corresponding to users who                should be given `editor` access to the organization. Note: users specified                here must already exist in Grafana unless 'create_users' is set to true.         :param pulumi.Input[str] name: The display name for the Grafana organization created.         :param pulumi.Input[list] viewers: A list of email addresses corresponding to users who                should be given `viewer` access to the organization. Note: users specified                here must already exist in Grafana unless 'create_users' is set to true.          > This content is derived from https://github.com/terraform-providers/terraform-provider-grafana/blob/master/website/docs/r/organization.html.markdown. Get an existing Organization 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[list] admins: A list of email addresses corresponding to users who                should be given `admin` access to the organization. Note: users specified                here must already exist in Grafana unless 'create_users' is set to true.         :param pulumi.Input[bool] create_users: Whether or not to create Grafana users specified                in the organization's membership if they don't already exist in Grafana. If                unspecified, this parameter defaults to `true`, creating placeholder users                with the `name`, `login`, and `email` set to the email of the user, and a                random password. Setting this option to `false` will cause an error to be                thrown for any users that do not already exist in Grafana.         :param pulumi.Input[list] editors: A list of email addresses corresponding to users who                should be given `editor` access to the organization. Note: users specified                here must already exist in Grafana unless 'create_users' is set to true.         :param pulumi.Input[str] name: The display name for the Grafana organization created.         :param pulumi.Input[float] org_id: The organization id assigned to this organization by Grafana.         :param pulumi.Input[list] viewers: A list of email addresses corresponding to users who                should be given `viewer` access to the organization. Note: users specified                here must already exist in Grafana unless 'create_users' is set to true.          > This content is derived from https://github.com/terraform-providers/terraform-provider-grafana/blob/master/website/docs/r/organization.html.markdown.