# 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__ = ['SiteCustomCodeArgs', 'SiteCustomCode']

@pulumi.input_type
class SiteCustomCodeArgs:
    def __init__(__self__, *,
                 scripts: pulumi.Input[Sequence[pulumi.Input['CustomScriptArgsArgs']]],
                 site_id: pulumi.Input[_builtins.str]):
        """
        The set of arguments for constructing a SiteCustomCode resource.
        :param pulumi.Input[Sequence[pulumi.Input['CustomScriptArgsArgs']]] scripts: A list of custom scripts to apply to the site. Each script must be registered to the site first. To remove individual scripts, simply exclude them from this list on the next update. If you have multiple scripts your app manages, ensure they are always included in this list.
        :param pulumi.Input[_builtins.str] site_id: The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        """
        pulumi.set(__self__, "scripts", scripts)
        pulumi.set(__self__, "site_id", site_id)

    @_builtins.property
    @pulumi.getter
    def scripts(self) -> pulumi.Input[Sequence[pulumi.Input['CustomScriptArgsArgs']]]:
        """
        A list of custom scripts to apply to the site. Each script must be registered to the site first. To remove individual scripts, simply exclude them from this list on the next update. If you have multiple scripts your app manages, ensure they are always included in this list.
        """
        return pulumi.get(self, "scripts")

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

    @_builtins.property
    @pulumi.getter(name="siteId")
    def site_id(self) -> pulumi.Input[_builtins.str]:
        """
        The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        """
        return pulumi.get(self, "site_id")

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


@pulumi.type_token("webflow:index:SiteCustomCode")
class SiteCustomCode(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 scripts: Optional[pulumi.Input[Sequence[pulumi.Input[Union['CustomScriptArgsArgs', 'CustomScriptArgsArgsDict']]]]] = None,
                 site_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Manages custom JavaScript code applied to a Webflow site. This resource allows you to apply registered custom scripts to a site and control where they are placed (header or footer). Custom scripts must be registered to the site first via the RegisterScript resource.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[Union['CustomScriptArgsArgs', 'CustomScriptArgsArgsDict']]]] scripts: A list of custom scripts to apply to the site. Each script must be registered to the site first. To remove individual scripts, simply exclude them from this list on the next update. If you have multiple scripts your app manages, ensure they are always included in this list.
        :param pulumi.Input[_builtins.str] site_id: The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SiteCustomCodeArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages custom JavaScript code applied to a Webflow site. This resource allows you to apply registered custom scripts to a site and control where they are placed (header or footer). Custom scripts must be registered to the site first via the RegisterScript resource.

        :param str resource_name: The name of the resource.
        :param SiteCustomCodeArgs 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(SiteCustomCodeArgs, 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,
                 scripts: Optional[pulumi.Input[Sequence[pulumi.Input[Union['CustomScriptArgsArgs', 'CustomScriptArgsArgsDict']]]]] = None,
                 site_id: Optional[pulumi.Input[_builtins.str]] = 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__ = SiteCustomCodeArgs.__new__(SiteCustomCodeArgs)

            if scripts is None and not opts.urn:
                raise TypeError("Missing required property 'scripts'")
            __props__.__dict__["scripts"] = scripts
            if site_id is None and not opts.urn:
                raise TypeError("Missing required property 'site_id'")
            __props__.__dict__["site_id"] = site_id
            __props__.__dict__["created_on"] = None
            __props__.__dict__["last_updated"] = None
        super(SiteCustomCode, __self__).__init__(
            'webflow:index:SiteCustomCode',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None) -> 'SiteCustomCode':
        """
        Get an existing SiteCustomCode 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.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = SiteCustomCodeArgs.__new__(SiteCustomCodeArgs)

        __props__.__dict__["created_on"] = None
        __props__.__dict__["last_updated"] = None
        __props__.__dict__["scripts"] = None
        __props__.__dict__["site_id"] = None
        return SiteCustomCode(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="createdOn")
    def created_on(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the site's custom code was first created (RFC3339 format). This is automatically set when custom code is first applied and is read-only.
        """
        return pulumi.get(self, "created_on")

    @_builtins.property
    @pulumi.getter(name="lastUpdated")
    def last_updated(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the site's custom code was last updated (RFC3339 format). This is automatically set and is read-only.
        """
        return pulumi.get(self, "last_updated")

    @_builtins.property
    @pulumi.getter
    def scripts(self) -> pulumi.Output[Sequence['outputs.CustomScriptArgs']]:
        """
        A list of custom scripts to apply to the site. Each script must be registered to the site first. To remove individual scripts, simply exclude them from this list on the next update. If you have multiple scripts your app manages, ensure they are always included in this list.
        """
        return pulumi.get(self, "scripts")

    @_builtins.property
    @pulumi.getter(name="siteId")
    def site_id(self) -> pulumi.Output[_builtins.str]:
        """
        The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        """
        return pulumi.get(self, "site_id")

