# This file was auto-generated by Fern from our API Definition.

import typing_extensions
import typing_extensions
from .fulfillment_recipient import FulfillmentRecipientParams
import typing
from ..types.fulfillment_pickup_details_schedule_type import FulfillmentPickupDetailsScheduleType
from .fulfillment_pickup_details_curbside_pickup_details import FulfillmentPickupDetailsCurbsidePickupDetailsParams


class FulfillmentPickupDetailsParams(typing_extensions.TypedDict):
    """
    Contains details necessary to fulfill a pickup order.
    """

    recipient: typing_extensions.NotRequired[FulfillmentRecipientParams]
    """
    Information about the person to pick up this fulfillment from a physical
    location.
    """

    expires_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when this fulfillment expires if it is not marked in progress. The timestamp must be
    in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set
    up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order
    are automatically completed.
    """

    auto_complete_duration: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The duration of time after which an in progress pickup fulfillment is automatically moved
    to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D").
    
    If not set, this pickup fulfillment remains in progress until it is canceled or completed.
    """

    schedule_type: typing_extensions.NotRequired[FulfillmentPickupDetailsScheduleType]
    """
    The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`.
    See [FulfillmentPickupDetailsScheduleType](#type-fulfillmentpickupdetailsscheduletype) for possible values
    """

    pickup_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g.,
    "2016-09-04T23:59:33.123Z".
    
    For fulfillments with the schedule type `ASAP`, this is automatically set
    to the current time plus the expected duration to prepare the fulfillment.
    """

    pickup_window_duration: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The window of time in which the order should be picked up after the `pickup_at` timestamp.
    Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an
    informational guideline for merchants.
    """

    prep_time_duration: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The duration of time it takes to prepare this fulfillment.
    The duration must be in RFC 3339 format (for example, "P1W3D").
    """

    note: typing_extensions.NotRequired[typing.Optional[str]]
    """
    A note to provide additional instructions about the pickup
    fulfillment displayed in the Square Point of Sale application and set by the API.
    """

    placed_at: typing_extensions.NotRequired[str]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format
    (for example, "2016-09-04T23:59:33.123Z").
    """

    accepted_at: typing_extensions.NotRequired[str]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format
    (for example, "2016-09-04T23:59:33.123Z").
    """

    rejected_at: typing_extensions.NotRequired[str]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format
    (for example, "2016-09-04T23:59:33.123Z").
    """

    ready_at: typing_extensions.NotRequired[str]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format
    (for example, "2016-09-04T23:59:33.123Z").
    """

    expired_at: typing_extensions.NotRequired[str]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when the fulfillment expired. The timestamp must be in RFC 3339 format
    (for example, "2016-09-04T23:59:33.123Z").
    """

    picked_up_at: typing_extensions.NotRequired[str]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format
    (for example, "2016-09-04T23:59:33.123Z").
    """

    canceled_at: typing_extensions.NotRequired[str]
    """
    The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
    indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format
    (for example, "2016-09-04T23:59:33.123Z").
    """

    cancel_reason: typing_extensions.NotRequired[typing.Optional[str]]
    """
    A description of why the pickup was canceled. The maximum length: 100 characters.
    """

    is_curbside_pickup: typing_extensions.NotRequired[typing.Optional[bool]]
    """
    If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup.
    """

    curbside_pickup_details: typing_extensions.NotRequired[FulfillmentPickupDetailsCurbsidePickupDetailsParams]
    """
    Specific details for curbside pickup. These details can only be populated if `is_curbside_pickup` is set to `true`.
    """
