# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
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__ = ['OneDashboardArgs', 'OneDashboard']

@pulumi.input_type
class OneDashboardArgs:
    def __init__(__self__, *,
                 pages: pulumi.Input[Sequence[pulumi.Input['OneDashboardPageArgs']]],
                 account_id: Optional[pulumi.Input[_builtins.str]] = None,
                 description: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 permissions: Optional[pulumi.Input[_builtins.str]] = None,
                 variables: Optional[pulumi.Input[Sequence[pulumi.Input['OneDashboardVariableArgs']]]] = None):
        """
        The set of arguments for constructing a OneDashboard resource.

        :param pulumi.Input[Sequence[pulumi.Input['OneDashboardPageArgs']]] pages: A nested block that describes a page. See Nested page blocks below for details.
        :param pulumi.Input[_builtins.str] account_id: Determines the New Relic account where the dashboard will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[_builtins.str] description: Brief text describing the dashboard.
        :param pulumi.Input[_builtins.str] name: The title of the dashboard.
        :param pulumi.Input[_builtins.str] permissions: Determines who can see the dashboard in an account. Valid values are `private`, `public_read_only`, or `public_read_write`.  Defaults to `public_read_only`.
        :param pulumi.Input[Sequence[pulumi.Input['OneDashboardVariableArgs']]] variables: A nested block that describes a dashboard-local variable. See Nested variable blocks below for details.
        """
        pulumi.set(__self__, "pages", pages)
        if account_id is not None:
            pulumi.set(__self__, "account_id", account_id)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if permissions is not None:
            pulumi.set(__self__, "permissions", permissions)
        if variables is not None:
            pulumi.set(__self__, "variables", variables)

    @_builtins.property
    @pulumi.getter
    def pages(self) -> pulumi.Input[Sequence[pulumi.Input['OneDashboardPageArgs']]]:
        """
        A nested block that describes a page. See Nested page blocks below for details.
        """
        return pulumi.get(self, "pages")

    @pages.setter
    def pages(self, value: pulumi.Input[Sequence[pulumi.Input['OneDashboardPageArgs']]]):
        pulumi.set(self, "pages", value)

    @_builtins.property
    @pulumi.getter(name="accountId")
    def account_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Determines the New Relic account where the dashboard will be created. Defaults to the account associated with the API key used.
        """
        return pulumi.get(self, "account_id")

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

    @_builtins.property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Brief text describing the dashboard.
        """
        return pulumi.get(self, "description")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The title of the dashboard.
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter
    def permissions(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Determines who can see the dashboard in an account. Valid values are `private`, `public_read_only`, or `public_read_write`.  Defaults to `public_read_only`.
        """
        return pulumi.get(self, "permissions")

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

    @_builtins.property
    @pulumi.getter
    def variables(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['OneDashboardVariableArgs']]]]:
        """
        A nested block that describes a dashboard-local variable. See Nested variable blocks below for details.
        """
        return pulumi.get(self, "variables")

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


@pulumi.input_type
class _OneDashboardState:
    def __init__(__self__, *,
                 account_id: Optional[pulumi.Input[_builtins.str]] = None,
                 description: Optional[pulumi.Input[_builtins.str]] = None,
                 guid: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 pages: Optional[pulumi.Input[Sequence[pulumi.Input['OneDashboardPageArgs']]]] = None,
                 permalink: Optional[pulumi.Input[_builtins.str]] = None,
                 permissions: Optional[pulumi.Input[_builtins.str]] = None,
                 variables: Optional[pulumi.Input[Sequence[pulumi.Input['OneDashboardVariableArgs']]]] = None):
        """
        Input properties used for looking up and filtering OneDashboard resources.

        :param pulumi.Input[_builtins.str] account_id: Determines the New Relic account where the dashboard will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[_builtins.str] description: Brief text describing the dashboard.
        :param pulumi.Input[_builtins.str] guid: The unique entity identifier of the dashboard page in New Relic.
        :param pulumi.Input[_builtins.str] name: The title of the dashboard.
        :param pulumi.Input[Sequence[pulumi.Input['OneDashboardPageArgs']]] pages: A nested block that describes a page. See Nested page blocks below for details.
        :param pulumi.Input[_builtins.str] permalink: The URL for viewing the dashboard.
        :param pulumi.Input[_builtins.str] permissions: Determines who can see the dashboard in an account. Valid values are `private`, `public_read_only`, or `public_read_write`.  Defaults to `public_read_only`.
        :param pulumi.Input[Sequence[pulumi.Input['OneDashboardVariableArgs']]] variables: A nested block that describes a dashboard-local variable. See Nested variable blocks below for details.
        """
        if account_id is not None:
            pulumi.set(__self__, "account_id", account_id)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if guid is not None:
            pulumi.set(__self__, "guid", guid)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if pages is not None:
            pulumi.set(__self__, "pages", pages)
        if permalink is not None:
            pulumi.set(__self__, "permalink", permalink)
        if permissions is not None:
            pulumi.set(__self__, "permissions", permissions)
        if variables is not None:
            pulumi.set(__self__, "variables", variables)

    @_builtins.property
    @pulumi.getter(name="accountId")
    def account_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Determines the New Relic account where the dashboard will be created. Defaults to the account associated with the API key used.
        """
        return pulumi.get(self, "account_id")

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

    @_builtins.property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Brief text describing the dashboard.
        """
        return pulumi.get(self, "description")

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

    @_builtins.property
    @pulumi.getter
    def guid(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The unique entity identifier of the dashboard page in New Relic.
        """
        return pulumi.get(self, "guid")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The title of the dashboard.
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter
    def pages(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['OneDashboardPageArgs']]]]:
        """
        A nested block that describes a page. See Nested page blocks below for details.
        """
        return pulumi.get(self, "pages")

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

    @_builtins.property
    @pulumi.getter
    def permalink(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The URL for viewing the dashboard.
        """
        return pulumi.get(self, "permalink")

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

    @_builtins.property
    @pulumi.getter
    def permissions(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Determines who can see the dashboard in an account. Valid values are `private`, `public_read_only`, or `public_read_write`.  Defaults to `public_read_only`.
        """
        return pulumi.get(self, "permissions")

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

    @_builtins.property
    @pulumi.getter
    def variables(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['OneDashboardVariableArgs']]]]:
        """
        A nested block that describes a dashboard-local variable. See Nested variable blocks below for details.
        """
        return pulumi.get(self, "variables")

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


