# 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

__all__ = ['PageDataArgs', 'PageData']

@pulumi.input_type
class PageDataArgs:
    def __init__(__self__, *,
                 site_id: pulumi.Input[_builtins.str],
                 page_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a PageData resource.
        :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] page_id: The specific page ID to retrieve (optional, 24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). If specified, only this page's data will be returned. If omitted, all pages for the site will be returned in the 'pages' output.
        """
        pulumi.set(__self__, "site_id", site_id)
        if page_id is not None:
            pulumi.set(__self__, "page_id", page_id)

    @_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="pageId")
    def page_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The specific page ID to retrieve (optional, 24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). If specified, only this page's data will be returned. If omitted, all pages for the site will be returned in the 'pages' output.
        """
        return pulumi.get(self, "page_id")

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


@pulumi.type_token("webflow:index:PageData")
class PageData(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 page_id: Optional[pulumi.Input[_builtins.str]] = None,
                 site_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Reads page information from a Webflow site. Pages cannot be created via the API - they must be created in the Webflow designer. Use this data source to retrieve page metadata for use in your infrastructure code. Specify pageId to get a single page, or omit it to list all pages in the site.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] page_id: The specific page ID to retrieve (optional, 24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). If specified, only this page's data will be returned. If omitted, all pages for the site will be returned in the 'pages' output.
        :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: PageDataArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Reads page information from a Webflow site. Pages cannot be created via the API - they must be created in the Webflow designer. Use this data source to retrieve page metadata for use in your infrastructure code. Specify pageId to get a single page, or omit it to list all pages in the site.

        :param str resource_name: The name of the resource.
        :param PageDataArgs 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(PageDataArgs, 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,
                 page_id: Optional[pulumi.Input[_builtins.str]] = 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__ = PageDataArgs.__new__(PageDataArgs)

            __props__.__dict__["page_id"] = page_id
            if site_id is None and not opts.urn:
                raise TypeError("Missing required property 'site_id'")
            __props__.__dict__["site_id"] = site_id
            __props__.__dict__["archived"] = None
            __props__.__dict__["collection_id"] = None
            __props__.__dict__["created_on"] = None
            __props__.__dict__["draft"] = None
            __props__.__dict__["last_updated"] = None
            __props__.__dict__["pages"] = None
            __props__.__dict__["parent_id"] = None
            __props__.__dict__["slug"] = None
            __props__.__dict__["title"] = None
            __props__.__dict__["webflow_page_id"] = None
        super(PageData, __self__).__init__(
            'webflow:index:PageData',
            resource_name,
            __props__,
            opts)

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

        __props__.__dict__["archived"] = None
        __props__.__dict__["collection_id"] = None
        __props__.__dict__["created_on"] = None
        __props__.__dict__["draft"] = None
        __props__.__dict__["last_updated"] = None
        __props__.__dict__["page_id"] = None
        __props__.__dict__["pages"] = None
        __props__.__dict__["parent_id"] = None
        __props__.__dict__["site_id"] = None
        __props__.__dict__["slug"] = None
        __props__.__dict__["title"] = None
        __props__.__dict__["webflow_page_id"] = None
        return PageData(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def archived(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Indicates if the page is archived (read-only). Only populated when pageId input is specified.
        """
        return pulumi.get(self, "archived")

    @_builtins.property
    @pulumi.getter(name="collectionId")
    def collection_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The ID of the CMS collection (read-only, optional). Only present for collection pages. Only populated when pageId input is specified.
        """
        return pulumi.get(self, "collection_id")

    @_builtins.property
    @pulumi.getter(name="createdOn")
    def created_on(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the page was created (read-only, RFC3339 format). Only populated when pageId input is specified.
        """
        return pulumi.get(self, "created_on")

    @_builtins.property
    @pulumi.getter
    def draft(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Indicates if the page is in draft mode (read-only). Only populated when pageId input is specified.
        """
        return pulumi.get(self, "draft")

    @_builtins.property
    @pulumi.getter(name="lastUpdated")
    def last_updated(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the page was last updated (read-only, RFC3339 format). Only populated when pageId input is specified.
        """
        return pulumi.get(self, "last_updated")

    @_builtins.property
    @pulumi.getter(name="pageId")
    def page_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The specific page ID to retrieve (optional, 24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c4'). If specified, only this page's data will be returned. If omitted, all pages for the site will be returned in the 'pages' output.
        """
        return pulumi.get(self, "page_id")

    @_builtins.property
    @pulumi.getter
    def pages(self) -> pulumi.Output[Optional[Sequence['outputs.PageInfo']]]:
        """
        List of all pages in the site (read-only). Only populated when pageId input is NOT specified. Each page includes all metadata fields: id, siteId, title, slug, createdOn, lastUpdated, archived, draft, and optional parentId/collectionId.
        """
        return pulumi.get(self, "pages")

    @_builtins.property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The ID of the parent page (read-only, optional). Only present for nested pages. Only populated when pageId input is specified.
        """
        return pulumi.get(self, "parent_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
    def slug(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The URL slug for the page (read-only, e.g., 'about' for '/about'). Only populated when pageId input is specified.
        """
        return pulumi.get(self, "slug")

    @_builtins.property
    @pulumi.getter
    def title(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The page title (read-only). This is the title shown in browser tabs and search results. Only populated when pageId input is specified.
        """
        return pulumi.get(self, "title")

    @_builtins.property
    @pulumi.getter(name="webflowPageId")
    def webflow_page_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The Webflow page ID (read-only). Only populated when pageId input is specified.
        """
        return pulumi.get(self, "webflow_page_id")

