# 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__ = ['CollectionFieldArgs', 'CollectionField']

@pulumi.input_type
class CollectionFieldArgs:
    def __init__(__self__, *,
                 collection_id: pulumi.Input[_builtins.str],
                 display_name: pulumi.Input[_builtins.str],
                 type: pulumi.Input[_builtins.str],
                 help_text: Optional[pulumi.Input[_builtins.str]] = None,
                 is_required: Optional[pulumi.Input[_builtins.bool]] = None,
                 slug: Optional[pulumi.Input[_builtins.str]] = None,
                 validations: Optional[pulumi.Input[Mapping[str, Any]]] = None):
        """
        The set of arguments for constructing a CollectionField 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[_builtins.str] display_name: The human-readable name of the field (e.g., 'Title', 'Description', 'Author'). This name appears in the Webflow CMS interface. Maximum length: 255 characters.
        :param pulumi.Input[_builtins.str] type: The field type (e.g., 'PlainText', 'RichText', 'Image', 'Number'). Supported types: PlainText, RichText, Image, MultiImage, Video, Link, Email, Phone, Number, DateTime, Switch, Color, Option, File, Reference, MultiReference. IMPORTANT: Cannot be changed after creation - changing this requires replacement.
        :param pulumi.Input[_builtins.str] help_text: Optional help text shown in the CMS interface (e.g., 'Enter the article title'). Helps content editors understand what to enter in this field.
        :param pulumi.Input[_builtins.bool] is_required: Whether the field is required (optional, defaults to false). When true, content items must provide a value for this field.
        :param pulumi.Input[_builtins.str] slug: The URL-friendly slug for the field (optional, e.g., 'title', 'description'). If not provided, Webflow will auto-generate a slug from the displayName. The slug is used in API requests and exports.
        :param pulumi.Input[Mapping[str, Any]] validations: Type-specific validation rules (optional). Different field types support different validations. Example for Number type: {"min": 0, "max": 100}. Example for PlainText type: {"maxLength": 500}. Refer to Webflow API documentation for validation options for each field type.
        """
        pulumi.set(__self__, "collection_id", collection_id)
        pulumi.set(__self__, "display_name", display_name)
        pulumi.set(__self__, "type", type)
        if help_text is not None:
            pulumi.set(__self__, "help_text", help_text)
        if is_required is not None:
            pulumi.set(__self__, "is_required", is_required)
        if slug is not None:
            pulumi.set(__self__, "slug", slug)
        if validations is not None:
            pulumi.set(__self__, "validations", validations)

    @_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="displayName")
    def display_name(self) -> pulumi.Input[_builtins.str]:
        """
        The human-readable name of the field (e.g., 'Title', 'Description', 'Author'). This name appears in the Webflow CMS interface. Maximum length: 255 characters.
        """
        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
    def type(self) -> pulumi.Input[_builtins.str]:
        """
        The field type (e.g., 'PlainText', 'RichText', 'Image', 'Number'). Supported types: PlainText, RichText, Image, MultiImage, Video, Link, Email, Phone, Number, DateTime, Switch, Color, Option, File, Reference, MultiReference. IMPORTANT: Cannot be changed after creation - changing this requires replacement.
        """
        return pulumi.get(self, "type")

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

    @_builtins.property
    @pulumi.getter(name="helpText")
    def help_text(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Optional help text shown in the CMS interface (e.g., 'Enter the article title'). Helps content editors understand what to enter in this field.
        """
        return pulumi.get(self, "help_text")

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

    @_builtins.property
    @pulumi.getter(name="isRequired")
    def is_required(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether the field is required (optional, defaults to false). When true, content items must provide a value for this field.
        """
        return pulumi.get(self, "is_required")

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

    @_builtins.property
    @pulumi.getter
    def slug(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The URL-friendly slug for the field (optional, e.g., 'title', 'description'). If not provided, Webflow will auto-generate a slug from the displayName. The slug is used in API requests and exports.
        """
        return pulumi.get(self, "slug")

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

    @_builtins.property
    @pulumi.getter
    def validations(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        Type-specific validation rules (optional). Different field types support different validations. Example for Number type: {"min": 0, "max": 100}. Example for PlainText type: {"maxLength": 500}. Refer to Webflow API documentation for validation options for each field type.
        """
        return pulumi.get(self, "validations")

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


@pulumi.type_token("webflow:index:CollectionField")
class CollectionField(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 collection_id: Optional[pulumi.Input[_builtins.str]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 help_text: Optional[pulumi.Input[_builtins.str]] = None,
                 is_required: Optional[pulumi.Input[_builtins.bool]] = None,
                 slug: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 validations: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 __props__=None):
        """
        Manages fields for a Webflow CMS collection. Collection fields define the structure of content items in a collection. Note: The field type cannot be changed after creation - changing it requires replacement (delete + recreate).

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the 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[_builtins.str] display_name: The human-readable name of the field (e.g., 'Title', 'Description', 'Author'). This name appears in the Webflow CMS interface. Maximum length: 255 characters.
        :param pulumi.Input[_builtins.str] help_text: Optional help text shown in the CMS interface (e.g., 'Enter the article title'). Helps content editors understand what to enter in this field.
        :param pulumi.Input[_builtins.bool] is_required: Whether the field is required (optional, defaults to false). When true, content items must provide a value for this field.
        :param pulumi.Input[_builtins.str] slug: The URL-friendly slug for the field (optional, e.g., 'title', 'description'). If not provided, Webflow will auto-generate a slug from the displayName. The slug is used in API requests and exports.
        :param pulumi.Input[_builtins.str] type: The field type (e.g., 'PlainText', 'RichText', 'Image', 'Number'). Supported types: PlainText, RichText, Image, MultiImage, Video, Link, Email, Phone, Number, DateTime, Switch, Color, Option, File, Reference, MultiReference. IMPORTANT: Cannot be changed after creation - changing this requires replacement.
        :param pulumi.Input[Mapping[str, Any]] validations: Type-specific validation rules (optional). Different field types support different validations. Example for Number type: {"min": 0, "max": 100}. Example for PlainText type: {"maxLength": 500}. Refer to Webflow API documentation for validation options for each field type.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: CollectionFieldArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages fields for a Webflow CMS collection. Collection fields define the structure of content items in a collection. Note: The field type cannot be changed after creation - changing it requires replacement (delete + recreate).

        :param str resource_name: The name of the resource.
        :param CollectionFieldArgs 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(CollectionFieldArgs, 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,
                 collection_id: Optional[pulumi.Input[_builtins.str]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 help_text: Optional[pulumi.Input[_builtins.str]] = None,
                 is_required: Optional[pulumi.Input[_builtins.bool]] = None,
                 slug: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 validations: Optional[pulumi.Input[Mapping[str, Any]]] = 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__ = CollectionFieldArgs.__new__(CollectionFieldArgs)

            if collection_id is None and not opts.urn:
                raise TypeError("Missing required property 'collection_id'")
            __props__.__dict__["collection_id"] = collection_id
            if display_name is None and not opts.urn:
                raise TypeError("Missing required property 'display_name'")
            __props__.__dict__["display_name"] = display_name
            __props__.__dict__["help_text"] = help_text
            __props__.__dict__["is_required"] = is_required
            __props__.__dict__["slug"] = slug
            if type is None and not opts.urn:
                raise TypeError("Missing required property 'type'")
            __props__.__dict__["type"] = type
            __props__.__dict__["validations"] = validations
            __props__.__dict__["field_id"] = None
            __props__.__dict__["is_editable"] = None
        super(CollectionField, __self__).__init__(
            'webflow:index:CollectionField',
            resource_name,
            __props__,
            opts)

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

        __props__.__dict__["collection_id"] = None
        __props__.__dict__["display_name"] = None
        __props__.__dict__["field_id"] = None
        __props__.__dict__["help_text"] = None
        __props__.__dict__["is_editable"] = None
        __props__.__dict__["is_required"] = None
        __props__.__dict__["slug"] = None
        __props__.__dict__["type"] = None
        __props__.__dict__["validations"] = None
        return CollectionField(resource_name, opts=opts, __props__=__props__)

    @_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="displayName")
    def display_name(self) -> pulumi.Output[_builtins.str]:
        """
        The human-readable name of the field (e.g., 'Title', 'Description', 'Author'). This name appears in the Webflow CMS interface. Maximum length: 255 characters.
        """
        return pulumi.get(self, "display_name")

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

    @_builtins.property
    @pulumi.getter(name="helpText")
    def help_text(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Optional help text shown in the CMS interface (e.g., 'Enter the article title'). Helps content editors understand what to enter in this field.
        """
        return pulumi.get(self, "help_text")

    @_builtins.property
    @pulumi.getter(name="isEditable")
    def is_editable(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Whether the field can be edited (read-only). System fields may not be editable.
        """
        return pulumi.get(self, "is_editable")

    @_builtins.property
    @pulumi.getter(name="isRequired")
    def is_required(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Whether the field is required (optional, defaults to false). When true, content items must provide a value for this field.
        """
        return pulumi.get(self, "is_required")

    @_builtins.property
    @pulumi.getter
    def slug(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The URL-friendly slug for the field (optional, e.g., 'title', 'description'). If not provided, Webflow will auto-generate a slug from the displayName. The slug is used in API requests and exports.
        """
        return pulumi.get(self, "slug")

    @_builtins.property
    @pulumi.getter
    def type(self) -> pulumi.Output[_builtins.str]:
        """
        The field type (e.g., 'PlainText', 'RichText', 'Image', 'Number'). Supported types: PlainText, RichText, Image, MultiImage, Video, Link, Email, Phone, Number, DateTime, Switch, Color, Option, File, Reference, MultiReference. IMPORTANT: Cannot be changed after creation - changing this requires replacement.
        """
        return pulumi.get(self, "type")

    @_builtins.property
    @pulumi.getter
    def validations(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
        """
        Type-specific validation rules (optional). Different field types support different validations. Example for Number type: {"min": 0, "max": 100}. Example for PlainText type: {"maxLength": 500}. Refer to Webflow API documentation for validation options for each field type.
        """
        return pulumi.get(self, "validations")