@pulumi.type_token("newrelic:index/oneDashboard:OneDashboard")
class OneDashboard(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 account_id: Optional[pulumi.Input[_builtins.str]] = None,
                 description: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 pages: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardPageArgs', 'OneDashboardPageArgsDict']]]]] = None,
                 permissions: Optional[pulumi.Input[_builtins.str]] = None,
                 variables: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardVariableArgs', 'OneDashboardVariableArgsDict']]]]] = None,
                 __props__=None):
        """
        > **IMPORTANT!**
        When configuring the `OneDashboard` resource, it is important to understand that widgets should ideally be sorted by row and column order to maintain the stability and accuracy of your dashboard setup. If this specified order is not adhered to, it can lead to resource drift, which might result in discrepancies between the intended setup and the actual deployed dashboard.

        ## Example Usage

        ### Create A New Relic One Dashboard

        ```python
        import pulumi
        import json
        import pulumi_newrelic as newrelic

        exampledash = newrelic.OneDashboard("exampledash",
            name="New Relic Terraform Example",
            permissions="public_read_only",
            pages=[{
                "name": "New Relic Terraform Example",
                "widget_tables": [{
                    "title": "List of Transactions",
                    "row": 1,
                    "column": 4,
                    "width": 6,
                    "height": 3,
                    "refresh_rate": "60000",
                    "nrql_queries": [{
                        "query": "FROM Transaction SELECT *",
                    }],
                    "initial_sorting": {
                        "direction": "desc",
                        "name": "timestamp",
                    },
                    "data_formats": [{
                        "name": "duration",
                        "type": "decimal",
                    }],
                }],
                "widget_billboards": [{
                    "title": "Requests per minute",
                    "row": 1,
                    "column": 1,
                    "width": 6,
                    "height": 3,
                    "refresh_rate": "60000",
                    "data_formats": [{
                        "name": "rate",
                        "type": "recent-relative",
                    }],
                    "nrql_queries": [{
                        "query": "FROM Transaction SELECT rate(count(*), 1 minute)",
                    }],
                    "billboard_settings": {
                        "link": {
                            "new_tab": True,
                            "title": "Click to view more details",
                            "url": "https://example.com",
                        },
                        "visual": {
                            "alignment": "inline",
                            "display": "auto",
                        },
                        "grid_options": {
                            "columns": 4,
                            "label": 6,
                            "value": 8,
                        },
                    },
                }],
                "widget_bars": [
                    {
                        "title": "Average transaction duration, by application",
                        "row": 1,
                        "column": 7,
                        "width": 6,
                        "height": 3,
                        "nrql_queries": [{
                            "account_id": "12345",
                            "query": "FROM Transaction SELECT average(duration) FACET appName",
                        }],
                        "linked_entity_guids": ["abc123"],
                    },
                    {
                        "title": "Average transaction duration, by application",
                        "row": 4,
                        "column": 1,
                        "width": 6,
                        "height": 3,
                        "refresh_rate": "300000",
                        "nrql_queries": [{
                            "account_id": "12345",
                            "query": "FROM Transaction SELECT average(duration) FACET appName",
                        }],
                        "filter_current_dashboard": True,
                        "colors": [{
                            "color": "#722727",
                            "series_overrides": [
                                {
                                    "color": "#722322",
                                    "series_name": "Node",
                                },
                                {
                                    "color": "#236f70",
                                    "series_name": "Java",
                                },
                            ],
                        }],
                    },
                ],
                "widget_lines": [
                    {
                        "title": "Average transaction duration and the request per minute, by application",
                        "row": 4,
                        "column": 7,
                        "width": 6,
                        "height": 3,
                        "refresh_rate": "30000",
                        "nrql_queries": [
                            {
                                "account_id": json.dumps([
                                    1234567,
                                    2345671,
                                ]),
                                "query": "FROM Transaction select max(duration) as 'max duration' where httpResponseCode = '504' timeseries since 5 minutes ago",
                            },
                            {
                                "query": "FROM Transaction SELECT rate(count(*), 1 minute)",
                            },
                        ],
                        "legend_enabled": True,
                        "ignore_time_range": False,
                        "y_axis_left_zero": True,
                        "y_axis_left_min": 0,
                        "y_axis_left_max": 1,
                        "tooltip": {
                            "mode": "single",
                        },
                        "y_axis_right": {
                            "y_axis_right_zero": True,
                            "y_axis_right_min": 0,
                            "y_axis_right_max": 300,
                            "y_axis_right_series": [
                                "A",
                                "B",
                            ],
                        },
                        "is_label_visible": True,
                        "thresholds": [
                            {
                                "name": "Duration Threshold",
                                "from_": "1",
                                "to": "2",
                                "severity": "critical",
                            },
                            {
                                "name": "Duration Threshold Two",
                                "from_": "2.1",
                                "to": "3.3",
                                "severity": "warning",
                            },
                        ],
                        "units": [{
                            "unit": "ms",
                            "series_overrides": [{
                                "unit": "ms",
                                "series_name": "max duration",
                            }],
                        }],
                    },
                    {
                        "title": "Overall CPU % Statistics",
                        "row": 1,
                        "column": 5,
                        "height": 3,
                        "width": 4,
                        "nrql_queries": [{
                            "query": "SELECT average(cpuSystemPercent), average(cpuUserPercent), average(cpuIdlePercent), average(cpuIOWaitPercent) FROM SystemSample  SINCE 1 hour ago TIMESERIES\\n",
                        }],
                        "facet_show_other_series": False,
                        "legend_enabled": True,
                        "ignore_time_range": False,
                        "y_axis_left_zero": True,
                        "y_axis_left_min": 0,
                        "y_axis_left_max": 0,
                        "null_values": [{
                            "null_value": "default",
                            "series_overrides": [
                                {
                                    "null_value": "remove",
                                    "series_name": "Avg Cpu User Percent",
                                },
                                {
                                    "null_value": "zero",
                                    "series_name": "Avg Cpu Idle Percent",
                                },
                                {
                                    "null_value": "default",
                                    "series_name": "Avg Cpu IO Wait Percent",
                                },
                                {
                                    "null_value": "preserve",
                                    "series_name": "Avg Cpu System Percent",
                                },
                            ],
                        }],
                    },
                ],
                "widget_markdowns": [{
                    "title": "Dashboard Note",
                    "row": 7,
                    "column": 1,
                    "width": 12,
                    "height": 3,
                    "text": \"\"\"### Helpful Links

        * [New Relic One](https://one.newrelic.com)
        * [Developer Portal](https://developer.newrelic.com)\"\"\",
                }],
            }],
            variables=[{
                "default_values": ["value"],
                "is_multi_selection": True,
                "items": [{
                    "title": "item",
                    "value": "ITEM",
                }],
                "name": "variable",
                "nrql_query": {
                    "account_ids": ["12345"],
                    "query": "FROM Transaction SELECT average(duration) FACET appName",
                },
                "replacement_strategy": "default",
                "title": "title",
                "type": "nrql",
                "options": [{
                    "show_apply_action": True,
                }],
            }])
        ```
        See additional examples.

        ## Additional Examples

        ### Use the New Relic CLI to convert an existing dashboard

        You can use the New Relic CLI to convert an existing dashboard into HCL code for use in Terraform.

        1. [Download and install the New Relic CLI](https://github.com/newrelic/newrelic-cli#installation--upgrades)
        2. [Export the dashboard you want to add to Terraform from the UI](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/dashboards-charts-import-export-data/#dashboards). Copy the JSON from the UI and paste it into a `.json` file.
        3. Convert the `.json` file to HCL using the CLI: `cat dashboard.json | newrelic utils terraform dashboard --label my_dashboard_resource`

        If you encounter any issues converting your dashboard, [please create a ticket on the New Relic CLI Github repository](https://github.com/newrelic/newrelic-cli/issues/new/choose).

        ### Create a two page dashboard

        The example below shows how you can display data for an application from a primary account and an application from a subaccount. In order to create cross-account widgets, you must use an API key from a user with admin permissions in the primary account. Please see the `widget` attribute documentation for more details.

        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        multi_page_dashboard = newrelic.OneDashboard("multi_page_dashboard",
            name="My Multi-page dashboard",
            permissions="private",
            pages=[
                {
                    "name": "My Multi-page dashboard",
                    "widget_bars": [{
                        "title": "foo",
                        "row": 1,
                        "column": 1,
                        "nrql_queries": [{
                            "query": "FROM Transaction SELECT count(*) FACET name",
                        }],
                        "linked_entity_guids": ["abc123"],
                    }],
                },
                {
                    "name": "Multi-query Page",
                    "widget_lines": [{
                        "title": "Comparing throughput cross-account",
                        "row": 1,
                        "column": 1,
                        "width": 12,
                        "nrql_queries": [
                            {
                                "account_id": first_account_id,
                                "query": "FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'First Account Throughput' TIMESERIES",
                            },
                            {
                                "account_id": second_account_id,
                                "query": "FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'Second Account Throughput' TIMESERIES",
                            },
                        ],
                        "y_axis_left_zero": False,
                    }],
                },
            ])
        ```

        ## Import

        New Relic dashboards can be imported using their GUID, e.g.

        ```sh
        $ terraform import newrelic_one_dashboard.my_dashboard <dashboard GUID>
        ```


        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] account_id: Determines the New Relic account where the dashboard will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[_builtins.str] description: Brief text describing the dashboard.
        :param pulumi.Input[_builtins.str] name: The title of the dashboard.
        :param pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardPageArgs', 'OneDashboardPageArgsDict']]]] pages: A nested block that describes a page. See Nested page blocks below for details.
        :param pulumi.Input[_builtins.str] permissions: Determines who can see the dashboard in an account. Valid values are `private`, `public_read_only`, or `public_read_write`.  Defaults to `public_read_only`.
        :param pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardVariableArgs', 'OneDashboardVariableArgsDict']]]] variables: A nested block that describes a dashboard-local variable. See Nested variable blocks below for details.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: OneDashboardArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        > **IMPORTANT!**
        When configuring the `OneDashboard` resource, it is important to understand that widgets should ideally be sorted by row and column order to maintain the stability and accuracy of your dashboard setup. If this specified order is not adhered to, it can lead to resource drift, which might result in discrepancies between the intended setup and the actual deployed dashboard.

        ## Example Usage

        ### Create A New Relic One Dashboard

        ```python
        import pulumi
        import json
        import pulumi_newrelic as newrelic

        exampledash = newrelic.OneDashboard("exampledash",
            name="New Relic Terraform Example",
            permissions="public_read_only",
            pages=[{
                "name": "New Relic Terraform Example",
                "widget_tables": [{
                    "title": "List of Transactions",
                    "row": 1,
                    "column": 4,
                    "width": 6,
                    "height": 3,
                    "refresh_rate": "60000",
                    "nrql_queries": [{
                        "query": "FROM Transaction SELECT *",
                    }],
                    "initial_sorting": {
                        "direction": "desc",
                        "name": "timestamp",
                    },
                    "data_formats": [{
                        "name": "duration",
                        "type": "decimal",
                    }],
                }],
                "widget_billboards": [{
                    "title": "Requests per minute",
                    "row": 1,
                    "column": 1,
                    "width": 6,
                    "height": 3,
                    "refresh_rate": "60000",
                    "data_formats": [{
                        "name": "rate",
                        "type": "recent-relative",
                    }],
                    "nrql_queries": [{
                        "query": "FROM Transaction SELECT rate(count(*), 1 minute)",
                    }],
                    "billboard_settings": {
                        "link": {
                            "new_tab": True,
                            "title": "Click to view more details",
                            "url": "https://example.com",
                        },
                        "visual": {
                            "alignment": "inline",
                            "display": "auto",
                        },
                        "grid_options": {
                            "columns": 4,
                            "label": 6,
                            "value": 8,
                        },
                    },
                }],
                "widget_bars": [
                    {
                        "title": "Average transaction duration, by application",
                        "row": 1,
                        "column": 7,
                        "width": 6,
                        "height": 3,
                        "nrql_queries": [{
                            "account_id": "12345",
                            "query": "FROM Transaction SELECT average(duration) FACET appName",
                        }],
                        "linked_entity_guids": ["abc123"],
                    },
                    {
                        "title": "Average transaction duration, by application",
                        "row": 4,
                        "column": 1,
                        "width": 6,
                        "height": 3,
                        "refresh_rate": "300000",
                        "nrql_queries": [{
                            "account_id": "12345",
                            "query": "FROM Transaction SELECT average(duration) FACET appName",
                        }],
                        "filter_current_dashboard": True,
                        "colors": [{
                            "color": "#722727",
                            "series_overrides": [
                                {
                                    "color": "#722322",
                                    "series_name": "Node",
                                },
                                {
                                    "color": "#236f70",
                                    "series_name": "Java",
                                },
                            ],
                        }],
                    },
                ],
                "widget_lines": [
                    {
                        "title": "Average transaction duration and the request per minute, by application",
                        "row": 4,
                        "column": 7,
                        "width": 6,
                        "height": 3,
                        "refresh_rate": "30000",
                        "nrql_queries": [
                            {
                                "account_id": json.dumps([
                                    1234567,
                                    2345671,
                                ]),
                                "query": "FROM Transaction select max(duration) as 'max duration' where httpResponseCode = '504' timeseries since 5 minutes ago",
                            },
                            {
                                "query": "FROM Transaction SELECT rate(count(*), 1 minute)",
                            },
                        ],
                        "legend_enabled": True,
                        "ignore_time_range": False,
                        "y_axis_left_zero": True,
                        "y_axis_left_min": 0,
                        "y_axis_left_max": 1,
                        "tooltip": {
                            "mode": "single",
                        },
                        "y_axis_right": {
                            "y_axis_right_zero": True,
                            "y_axis_right_min": 0,
                            "y_axis_right_max": 300,
                            "y_axis_right_series": [
                                "A",
                                "B",
                            ],
                        },
                        "is_label_visible": True,
                        "thresholds": [
                            {
                                "name": "Duration Threshold",
                                "from_": "1",
                                "to": "2",
                                "severity": "critical",
                            },
                            {
                                "name": "Duration Threshold Two",
                                "from_": "2.1",
                                "to": "3.3",
                                "severity": "warning",
                            },
                        ],
                        "units": [{
                            "unit": "ms",
                            "series_overrides": [{
                                "unit": "ms",
                                "series_name": "max duration",
                            }],
                        }],
                    },
                    {
                        "title": "Overall CPU % Statistics",
                        "row": 1,
                        "column": 5,
                        "height": 3,
                        "width": 4,
                        "nrql_queries": [{
                            "query": "SELECT average(cpuSystemPercent), average(cpuUserPercent), average(cpuIdlePercent), average(cpuIOWaitPercent) FROM SystemSample  SINCE 1 hour ago TIMESERIES\\n",
                        }],
                        "facet_show_other_series": False,
                        "legend_enabled": True,
                        "ignore_time_range": False,
                        "y_axis_left_zero": True,
                        "y_axis_left_min": 0,
                        "y_axis_left_max": 0,
                        "null_values": [{
                            "null_value": "default",
                            "series_overrides": [
                                {
                                    "null_value": "remove",
                                    "series_name": "Avg Cpu User Percent",
                                },
                                {
                                    "null_value": "zero",
                                    "series_name": "Avg Cpu Idle Percent",
                                },
                                {
                                    "null_value": "default",
                                    "series_name": "Avg Cpu IO Wait Percent",
                                },
                                {
                                    "null_value": "preserve",
                                    "series_name": "Avg Cpu System Percent",
                                },
                            ],
                        }],
                    },
                ],
                "widget_markdowns": [{
                    "title": "Dashboard Note",
                    "row": 7,
                    "column": 1,
                    "width": 12,
                    "height": 3,
                    "text": \"\"\"### Helpful Links

        * [New Relic One](https://one.newrelic.com)
        * [Developer Portal](https://developer.newrelic.com)\"\"\",
                }],
            }],
            variables=[{
                "default_values": ["value"],
                "is_multi_selection": True,
                "items": [{
                    "title": "item",
                    "value": "ITEM",
                }],
                "name": "variable",
                "nrql_query": {
                    "account_ids": ["12345"],
                    "query": "FROM Transaction SELECT average(duration) FACET appName",
                },
                "replacement_strategy": "default",
                "title": "title",
                "type": "nrql",
                "options": [{
                    "show_apply_action": True,
                }],
            }])
        ```
        See additional examples.

        ## Additional Examples

        ### Use the New Relic CLI to convert an existing dashboard

        You can use the New Relic CLI to convert an existing dashboard into HCL code for use in Terraform.

        1. [Download and install the New Relic CLI](https://github.com/newrelic/newrelic-cli#installation--upgrades)
        2. [Export the dashboard you want to add to Terraform from the UI](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/dashboards-charts-import-export-data/#dashboards). Copy the JSON from the UI and paste it into a `.json` file.
        3. Convert the `.json` file to HCL using the CLI: `cat dashboard.json | newrelic utils terraform dashboard --label my_dashboard_resource`

        If you encounter any issues converting your dashboard, [please create a ticket on the New Relic CLI Github repository](https://github.com/newrelic/newrelic-cli/issues/new/choose).

        ### Create a two page dashboard

        The example below shows how you can display data for an application from a primary account and an application from a subaccount. In order to create cross-account widgets, you must use an API key from a user with admin permissions in the primary account. Please see the `widget` attribute documentation for more details.

        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        multi_page_dashboard = newrelic.OneDashboard("multi_page_dashboard",
            name="My Multi-page dashboard",
            permissions="private",
            pages=[
                {
                    "name": "My Multi-page dashboard",
                    "widget_bars": [{
                        "title": "foo",
                        "row": 1,
                        "column": 1,
                        "nrql_queries": [{
                            "query": "FROM Transaction SELECT count(*) FACET name",
                        }],
                        "linked_entity_guids": ["abc123"],
                    }],
                },
                {
                    "name": "Multi-query Page",
                    "widget_lines": [{
                        "title": "Comparing throughput cross-account",
                        "row": 1,
                        "column": 1,
                        "width": 12,
                        "nrql_queries": [
                            {
                                "account_id": first_account_id,
                                "query": "FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'First Account Throughput' TIMESERIES",
                            },
                            {
                                "account_id": second_account_id,
                                "query": "FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'Second Account Throughput' TIMESERIES",
                            },
                        ],
                        "y_axis_left_zero": False,
                    }],
                },
            ])
        ```

        ## Import

        New Relic dashboards can be imported using their GUID, e.g.

        ```sh
        $ terraform import newrelic_one_dashboard.my_dashboard <dashboard GUID>
        ```


        :param str resource_name: The name of the resource.
        :param OneDashboardArgs 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(OneDashboardArgs, 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,
                 account_id: Optional[pulumi.Input[_builtins.str]] = None,
                 description: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 pages: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardPageArgs', 'OneDashboardPageArgsDict']]]]] = None,
                 permissions: Optional[pulumi.Input[_builtins.str]] = None,
                 variables: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardVariableArgs', 'OneDashboardVariableArgsDict']]]]] = 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__ = OneDashboardArgs.__new__(OneDashboardArgs)

            __props__.__dict__["account_id"] = account_id
            __props__.__dict__["description"] = description
            __props__.__dict__["name"] = name
            if pages is None and not opts.urn:
                raise TypeError("Missing required property 'pages'")
            __props__.__dict__["pages"] = pages
            __props__.__dict__["permissions"] = permissions
            __props__.__dict__["variables"] = variables
            __props__.__dict__["guid"] = None
            __props__.__dict__["permalink"] = None
        super(OneDashboard, __self__).__init__(
            'newrelic:index/oneDashboard:OneDashboard',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            account_id: Optional[pulumi.Input[_builtins.str]] = None,
            description: Optional[pulumi.Input[_builtins.str]] = None,
            guid: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            pages: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardPageArgs', 'OneDashboardPageArgsDict']]]]] = None,
            permalink: Optional[pulumi.Input[_builtins.str]] = None,
            permissions: Optional[pulumi.Input[_builtins.str]] = None,
            variables: Optional[pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardVariableArgs', 'OneDashboardVariableArgsDict']]]]] = None) -> 'OneDashboard':
        """
        Get an existing OneDashboard 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[_builtins.str] account_id: Determines the New Relic account where the dashboard will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[_builtins.str] description: Brief text describing the dashboard.
        :param pulumi.Input[_builtins.str] guid: The unique entity identifier of the dashboard page in New Relic.
        :param pulumi.Input[_builtins.str] name: The title of the dashboard.
        :param pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardPageArgs', 'OneDashboardPageArgsDict']]]] pages: A nested block that describes a page. See Nested page blocks below for details.
        :param pulumi.Input[_builtins.str] permalink: The URL for viewing the dashboard.
        :param pulumi.Input[_builtins.str] permissions: Determines who can see the dashboard in an account. Valid values are `private`, `public_read_only`, or `public_read_write`.  Defaults to `public_read_only`.
        :param pulumi.Input[Sequence[pulumi.Input[Union['OneDashboardVariableArgs', 'OneDashboardVariableArgsDict']]]] variables: A nested block that describes a dashboard-local variable. See Nested variable blocks below for details.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _OneDashboardState.__new__(_OneDashboardState)

        __props__.__dict__["account_id"] = account_id
        __props__.__dict__["description"] = description
        __props__.__dict__["guid"] = guid
        __props__.__dict__["name"] = name
        __props__.__dict__["pages"] = pages
        __props__.__dict__["permalink"] = permalink
        __props__.__dict__["permissions"] = permissions
        __props__.__dict__["variables"] = variables
        return OneDashboard(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="accountId")
    def account_id(self) -> pulumi.Output[_builtins.str]:
        """
        Determines the New Relic account where the dashboard will be created. Defaults to the account associated with the API key used.
        """
        return pulumi.get(self, "account_id")

    @_builtins.property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Brief text describing the dashboard.
        """
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter
    def guid(self) -> pulumi.Output[_builtins.str]:
        """
        The unique entity identifier of the dashboard page in New Relic.
        """
        return pulumi.get(self, "guid")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        The title of the dashboard.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def pages(self) -> pulumi.Output[Sequence['outputs.OneDashboardPage']]:
        """
        A nested block that describes a page. See Nested page blocks below for details.
        """
        return pulumi.get(self, "pages")

    @_builtins.property
    @pulumi.getter
    def permalink(self) -> pulumi.Output[_builtins.str]:
        """
        The URL for viewing the dashboard.
        """
        return pulumi.get(self, "permalink")

    @_builtins.property
    @pulumi.getter
    def permissions(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Determines who can see the dashboard in an account. Valid values are `private`, `public_read_only`, or `public_read_write`.  Defaults to `public_read_only`.
        """
        return pulumi.get(self, "permissions")

    @_builtins.property
    @pulumi.getter
    def variables(self) -> pulumi.Output[Optional[Sequence['outputs.OneDashboardVariable']]]:
        """
        A nested block that describes a dashboard-local variable. See Nested variable blocks below for details.
        """
        return pulumi.get(self, "variables")

