# 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__ = ['SingleValueChart']


class SingleValueChart(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 color_by: Optional[pulumi.Input[str]] = None,
                 color_scales: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartColorScaleArgs']]]]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 is_timestamp_hidden: Optional[pulumi.Input[bool]] = None,
                 max_delay: Optional[pulumi.Input[float]] = None,
                 max_precision: 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,
                 secondary_visualization: Optional[pulumi.Input[str]] = None,
                 show_spark_line: Optional[pulumi.Input[bool]] = None,
                 unit_prefix: Optional[pulumi.Input[str]] = None,
                 viz_options: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartVizOptionArgs']]]]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        This chart type displays a single number in a large font, representing the current value of a single metric on a plot line.

        If the time period is in the past, the number represents the value of the metric near the end of the time period.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_signalfx as signalfx

        mysvchart0 = signalfx.SingleValueChart("mysvchart0",
            color_by="Dimension",
            description="Very cool Single Value Chart",
            is_timestamp_hidden=True,
            max_delay=2,
            max_precision=2,
            program_text=\"\"\"myfilters = filter("cluster_name", "prod") and filter("role", "search")
        data("cpu.total.idle", filter=myfilters).publish()

        \"\"\",
            refresh_interval=1)
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] color_by: Must be `"Dimension"`, `"Scale"` or `"Metric"`. `"Dimension"` by default.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartColorScaleArgs']]]] color_scales: Single color range including both the color to display for that range and the borders of the range. Example: `[{ gt = 60, color = "blue" }, { 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] is_timestamp_hidden: Whether to hide 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] max_precision: The maximum precision to for value displayed.
        :param pulumi.Input[str] name: Name of the chart.
        :param pulumi.Input[str] program_text: Signalflow program text for the chart. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
        :param pulumi.Input[float] refresh_interval: How often (in seconds) to refresh the value.
        :param pulumi.Input[str] secondary_visualization: The type of secondary visualization. Can be `None`, `Radial`, `Linear`, or `Sparkline`. If unset, the SignalFx default is used (`None`).
        :param pulumi.Input[bool] show_spark_line: Whether to show a trend line below the current value. `false` by default.
        :param pulumi.Input[str] unit_prefix: Must be `"Metric"` or `"Binary"`. `"Metric"` by default.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartVizOptionArgs']]]] viz_options: Plot-level customization options, associated with a publish statement.
        """
        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_by'] = color_by
            __props__['color_scales'] = color_scales
            __props__['description'] = description
            __props__['is_timestamp_hidden'] = is_timestamp_hidden
            __props__['max_delay'] = max_delay
            __props__['max_precision'] = max_precision
            __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__['secondary_visualization'] = secondary_visualization
            __props__['show_spark_line'] = show_spark_line
            __props__['unit_prefix'] = unit_prefix
            __props__['viz_options'] = viz_options
            __props__['url'] = None
        super(SingleValueChart, __self__).__init__(
            'signalfx:index/singleValueChart:SingleValueChart',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            color_by: Optional[pulumi.Input[str]] = None,
            color_scales: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartColorScaleArgs']]]]] = None,
            description: Optional[pulumi.Input[str]] = None,
            is_timestamp_hidden: Optional[pulumi.Input[bool]] = None,
            max_delay: Optional[pulumi.Input[float]] = None,
            max_precision: 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,
            secondary_visualization: Optional[pulumi.Input[str]] = None,
            show_spark_line: Optional[pulumi.Input[bool]] = None,
            unit_prefix: Optional[pulumi.Input[str]] = None,
            url: Optional[pulumi.Input[str]] = None,
            viz_options: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartVizOptionArgs']]]]] = None) -> 'SingleValueChart':
        """
        Get an existing SingleValueChart 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] color_by: Must be `"Dimension"`, `"Scale"` or `"Metric"`. `"Dimension"` by default.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartColorScaleArgs']]]] color_scales: Single color range including both the color to display for that range and the borders of the range. Example: `[{ gt = 60, color = "blue" }, { 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] is_timestamp_hidden: Whether to hide 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] max_precision: The maximum precision to for value displayed.
        :param pulumi.Input[str] name: Name of the chart.
        :param pulumi.Input[str] program_text: Signalflow program text for the chart. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
        :param pulumi.Input[float] refresh_interval: How often (in seconds) to refresh the value.
        :param pulumi.Input[str] secondary_visualization: The type of secondary visualization. Can be `None`, `Radial`, `Linear`, or `Sparkline`. If unset, the SignalFx default is used (`None`).
        :param pulumi.Input[bool] show_spark_line: Whether to show a trend line below the current value. `false` by default.
        :param pulumi.Input[str] unit_prefix: Must be `"Metric"` or `"Binary"`. `"Metric"` by default.
        :param pulumi.Input[str] url: The URL of the chart.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['SingleValueChartVizOptionArgs']]]] viz_options: Plot-level customization options, associated with a publish statement.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["color_by"] = color_by
        __props__["color_scales"] = color_scales
        __props__["description"] = description
        __props__["is_timestamp_hidden"] = is_timestamp_hidden
        __props__["max_delay"] = max_delay
        __props__["max_precision"] = max_precision
        __props__["name"] = name
        __props__["program_text"] = program_text
        __props__["refresh_interval"] = refresh_interval
        __props__["secondary_visualization"] = secondary_visualization
        __props__["show_spark_line"] = show_spark_line
        __props__["unit_prefix"] = unit_prefix
        __props__["url"] = url
        __props__["viz_options"] = viz_options
        return SingleValueChart(resource_name, opts=opts, __props__=__props__)

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

    @property
    @pulumi.getter(name="colorScales")
    def color_scales(self) -> pulumi.Output[Optional[List['outputs.SingleValueChartColorScale']]]:
        """
        Single color range including both the color to display for that range and the borders of the range. Example: `[{ gt = 60, color = "blue" }, { 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="isTimestampHidden")
    def is_timestamp_hidden(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether to hide the timestamp in the chart. `false` by default.
        """
        return pulumi.get(self, "is_timestamp_hidden")

    @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="maxPrecision")
    def max_precision(self) -> pulumi.Output[Optional[float]]:
        """
        The maximum precision to for value displayed.
        """
        return pulumi.get(self, "max_precision")

    @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 [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
        """
        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 value.
        """
        return pulumi.get(self, "refresh_interval")

    @property
    @pulumi.getter(name="secondaryVisualization")
    def secondary_visualization(self) -> pulumi.Output[Optional[str]]:
        """
        The type of secondary visualization. Can be `None`, `Radial`, `Linear`, or `Sparkline`. If unset, the SignalFx default is used (`None`).
        """
        return pulumi.get(self, "secondary_visualization")

    @property
    @pulumi.getter(name="showSparkLine")
    def show_spark_line(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether to show a trend line below the current value. `false` by default.
        """
        return pulumi.get(self, "show_spark_line")

    @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")

    @property
    @pulumi.getter(name="vizOptions")
    def viz_options(self) -> pulumi.Output[Optional[List['outputs.SingleValueChartVizOption']]]:
        """
        Plot-level customization options, associated with a publish statement.
        """
        return pulumi.get(self, "viz_options")

    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

