# 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__ = ['CollectionItemArgs', 'CollectionItem']

@pulumi.input_type
class CollectionItemArgs:
    def __init__(__self__, *,
                 collection_id: pulumi.Input[_builtins.str],
                 field_data: pulumi.Input[Mapping[str, Any]],
                 cms_locale_id: Optional[pulumi.Input[_builtins.str]] = None,
                 is_archived: Optional[pulumi.Input[_builtins.bool]] = None,
                 is_draft: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        The set of arguments for constructing a CollectionItem resource.
        :param pulumi.Input[_builtins.str] collection_id: The Webflow collection ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find collection IDs via the Webflow API or dashboard. This field will be validated before making any API calls.
        :param pulumi.Input[Mapping[str, Any]] field_data: A map of field slugs to values for the collection item. The field slugs must match the fields defined in the collection schema. Common fields include 'name' (required), 'slug' (required, URL-friendly), and any custom fields you've added to the collection. Example: {"name": "My Blog Post", "slug": "my-blog-post", "content": "Post content..."}
        :param pulumi.Input[_builtins.str] cms_locale_id: The locale ID for localized sites (optional, e.g., 'en-US'). Only required if your site uses Webflow's localization features. Leave empty for non-localized sites.
        :param pulumi.Input[_builtins.bool] is_archived: Whether the item is archived (optional, defaults to false). Archived items are not visible on the published site but remain in the CMS.
        :param pulumi.Input[_builtins.bool] is_draft: Whether the item is a draft (optional, defaults to true). Draft items are not published to the live site. Set to false to publish the item immediately upon creation.
        """
        pulumi.set(__self__, "collection_id", collection_id)
        pulumi.set(__self__, "field_data", field_data)
        if cms_locale_id is not None:
            pulumi.set(__self__, "cms_locale_id", cms_locale_id)
        if is_archived is not None:
            pulumi.set(__self__, "is_archived", is_archived)
        if is_draft is not None:
            pulumi.set(__self__, "is_draft", is_draft)

    @_builtins.property
    @pulumi.getter(name="collectionId")
    def collection_id(self) -> pulumi.Input[_builtins.str]:
        """
        The Webflow collection ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find collection IDs via the Webflow API or dashboard. This field will be validated before making any API calls.
        """
        return pulumi.get(self, "collection_id")

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

    @_builtins.property
    @pulumi.getter(name="fieldData")
    def field_data(self) -> pulumi.Input[Mapping[str, Any]]:
        """
        A map of field slugs to values for the collection item. The field slugs must match the fields defined in the collection schema. Common fields include 'name' (required), 'slug' (required, URL-friendly), and any custom fields you've added to the collection. Example: {"name": "My Blog Post", "slug": "my-blog-post", "content": "Post content..."}
        """
        return pulumi.get(self, "field_data")

    @field_data.setter
    def field_data(self, value: pulumi.Input[Mapping[str, Any]]):
        pulumi.set(self, "field_data", value)

    @_builtins.property
    @pulumi.getter(name="cmsLocaleId")
    def cms_locale_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The locale ID for localized sites (optional, e.g., 'en-US'). Only required if your site uses Webflow's localization features. Leave empty for non-localized sites.
        """
        return pulumi.get(self, "cms_locale_id")

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

    @_builtins.property
    @pulumi.getter(name="isArchived")
    def is_archived(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether the item is archived (optional, defaults to false). Archived items are not visible on the published site but remain in the CMS.
        """
        return pulumi.get(self, "is_archived")

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

    @_builtins.property
    @pulumi.getter(name="isDraft")
    def is_draft(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether the item is a draft (optional, defaults to true). Draft items are not published to the live site. Set to false to publish the item immediately upon creation.
        """
        return pulumi.get(self, "is_draft")

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


@pulumi.type_token("webflow:index:CollectionItem")
class CollectionItem(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cms_locale_id: Optional[pulumi.Input[_builtins.str]] = None,
                 collection_id: Optional[pulumi.Input[_builtins.str]] = None,
                 field_data: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 is_archived: Optional[pulumi.Input[_builtins.bool]] = None,
                 is_draft: Optional[pulumi.Input[_builtins.bool]] = None,
                 __props__=None):
        """
        Manages CMS collection items for a Webflow collection. Collection items represent individual content entries (blog posts, products, etc.) within a CMS collection. Each item has dynamic field data based on the collection schema.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] cms_locale_id: The locale ID for localized sites (optional, e.g., 'en-US'). Only required if your site uses Webflow's localization features. Leave empty for non-localized sites.
        :param pulumi.Input[_builtins.str] collection_id: The Webflow collection ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find collection IDs via the Webflow API or dashboard. This field will be validated before making any API calls.
        :param pulumi.Input[Mapping[str, Any]] field_data: A map of field slugs to values for the collection item. The field slugs must match the fields defined in the collection schema. Common fields include 'name' (required), 'slug' (required, URL-friendly), and any custom fields you've added to the collection. Example: {"name": "My Blog Post", "slug": "my-blog-post", "content": "Post content..."}
        :param pulumi.Input[_builtins.bool] is_archived: Whether the item is archived (optional, defaults to false). Archived items are not visible on the published site but remain in the CMS.
        :param pulumi.Input[_builtins.bool] is_draft: Whether the item is a draft (optional, defaults to true). Draft items are not published to the live site. Set to false to publish the item immediately upon creation.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: CollectionItemArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages CMS collection items for a Webflow collection. Collection items represent individual content entries (blog posts, products, etc.) within a CMS collection. Each item has dynamic field data based on the collection schema.

        :param str resource_name: The name of the resource.
        :param CollectionItemArgs 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(CollectionItemArgs, 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,
                 cms_locale_id: Optional[pulumi.Input[_builtins.str]] = None,
                 collection_id: Optional[pulumi.Input[_builtins.str]] = None,
                 field_data: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 is_archived: Optional[pulumi.Input[_builtins.bool]] = None,
                 is_draft: Optional[pulumi.Input[_builtins.bool]] = 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__ = CollectionItemArgs.__new__(CollectionItemArgs)

            __props__.__dict__["cms_locale_id"] = cms_locale_id
            if collection_id is None and not opts.urn:
                raise TypeError("Missing required property 'collection_id'")
            __props__.__dict__["collection_id"] = collection_id
            if field_data is None and not opts.urn:
                raise TypeError("Missing required property 'field_data'")
            __props__.__dict__["field_data"] = field_data
            __props__.__dict__["is_archived"] = is_archived
            __props__.__dict__["is_draft"] = is_draft
            __props__.__dict__["created_on"] = None
            __props__.__dict__["item_id"] = None
            __props__.__dict__["last_published"] = None
            __props__.__dict__["last_updated"] = None
        super(CollectionItem, __self__).__init__(
            'webflow:index:CollectionItem',
            resource_name,
            __props__,
            opts)

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

        __props__.__dict__["cms_locale_id"] = None
        __props__.__dict__["collection_id"] = None
        __props__.__dict__["created_on"] = None
        __props__.__dict__["field_data"] = None
        __props__.__dict__["is_archived"] = None
        __props__.__dict__["is_draft"] = None
        __props__.__dict__["item_id"] = None
        __props__.__dict__["last_published"] = None
        __props__.__dict__["last_updated"] = None
        return CollectionItem(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="cmsLocaleId")
    def cms_locale_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The locale ID for localized sites (optional, e.g., 'en-US'). Only required if your site uses Webflow's localization features. Leave empty for non-localized sites.
        """
        return pulumi.get(self, "cms_locale_id")

    @_builtins.property
    @pulumi.getter(name="collectionId")
    def collection_id(self) -> pulumi.Output[_builtins.str]:
        """
        The Webflow collection ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find collection IDs via the Webflow API or dashboard. This field will be validated before making any API calls.
        """
        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 item was created (RFC3339 format, read-only). This is automatically set by Webflow and is immutable.
        """
        return pulumi.get(self, "created_on")

    @_builtins.property
    @pulumi.getter(name="fieldData")
    def field_data(self) -> pulumi.Output[Mapping[str, Any]]:
        """
        A map of field slugs to values for the collection item. The field slugs must match the fields defined in the collection schema. Common fields include 'name' (required), 'slug' (required, URL-friendly), and any custom fields you've added to the collection. Example: {"name": "My Blog Post", "slug": "my-blog-post", "content": "Post content..."}
        """
        return pulumi.get(self, "field_data")

    @_builtins.property
    @pulumi.getter(name="isArchived")
    def is_archived(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Whether the item is archived (optional, defaults to false). Archived items are not visible on the published site but remain in the CMS.
        """
        return pulumi.get(self, "is_archived")

    @_builtins.property
    @pulumi.getter(name="isDraft")
    def is_draft(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Whether the item is a draft (optional, defaults to true). Draft items are not published to the live site. Set to false to publish the item immediately upon creation.
        """
        return pulumi.get(self, "is_draft")

    @_builtins.property
    @pulumi.getter(name="itemId")
    def item_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The Webflow-assigned item ID (read-only). This is automatically set by Webflow when the item is created.
        """
        return pulumi.get(self, "item_id")

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

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

