# 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__ = ['InlineScriptArgs', 'InlineScript']

@pulumi.input_type
class InlineScriptArgs:
    def __init__(__self__, *,
                 display_name: pulumi.Input[_builtins.str],
                 site_id: pulumi.Input[_builtins.str],
                 source_code: pulumi.Input[_builtins.str],
                 version: pulumi.Input[_builtins.str],
                 can_copy: Optional[pulumi.Input[_builtins.bool]] = None,
                 integrity_hash: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a InlineScript resource.
        :param pulumi.Input[_builtins.str] display_name: The user-facing name for the script (1-50 alphanumeric characters). This name is used to identify the script in the Webflow interface. Only letters (A-Z, a-z) and numbers (0-9) are allowed. Example valid names: 'CmsSlider', 'AnalyticsScript', 'MyCustomScript123'.
        :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.
        :param pulumi.Input[_builtins.str] source_code: The inline JavaScript code to register, limited to 2000 characters. This code will be directly embedded in your Webflow site. If your script exceeds 2000 characters, consider hosting it externally and using the RegisteredScript resource with a hostedLocation instead.
        :param pulumi.Input[_builtins.str] version: The Semantic Version (SemVer) string for the script (e.g., '1.0.0', '2.3.1'). This helps track different versions of your script. See https://semver.org/ for more information on semantic versioning.
        :param pulumi.Input[_builtins.bool] can_copy: Indicates whether the script can be copied when the site is duplicated. Default: false. When true, the script will be included when creating a copy of the site.
        :param pulumi.Input[_builtins.str] integrity_hash: The Sub-Resource Integrity (SRI) hash for the script (optional). Format: 'sha384-<hash>', 'sha256-<hash>', or 'sha512-<hash>'. SRI hashes help ensure that the script hasn't been modified in transit. You can generate an SRI hash using https://www.srihash.org/
        """
        pulumi.set(__self__, "display_name", display_name)
        pulumi.set(__self__, "site_id", site_id)
        pulumi.set(__self__, "source_code", source_code)
        pulumi.set(__self__, "version", version)
        if can_copy is not None:
            pulumi.set(__self__, "can_copy", can_copy)
        if integrity_hash is not None:
            pulumi.set(__self__, "integrity_hash", integrity_hash)

    @_builtins.property
    @pulumi.getter(name="displayName")
    def display_name(self) -> pulumi.Input[_builtins.str]:
        """
        The user-facing name for the script (1-50 alphanumeric characters). This name is used to identify the script in the Webflow interface. Only letters (A-Z, a-z) and numbers (0-9) are allowed. Example valid names: 'CmsSlider', 'AnalyticsScript', 'MyCustomScript123'.
        """
        return pulumi.get(self, "display_name")

    @display_name.setter
    def display_name(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "display_name", 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)

    @_builtins.property
    @pulumi.getter(name="sourceCode")
    def source_code(self) -> pulumi.Input[_builtins.str]:
        """
        The inline JavaScript code to register, limited to 2000 characters. This code will be directly embedded in your Webflow site. If your script exceeds 2000 characters, consider hosting it externally and using the RegisteredScript resource with a hostedLocation instead.
        """
        return pulumi.get(self, "source_code")

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

    @_builtins.property
    @pulumi.getter
    def version(self) -> pulumi.Input[_builtins.str]:
        """
        The Semantic Version (SemVer) string for the script (e.g., '1.0.0', '2.3.1'). This helps track different versions of your script. See https://semver.org/ for more information on semantic versioning.
        """
        return pulumi.get(self, "version")

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

    @_builtins.property
    @pulumi.getter(name="canCopy")
    def can_copy(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Indicates whether the script can be copied when the site is duplicated. Default: false. When true, the script will be included when creating a copy of the site.
        """
        return pulumi.get(self, "can_copy")

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

    @_builtins.property
    @pulumi.getter(name="integrityHash")
    def integrity_hash(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The Sub-Resource Integrity (SRI) hash for the script (optional). Format: 'sha384-<hash>', 'sha256-<hash>', or 'sha512-<hash>'. SRI hashes help ensure that the script hasn't been modified in transit. You can generate an SRI hash using https://www.srihash.org/
        """
        return pulumi.get(self, "integrity_hash")

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


@pulumi.type_token("webflow:index:InlineScript")
class InlineScript(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 can_copy: Optional[pulumi.Input[_builtins.bool]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 integrity_hash: Optional[pulumi.Input[_builtins.str]] = None,
                 site_id: Optional[pulumi.Input[_builtins.str]] = None,
                 source_code: Optional[pulumi.Input[_builtins.str]] = None,
                 version: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Manages inline custom code scripts in the Webflow script registry. This resource allows you to register and manage inline JavaScript code that can be deployed across your Webflow site with version control.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] can_copy: Indicates whether the script can be copied when the site is duplicated. Default: false. When true, the script will be included when creating a copy of the site.
        :param pulumi.Input[_builtins.str] display_name: The user-facing name for the script (1-50 alphanumeric characters). This name is used to identify the script in the Webflow interface. Only letters (A-Z, a-z) and numbers (0-9) are allowed. Example valid names: 'CmsSlider', 'AnalyticsScript', 'MyCustomScript123'.
        :param pulumi.Input[_builtins.str] integrity_hash: The Sub-Resource Integrity (SRI) hash for the script (optional). Format: 'sha384-<hash>', 'sha256-<hash>', or 'sha512-<hash>'. SRI hashes help ensure that the script hasn't been modified in transit. You can generate an SRI hash using https://www.srihash.org/
        :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.
        :param pulumi.Input[_builtins.str] source_code: The inline JavaScript code to register, limited to 2000 characters. This code will be directly embedded in your Webflow site. If your script exceeds 2000 characters, consider hosting it externally and using the RegisteredScript resource with a hostedLocation instead.
        :param pulumi.Input[_builtins.str] version: The Semantic Version (SemVer) string for the script (e.g., '1.0.0', '2.3.1'). This helps track different versions of your script. See https://semver.org/ for more information on semantic versioning.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: InlineScriptArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages inline custom code scripts in the Webflow script registry. This resource allows you to register and manage inline JavaScript code that can be deployed across your Webflow site with version control.

        :param str resource_name: The name of the resource.
        :param InlineScriptArgs 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(InlineScriptArgs, 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,
                 can_copy: Optional[pulumi.Input[_builtins.bool]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 integrity_hash: Optional[pulumi.Input[_builtins.str]] = None,
                 site_id: Optional[pulumi.Input[_builtins.str]] = None,
                 source_code: Optional[pulumi.Input[_builtins.str]] = None,
                 version: 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__ = InlineScriptArgs.__new__(InlineScriptArgs)

            __props__.__dict__["can_copy"] = can_copy
            if display_name is None and not opts.urn:
                raise TypeError("Missing required property 'display_name'")
            __props__.__dict__["display_name"] = display_name
            __props__.__dict__["integrity_hash"] = integrity_hash
            if site_id is None and not opts.urn:
                raise TypeError("Missing required property 'site_id'")
            __props__.__dict__["site_id"] = site_id
            if source_code is None and not opts.urn:
                raise TypeError("Missing required property 'source_code'")
            __props__.__dict__["source_code"] = source_code
            if version is None and not opts.urn:
                raise TypeError("Missing required property 'version'")
            __props__.__dict__["version"] = version
            __props__.__dict__["created_on"] = None
            __props__.__dict__["hosted_location"] = None
            __props__.__dict__["last_updated"] = None
            __props__.__dict__["script_id"] = None
        super(InlineScript, __self__).__init__(
            'webflow:index:InlineScript',
            resource_name,
            __props__,
            opts)

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

        __props__.__dict__["can_copy"] = None
        __props__.__dict__["created_on"] = None
        __props__.__dict__["display_name"] = None
        __props__.__dict__["hosted_location"] = None
        __props__.__dict__["integrity_hash"] = None
        __props__.__dict__["last_updated"] = None
        __props__.__dict__["script_id"] = None
        __props__.__dict__["site_id"] = None
        __props__.__dict__["source_code"] = None
        __props__.__dict__["version"] = None
        return InlineScript(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="canCopy")
    def can_copy(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Indicates whether the script can be copied when the site is duplicated. Default: false. When true, the script will be included when creating a copy of the site.
        """
        return pulumi.get(self, "can_copy")

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

    @_builtins.property
    @pulumi.getter(name="displayName")
    def display_name(self) -> pulumi.Output[_builtins.str]:
        """
        The user-facing name for the script (1-50 alphanumeric characters). This name is used to identify the script in the Webflow interface. Only letters (A-Z, a-z) and numbers (0-9) are allowed. Example valid names: 'CmsSlider', 'AnalyticsScript', 'MyCustomScript123'.
        """
        return pulumi.get(self, "display_name")

    @_builtins.property
    @pulumi.getter(name="hostedLocation")
    def hosted_location(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The URI for the hosted version of the inline script (read-only). This is automatically set by Webflow after the inline script is registered.
        """
        return pulumi.get(self, "hosted_location")

    @_builtins.property
    @pulumi.getter(name="integrityHash")
    def integrity_hash(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The Sub-Resource Integrity (SRI) hash for the script (optional). Format: 'sha384-<hash>', 'sha256-<hash>', or 'sha512-<hash>'. SRI hashes help ensure that the script hasn't been modified in transit. You can generate an SRI hash using https://www.srihash.org/
        """
        return pulumi.get(self, "integrity_hash")

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

    @_builtins.property
    @pulumi.getter(name="scriptId")
    def script_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The Webflow-assigned script ID (read-only). This is typically the lowercase version of displayName. Use this value when referencing the script in SiteCustomCode or PageCustomCode resources.
        """
        return pulumi.get(self, "script_id")

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

    @_builtins.property
    @pulumi.getter(name="sourceCode")
    def source_code(self) -> pulumi.Output[_builtins.str]:
        """
        The inline JavaScript code to register, limited to 2000 characters. This code will be directly embedded in your Webflow site. If your script exceeds 2000 characters, consider hosting it externally and using the RegisteredScript resource with a hostedLocation instead.
        """
        return pulumi.get(self, "source_code")

    @_builtins.property
    @pulumi.getter
    def version(self) -> pulumi.Output[_builtins.str]:
        """
        The Semantic Version (SemVer) string for the script (e.g., '1.0.0', '2.3.1'). This helps track different versions of your script. See https://semver.org/ for more information on semantic versioning.
        """
        return pulumi.get(self, "version")

