# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from . import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['HeatmapChart']


class HeatmapChart(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 color_range: Optional[pulumi.Input[pulumi.InputType['HeatmapChartColorRangeArgs']]] = None,
                 color_scales: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['HeatmapChartColorScaleArgs']]]]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disable_sampling: Optional[pulumi.Input[bool]] = None,
                 group_bies: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 hide_timestamp: Optional[pulumi.Input[bool]] = None,
                 max_delay: Optional[pulumi.Input[float]] = None,
                 minimum_resolution: Optional[pulumi.Input[float]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 program_text: Optional[pulumi.Input[str]] = None,
                 refresh_interval: Optional[pulumi.Input[float]] = None,
                 sort_by: Optional[pulumi.Input[str]] = None,
                 unit_prefix: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        This chart type displays the specified plot in a heatmap fashion. This format is similar to the [Infrastructure Navigator](https://signalfx-product-docs.readthedocs-hosted.com/en/latest/built-in-content/infra-nav.html#infra), with squares representing each source for the selected metric, and the color of each square representing the value range of the metric.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_signalfx as signalfx

        myheatmapchart0 = signalfx.HeatmapChart("myheatmapchart0",
            color_range=signalfx.HeatmapChartColorRangeArgs(
                color="#ff0000",
                max_value=100,
                min_value=0,
            ),
            color_scales=[
                signalfx.HeatmapChartColorScaleArgs(
                    color="green",
                    gte=99,
                ),
                signalfx.HeatmapChartColorScaleArgs(
                    color="yellow",
                    gte=95,
                    lt=99,
                ),
                signalfx.HeatmapChartColorScaleArgs(
                    color="red",
                    lt=95,
                ),
            ],
            description="Very cool Heatmap",
            disable_sampling=True,
            group_bies=[
                "hostname",
                "host",
            ],
            hide_timestamp=True,
            program_text=\"\"\"myfilters = filter("cluster_name", "prod") and filter("role", "search")
        data("cpu.total.idle", filter=myfilters).publish()

        \"\"\",
            sort_by="+host")
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[pulumi.InputType['HeatmapChartColorRangeArgs']] color_range: Values and color for the color range. Example: `color_range : { min : 0, max : 100, color : "#0000ff" }`. Look at this [link](https://docs.signalfx.com/en/latest/charts/chart-options-tab.html).
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['HeatmapChartColorScaleArgs']]]] color_scales: One to N blocks, each defining a single color range including both the color to display for that range and the borders of the range. Example: `color_scale { gt = 60, color = "blue" } color_scale { lte = 60, color = "yellow" }`. Look at this [link](https://docs.signalfx.com/en/latest/charts/chart-options-tab.html).
        :param pulumi.Input[str] description: Description of the chart.
        :param pulumi.Input[bool] disable_sampling: If `false`, samples a subset of the output MTS, which improves UI performance. `false` by default.
        :param pulumi.Input[List[pulumi.Input[str]]] group_bies: Properties to group by in the heatmap (in nesting order).
        :param pulumi.Input[bool] hide_timestamp: Whether to show the timestamp in the chart. `false` by default.
        :param pulumi.Input[float] max_delay: How long (in seconds) to wait for late datapoints.
        :param pulumi.Input[float] minimum_resolution: The minimum resolution (in seconds) to use for computing the underlying program.
        :param pulumi.Input[str] name: Name of the chart.
        :param pulumi.Input[str] program_text: Signalflow program text for the chart. More info at <https://developers.signalfx.com/docs/signalflow-overview>.
        :param pulumi.Input[float] refresh_interval: How often (in seconds) to refresh the values of the heatmap.
        :param pulumi.Input[str] sort_by: The property to use when sorting the elements. Must be prepended with `+` for ascending or `-` for descending (e.g. `-foo`).
        :param pulumi.Input[str] unit_prefix: Must be `"Metric"` or `"Binary`". `"Metric"` by default.
        """
        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__['color_range'] = color_range
            __props__['color_scales'] = color_scales
            __props__['description'] = description
            __props__['disable_sampling'] = disable_sampling
            __props__['group_bies'] = group_bies
            __props__['hide_timestamp'] = hide_timestamp
            __props__['max_delay'] = max_delay
            __props__['minimum_resolution'] = minimum_resolution
            __props__['name'] = name
            if program_text is None:
                raise TypeError("Missing required property 'program_text'")
            __props__['program_text'] = program_text
            __props__['refresh_interval'] = refresh_interval
            __props__['sort_by'] = sort_by
            __props__['unit_prefix'] = unit_prefix
            __props__['url'] = None
        super(HeatmapChart, __self__).__init__(
            'signalfx:index/heatmapChart:HeatmapChart',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            color_range: Optional[pulumi.Input[pulumi.InputType['HeatmapChartColorRangeArgs']]] = None,
            color_scales: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['HeatmapChartColorScaleArgs']]]]] = None,
            description: Optional[pulumi.Input[str]] = None,
            disable_sampling: Optional[pulumi.Input[bool]] = None,
            group_bies: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            hide_timestamp: Optional[pulumi.Input[bool]] = None,
            max_delay: Optional[pulumi.Input[float]] = None,
            minimum_resolution: Optional[pulumi.Input[float]] = None,
            name: Optional[pulumi.Input[str]] = None,
            program_text: Optional[pulumi.Input[str]] = None,
            refresh_interval: Optional[pulumi.Input[float]] = None,
            sort_by: Optional[pulumi.Input[str]] = None,
            unit_prefix: Optional[pulumi.Input[str]] = None,
            url: Optional[pulumi.Input[str]] = None) -> 'HeatmapChart':
        """
        Get an existing HeatmapChart 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[pulumi.InputType['HeatmapChartColorRangeArgs']] color_range: Values and color for the color range. Example: `color_range : { min : 0, max : 100, color : "#0000ff" }`. Look at this [link](https://docs.signalfx.com/en/latest/charts/chart-options-tab.html).
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['HeatmapChartColorScaleArgs']]]] color_scales: One to N blocks, each defining a single color range including both the color to display for that range and the borders of the range. Example: `color_scale { gt = 60, color = "blue" } color_scale { lte = 60, color = "yellow" }`. Look at this [link](https://docs.signalfx.com/en/latest/charts/chart-options-tab.html).
        :param pulumi.Input[str] description: Description of the chart.
        :param pulumi.Input[bool] disable_sampling: If `false`, samples a subset of the output MTS, which improves UI performance. `false` by default.
        :param pulumi.Input[List[pulumi.Input[str]]] group_bies: Properties to group by in the heatmap (in nesting order).
        :param pulumi.Input[bool] hide_timestamp: Whether to show the timestamp in the chart. `false` by default.
        :param pulumi.Input[float] max_delay: How long (in seconds) to wait for late datapoints.
        :param pulumi.Input[float] minimum_resolution: The minimum resolution (in seconds) to use for computing the underlying program.
        :param pulumi.Input[str] name: Name of the chart.
        :param pulumi.Input[str] program_text: Signalflow program text for the chart. More info at <https://developers.signalfx.com/docs/signalflow-overview>.
        :param pulumi.Input[float] refresh_interval: How often (in seconds) to refresh the values of the heatmap.
        :param pulumi.Input[str] sort_by: The property to use when sorting the elements. Must be prepended with `+` for ascending or `-` for descending (e.g. `-foo`).
        :param pulumi.Input[str] unit_prefix: Must be `"Metric"` or `"Binary`". `"Metric"` by default.
        :param pulumi.Input[str] url: The URL of the chart.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["color_range"] = color_range
        __props__["color_scales"] = color_scales
        __props__["description"] = description
        __props__["disable_sampling"] = disable_sampling
        __props__["group_bies"] = group_bies
        __props__["hide_timestamp"] = hide_timestamp
        __props__["max_delay"] = max_delay
        __props__["minimum_resolution"] = minimum_resolution
        __props__["name"] = name
        __props__["program_text"] = program_text
        __props__["refresh_interval"] = refresh_interval
        __props__["sort_by"] = sort_by
        __props__["unit_prefix"] = unit_prefix
        __props__["url"] = url
        return HeatmapChart(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="colorRange")
    def color_range(self) -> pulumi.Output[Optional['outputs.HeatmapChartColorRange']]:
        """
        Values and color for the color range. Example: `color_range : { min : 0, max : 100, color : "#0000ff" }`. Look at this [link](https://docs.signalfx.com/en/latest/charts/chart-options-tab.html).
        """
        return pulumi.get(self, "color_range")

    @property
    @pulumi.getter(name="colorScales")
    def color_scales(self) -> pulumi.Output[Optional[List['outputs.HeatmapChartColorScale']]]:
        """
        One to N blocks, each defining a single color range including both the color to display for that range and the borders of the range. Example: `color_scale { gt = 60, color = "blue" } color_scale { lte = 60, color = "yellow" }`. Look at this [link](https://docs.signalfx.com/en/latest/charts/chart-options-tab.html).
        """
        return pulumi.get(self, "color_scales")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        Description of the chart.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="disableSampling")
    def disable_sampling(self) -> pulumi.Output[Optional[bool]]:
        """
        If `false`, samples a subset of the output MTS, which improves UI performance. `false` by default.
        """
        return pulumi.get(self, "disable_sampling")

    @property
    @pulumi.getter(name="groupBies")
    def group_bies(self) -> pulumi.Output[Optional[List[str]]]:
        """
        Properties to group by in the heatmap (in nesting order).
        """
        return pulumi.get(self, "group_bies")

    @property
    @pulumi.getter(name="hideTimestamp")
    def hide_timestamp(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether to show the timestamp in the chart. `false` by default.
        """
        return pulumi.get(self, "hide_timestamp")

    @property
    @pulumi.getter(name="maxDelay")
    def max_delay(self) -> pulumi.Output[Optional[float]]:
        """
        How long (in seconds) to wait for late datapoints.
        """
        return pulumi.get(self, "max_delay")

    @property
    @pulumi.getter(name="minimumResolution")
    def minimum_resolution(self) -> pulumi.Output[Optional[float]]:
        """
        The minimum resolution (in seconds) to use for computing the underlying program.
        """
        return pulumi.get(self, "minimum_resolution")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Name of the chart.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="programText")
    def program_text(self) -> pulumi.Output[str]:
        """
        Signalflow program text for the chart. More info at <https://developers.signalfx.com/docs/signalflow-overview>.
        """
        return pulumi.get(self, "program_text")

    @property
    @pulumi.getter(name="refreshInterval")
    def refresh_interval(self) -> pulumi.Output[Optional[float]]:
        """
        How often (in seconds) to refresh the values of the heatmap.
        """
        return pulumi.get(self, "refresh_interval")

    @property
    @pulumi.getter(name="sortBy")
    def sort_by(self) -> pulumi.Output[Optional[str]]:
        """
        The property to use when sorting the elements. Must be prepended with `+` for ascending or `-` for descending (e.g. `-foo`).
        """
        return pulumi.get(self, "sort_by")

    @property
    @pulumi.getter(name="unitPrefix")
    def unit_prefix(self) -> pulumi.Output[Optional[str]]:
        """
        Must be `"Metric"` or `"Binary`". `"Metric"` by default.
        """
        return pulumi.get(self, "unit_prefix")

    @property
    @pulumi.getter
    def url(self) -> pulumi.Output[str]:
        """
        The URL of the chart.
        """
        return pulumi.get(self, "url")

    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

