# 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

__all__ = ['EdgeConfigItemArgs', 'EdgeConfigItem']

@pulumi.input_type
class EdgeConfigItemArgs:
    def __init__(__self__, *,
                 edge_config_id: pulumi.Input[_builtins.str],
                 key: pulumi.Input[_builtins.str],
                 team_id: Optional[pulumi.Input[_builtins.str]] = None,
                 value: Optional[pulumi.Input[_builtins.str]] = None,
                 value_json: Optional[Any] = None):
        """
        The set of arguments for constructing a EdgeConfigItem resource.
        :param pulumi.Input[_builtins.str] edge_config_id: The ID of the Edge Config store.
        :param pulumi.Input[_builtins.str] key: The name of the key you want to add to or update within your Edge Config.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        :param pulumi.Input[_builtins.str] value: The value you want to assign to the key when using a string.
        :param Any value_json: Structured JSON value to assign to the key (object/array/number/bool/null).
        """
        pulumi.set(__self__, "edge_config_id", edge_config_id)
        pulumi.set(__self__, "key", key)
        if team_id is not None:
            pulumi.set(__self__, "team_id", team_id)
        if value is not None:
            pulumi.set(__self__, "value", value)
        if value_json is not None:
            pulumi.set(__self__, "value_json", value_json)

    @_builtins.property
    @pulumi.getter(name="edgeConfigId")
    def edge_config_id(self) -> pulumi.Input[_builtins.str]:
        """
        The ID of the Edge Config store.
        """
        return pulumi.get(self, "edge_config_id")

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

    @_builtins.property
    @pulumi.getter
    def key(self) -> pulumi.Input[_builtins.str]:
        """
        The name of the key you want to add to or update within your Edge Config.
        """
        return pulumi.get(self, "key")

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

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        return pulumi.get(self, "team_id")

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

    @_builtins.property
    @pulumi.getter
    def value(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The value you want to assign to the key when using a string.
        """
        return pulumi.get(self, "value")

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

    @_builtins.property
    @pulumi.getter(name="valueJson")
    def value_json(self) -> Optional[Any]:
        """
        Structured JSON value to assign to the key (object/array/number/bool/null).
        """
        return pulumi.get(self, "value_json")

    @value_json.setter
    def value_json(self, value: Optional[Any]):
        pulumi.set(self, "value_json", value)


@pulumi.input_type
class _EdgeConfigItemState:
    def __init__(__self__, *,
                 edge_config_id: Optional[pulumi.Input[_builtins.str]] = None,
                 key: Optional[pulumi.Input[_builtins.str]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None,
                 value: Optional[pulumi.Input[_builtins.str]] = None,
                 value_json: Optional[Any] = None):
        """
        Input properties used for looking up and filtering EdgeConfigItem resources.
        :param pulumi.Input[_builtins.str] edge_config_id: The ID of the Edge Config store.
        :param pulumi.Input[_builtins.str] key: The name of the key you want to add to or update within your Edge Config.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        :param pulumi.Input[_builtins.str] value: The value you want to assign to the key when using a string.
        :param Any value_json: Structured JSON value to assign to the key (object/array/number/bool/null).
        """
        if edge_config_id is not None:
            pulumi.set(__self__, "edge_config_id", edge_config_id)
        if key is not None:
            pulumi.set(__self__, "key", key)
        if team_id is not None:
            pulumi.set(__self__, "team_id", team_id)
        if value is not None:
            pulumi.set(__self__, "value", value)
        if value_json is not None:
            pulumi.set(__self__, "value_json", value_json)

    @_builtins.property
    @pulumi.getter(name="edgeConfigId")
    def edge_config_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the Edge Config store.
        """
        return pulumi.get(self, "edge_config_id")

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

    @_builtins.property
    @pulumi.getter
    def key(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the key you want to add to or update within your Edge Config.
        """
        return pulumi.get(self, "key")

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

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        return pulumi.get(self, "team_id")

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

    @_builtins.property
    @pulumi.getter
    def value(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The value you want to assign to the key when using a string.
        """
        return pulumi.get(self, "value")

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

    @_builtins.property
    @pulumi.getter(name="valueJson")
    def value_json(self) -> Optional[Any]:
        """
        Structured JSON value to assign to the key (object/array/number/bool/null).
        """
        return pulumi.get(self, "value_json")

    @value_json.setter
    def value_json(self, value: Optional[Any]):
        pulumi.set(self, "value_json", value)


@pulumi.type_token("vercel:index/edgeConfigItem:EdgeConfigItem")
class EdgeConfigItem(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 edge_config_id: Optional[pulumi.Input[_builtins.str]] = None,
                 key: Optional[pulumi.Input[_builtins.str]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None,
                 value: Optional[pulumi.Input[_builtins.str]] = None,
                 value_json: Optional[Any] = None,
                 __props__=None):
        """
        Provides an Edge Config Item.

        An Edge Config is a global data store that enables experimentation with feature flags, A/B testing, critical redirects, and more.

        An Edge Config Item is a value within an Edge Config.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_vercel as vercel

        example = vercel.EdgeConfig("example", name="example")
        example_edge_config_item = vercel.EdgeConfigItem("example",
            edge_config_id=example.id,
            key="flags",
            value_json={
                "featureA": True,
                "nested": {
                    "a": 1,
                    "b": [
                        1,
                        2,
                        3,
                    ],
                },
            })
        ```

        ## Import

        If importing into a personal account, or with a team configured on

        the provider, simply use the edge config id and the key of the item to import.

        - edge_config_id can be found by navigating to the Edge Config in the Vercel UI. It should begin with `ecfg_`.

        - key is the key of teh item to import.

        ```sh
        $ pulumi import vercel:index/edgeConfigItem:EdgeConfigItem example ecfg_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/example_key
        ```

        Alternatively, you can import via the team_id, edge_config_id and the key of the item to import.

        - team_id can be found in the team `settings` tab in the Vercel UI.

        - edge_config_id can be found by navigating to the Edge Config in the Vercel UI. It should begin with `ecfg_`.

        - key is the key of the item to import.

        ```sh
        $ pulumi import vercel:index/edgeConfigItem:EdgeConfigItem example team_xxxxxxxxxxxxxxxxxxxxxxxx/ecfg_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/example_key
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] edge_config_id: The ID of the Edge Config store.
        :param pulumi.Input[_builtins.str] key: The name of the key you want to add to or update within your Edge Config.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        :param pulumi.Input[_builtins.str] value: The value you want to assign to the key when using a string.
        :param Any value_json: Structured JSON value to assign to the key (object/array/number/bool/null).
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: EdgeConfigItemArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides an Edge Config Item.

        An Edge Config is a global data store that enables experimentation with feature flags, A/B testing, critical redirects, and more.

        An Edge Config Item is a value within an Edge Config.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_vercel as vercel

        example = vercel.EdgeConfig("example", name="example")
        example_edge_config_item = vercel.EdgeConfigItem("example",
            edge_config_id=example.id,
            key="flags",
            value_json={
                "featureA": True,
                "nested": {
                    "a": 1,
                    "b": [
                        1,
                        2,
                        3,
                    ],
                },
            })
        ```

        ## Import

        If importing into a personal account, or with a team configured on

        the provider, simply use the edge config id and the key of the item to import.

        - edge_config_id can be found by navigating to the Edge Config in the Vercel UI. It should begin with `ecfg_`.

        - key is the key of teh item to import.

        ```sh
        $ pulumi import vercel:index/edgeConfigItem:EdgeConfigItem example ecfg_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/example_key
        ```

        Alternatively, you can import via the team_id, edge_config_id and the key of the item to import.

        - team_id can be found in the team `settings` tab in the Vercel UI.

        - edge_config_id can be found by navigating to the Edge Config in the Vercel UI. It should begin with `ecfg_`.

        - key is the key of the item to import.

        ```sh
        $ pulumi import vercel:index/edgeConfigItem:EdgeConfigItem example team_xxxxxxxxxxxxxxxxxxxxxxxx/ecfg_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/example_key
        ```

        :param str resource_name: The name of the resource.
        :param EdgeConfigItemArgs 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(EdgeConfigItemArgs, 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,
                 edge_config_id: Optional[pulumi.Input[_builtins.str]] = None,
                 key: Optional[pulumi.Input[_builtins.str]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None,
                 value: Optional[pulumi.Input[_builtins.str]] = None,
                 value_json: Optional[Any] = 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__ = EdgeConfigItemArgs.__new__(EdgeConfigItemArgs)

            if edge_config_id is None and not opts.urn:
                raise TypeError("Missing required property 'edge_config_id'")
            __props__.__dict__["edge_config_id"] = edge_config_id
            if key is None and not opts.urn:
                raise TypeError("Missing required property 'key'")
            __props__.__dict__["key"] = key
            __props__.__dict__["team_id"] = team_id
            __props__.__dict__["value"] = value
            __props__.__dict__["value_json"] = value_json
        super(EdgeConfigItem, __self__).__init__(
            'vercel:index/edgeConfigItem:EdgeConfigItem',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            edge_config_id: Optional[pulumi.Input[_builtins.str]] = None,
            key: Optional[pulumi.Input[_builtins.str]] = None,
            team_id: Optional[pulumi.Input[_builtins.str]] = None,
            value: Optional[pulumi.Input[_builtins.str]] = None,
            value_json: Optional[Any] = None) -> 'EdgeConfigItem':
        """
        Get an existing EdgeConfigItem 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] edge_config_id: The ID of the Edge Config store.
        :param pulumi.Input[_builtins.str] key: The name of the key you want to add to or update within your Edge Config.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        :param pulumi.Input[_builtins.str] value: The value you want to assign to the key when using a string.
        :param Any value_json: Structured JSON value to assign to the key (object/array/number/bool/null).
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _EdgeConfigItemState.__new__(_EdgeConfigItemState)

        __props__.__dict__["edge_config_id"] = edge_config_id
        __props__.__dict__["key"] = key
        __props__.__dict__["team_id"] = team_id
        __props__.__dict__["value"] = value
        __props__.__dict__["value_json"] = value_json
        return EdgeConfigItem(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="edgeConfigId")
    def edge_config_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the Edge Config store.
        """
        return pulumi.get(self, "edge_config_id")

    @_builtins.property
    @pulumi.getter
    def key(self) -> pulumi.Output[_builtins.str]:
        """
        The name of the key you want to add to or update within your Edge Config.
        """
        return pulumi.get(self, "key")

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        return pulumi.get(self, "team_id")

    @_builtins.property
    @pulumi.getter
    def value(self) -> pulumi.Output[_builtins.str]:
        """
        The value you want to assign to the key when using a string.
        """
        return pulumi.get(self, "value")

    @_builtins.property
    @pulumi.getter(name="valueJson")
    def value_json(self) -> pulumi.Output[Any]:
        """
        Structured JSON value to assign to the key (object/array/number/bool/null).
        """
        return pulumi.get(self, "value_json")

