# 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__ = ['PageContentArgs', 'PageContent']

@pulumi.input_type
class PageContentArgs:
    def __init__(__self__, *,
                 nodes: pulumi.Input[Sequence[pulumi.Input['NodeContentUpdateArgs']]],
                 page_id: pulumi.Input[_builtins.str]):
        """
        The set of arguments for constructing a PageContent resource.
        :param pulumi.Input[Sequence[pulumi.Input['NodeContentUpdateArgs']]] nodes: List of node content updates to apply. Each update specifies the nodeId (from the page's DOM structure) and the new text content. Node IDs can be retrieved by fetching the page DOM using GET /pages/{page_id}/dom. Only text content in existing nodes can be updated via this resource.
        :param pulumi.Input[_builtins.str] page_id: The Webflow page ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). You can find page IDs using the Pages API list endpoint or in the Webflow designer. This field will be validated before making any API calls.
        """
        pulumi.set(__self__, "nodes", nodes)
        pulumi.set(__self__, "page_id", page_id)

    @_builtins.property
    @pulumi.getter
    def nodes(self) -> pulumi.Input[Sequence[pulumi.Input['NodeContentUpdateArgs']]]:
        """
        List of node content updates to apply. Each update specifies the nodeId (from the page's DOM structure) and the new text content. Node IDs can be retrieved by fetching the page DOM using GET /pages/{page_id}/dom. Only text content in existing nodes can be updated via this resource.
        """
        return pulumi.get(self, "nodes")

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

    @_builtins.property
    @pulumi.getter(name="pageId")
    def page_id(self) -> pulumi.Input[_builtins.str]:
        """
        The Webflow page ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). You can find page IDs using the Pages API list endpoint or in the Webflow designer. This field will be validated before making any API calls.
        """
        return pulumi.get(self, "page_id")

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


@pulumi.type_token("webflow:index:PageContent")
class PageContent(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 nodes: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeContentUpdateArgs', 'NodeContentUpdateArgsDict']]]]] = None,
                 page_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Manages static content (text) for a Webflow page. This resource allows you to update text content within existing DOM nodes on a page. It does NOT manage page structure or layout - only content within existing nodes. To find node IDs, you must first retrieve the page DOM structure using the Webflow API.

        **IMPORTANT LIMITATION:** This resource does NOT support drift detection for content changes. If content is modified outside of Pulumi (via Webflow UI or API), those changes will NOT be detected during 'pulumi refresh' or 'pulumi up'. The resource only verifies that the page still exists. This is due to the complexity of extracting and comparing specific node text from the full DOM structure.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[Union['NodeContentUpdateArgs', 'NodeContentUpdateArgsDict']]]] nodes: List of node content updates to apply. Each update specifies the nodeId (from the page's DOM structure) and the new text content. Node IDs can be retrieved by fetching the page DOM using GET /pages/{page_id}/dom. Only text content in existing nodes can be updated via this resource.
        :param pulumi.Input[_builtins.str] page_id: The Webflow page ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). You can find page IDs using the Pages API list endpoint or in the Webflow designer. This field will be validated before making any API calls.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: PageContentArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages static content (text) for a Webflow page. This resource allows you to update text content within existing DOM nodes on a page. It does NOT manage page structure or layout - only content within existing nodes. To find node IDs, you must first retrieve the page DOM structure using the Webflow API.

        **IMPORTANT LIMITATION:** This resource does NOT support drift detection for content changes. If content is modified outside of Pulumi (via Webflow UI or API), those changes will NOT be detected during 'pulumi refresh' or 'pulumi up'. The resource only verifies that the page still exists. This is due to the complexity of extracting and comparing specific node text from the full DOM structure.

        :param str resource_name: The name of the resource.
        :param PageContentArgs 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(PageContentArgs, 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,
                 nodes: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NodeContentUpdateArgs', 'NodeContentUpdateArgsDict']]]]] = None,
                 page_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__ = PageContentArgs.__new__(PageContentArgs)

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

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

        __props__.__dict__["last_updated"] = None
        __props__.__dict__["nodes"] = None
        __props__.__dict__["page_id"] = None
        return PageContent(resource_name, opts=opts, __props__=__props__)

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

    @_builtins.property
    @pulumi.getter
    def nodes(self) -> pulumi.Output[Sequence['outputs.NodeContentUpdate']]:
        """
        List of node content updates to apply. Each update specifies the nodeId (from the page's DOM structure) and the new text content. Node IDs can be retrieved by fetching the page DOM using GET /pages/{page_id}/dom. Only text content in existing nodes can be updated via this resource.
        """
        return pulumi.get(self, "nodes")

    @_builtins.property
    @pulumi.getter(name="pageId")
    def page_id(self) -> pulumi.Output[_builtins.str]:
        """
        The Webflow page ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). You can find page IDs using the Pages API list endpoint or in the Webflow designer. This field will be validated before making any API calls.
        """
        return pulumi.get(self, "page_id")

