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


class DataLink(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 context_dashboard_id: Optional[pulumi.Input[str]] = None,
                 property_name: Optional[pulumi.Input[str]] = None,
                 property_value: Optional[pulumi.Input[str]] = None,
                 target_external_urls: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetExternalUrlArgs']]]]] = None,
                 target_signalfx_dashboards: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSignalfxDashboardArgs']]]]] = None,
                 target_splunks: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSplunkArgs']]]]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Manage SignalFx [Data Links](https://docs.signalfx.com/en/latest/managing/data-links.html).

        ## Example Usage

        ```python
        import pulumi
        import pulumi_signalfx as signalfx

        # A global link to SignalFx dashboard.
        my_data_link = signalfx.DataLink("myDataLink",
            property_name="pname",
            property_value="pvalue",
            target_signalfx_dashboards=[signalfx.DataLinkTargetSignalfxDashboardArgs(
                is_default=True,
                name="sfx_dash",
                dashboard_group_id=signalfx_dashboard_group["mydashboardgroup0"]["id"],
                dashboard_id=signalfx_dashboard["mydashboard0"]["id"],
            )])
        # A dashboard-specific link to an external URL
        my_data_link_dash = signalfx.DataLink("myDataLinkDash",
            context_dashboard_id=signalfx_dashboard["mydashboard0"]["id"],
            property_name="pname2",
            property_value="pvalue",
            target_external_urls=[signalfx.DataLinkTargetExternalUrlArgs(
                is_default=False,
                name="ex_url",
                time_format="ISO8601",
                url="https://www.example.com",
                property_key_mapping={
                    "foo": "bar",
                },
            )])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] context_dashboard_id: If provided, scopes this data link to the supplied dashboard id. If omitted then the link will be global.
        :param pulumi.Input[str] property_name: Name (key) of the metadata that's the trigger of a data link. If you specify `property_value`, you must specify `property_name`.
        :param pulumi.Input[str] property_value: Value of the metadata that's the trigger of a data link. If you specify this property, you must also specify `property_name`.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetExternalUrlArgs']]]] target_external_urls: Link to an external URL
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSignalfxDashboardArgs']]]] target_signalfx_dashboards: Link to a SignalFx dashboard
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSplunkArgs']]]] target_splunks: Link to an external URL
        """
        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__['context_dashboard_id'] = context_dashboard_id
            __props__['property_name'] = property_name
            __props__['property_value'] = property_value
            __props__['target_external_urls'] = target_external_urls
            __props__['target_signalfx_dashboards'] = target_signalfx_dashboards
            __props__['target_splunks'] = target_splunks
        super(DataLink, __self__).__init__(
            'signalfx:index/dataLink:DataLink',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            context_dashboard_id: Optional[pulumi.Input[str]] = None,
            property_name: Optional[pulumi.Input[str]] = None,
            property_value: Optional[pulumi.Input[str]] = None,
            target_external_urls: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetExternalUrlArgs']]]]] = None,
            target_signalfx_dashboards: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSignalfxDashboardArgs']]]]] = None,
            target_splunks: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSplunkArgs']]]]] = None) -> 'DataLink':
        """
        Get an existing DataLink 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] context_dashboard_id: If provided, scopes this data link to the supplied dashboard id. If omitted then the link will be global.
        :param pulumi.Input[str] property_name: Name (key) of the metadata that's the trigger of a data link. If you specify `property_value`, you must specify `property_name`.
        :param pulumi.Input[str] property_value: Value of the metadata that's the trigger of a data link. If you specify this property, you must also specify `property_name`.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetExternalUrlArgs']]]] target_external_urls: Link to an external URL
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSignalfxDashboardArgs']]]] target_signalfx_dashboards: Link to a SignalFx dashboard
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['DataLinkTargetSplunkArgs']]]] target_splunks: Link to an external URL
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["context_dashboard_id"] = context_dashboard_id
        __props__["property_name"] = property_name
        __props__["property_value"] = property_value
        __props__["target_external_urls"] = target_external_urls
        __props__["target_signalfx_dashboards"] = target_signalfx_dashboards
        __props__["target_splunks"] = target_splunks
        return DataLink(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="contextDashboardId")
    def context_dashboard_id(self) -> pulumi.Output[Optional[str]]:
        """
        If provided, scopes this data link to the supplied dashboard id. If omitted then the link will be global.
        """
        return pulumi.get(self, "context_dashboard_id")

    @property
    @pulumi.getter(name="propertyName")
    def property_name(self) -> pulumi.Output[Optional[str]]:
        """
        Name (key) of the metadata that's the trigger of a data link. If you specify `property_value`, you must specify `property_name`.
        """
        return pulumi.get(self, "property_name")

    @property
    @pulumi.getter(name="propertyValue")
    def property_value(self) -> pulumi.Output[Optional[str]]:
        """
        Value of the metadata that's the trigger of a data link. If you specify this property, you must also specify `property_name`.
        """
        return pulumi.get(self, "property_value")

    @property
    @pulumi.getter(name="targetExternalUrls")
    def target_external_urls(self) -> pulumi.Output[Optional[List['outputs.DataLinkTargetExternalUrl']]]:
        """
        Link to an external URL
        """
        return pulumi.get(self, "target_external_urls")

    @property
    @pulumi.getter(name="targetSignalfxDashboards")
    def target_signalfx_dashboards(self) -> pulumi.Output[Optional[List['outputs.DataLinkTargetSignalfxDashboard']]]:
        """
        Link to a SignalFx dashboard
        """
        return pulumi.get(self, "target_signalfx_dashboards")

    @property
    @pulumi.getter(name="targetSplunks")
    def target_splunks(self) -> pulumi.Output[Optional[List['outputs.DataLinkTargetSplunk']]]:
        """
        Link to an external URL
        """
        return pulumi.get(self, "target_splunks")

    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

