square_api_client/models/order_fulfillment_pickup_details.rs
1//! Model struct for OrderFulfillmentPickupDetails type
2
3use serde::{Deserialize, Serialize};
4
5use super::{
6 enums::OrderFulfillmentPickupDetailsScheduleType, DateTime,
7 OrderFulfillmentPickupDetailsCurbsidePickupDetails, OrderFulfillmentRecipient,
8};
9
10/// This is a model struct for OrderFulfillmentPickupDetails type.
11///
12/// Contains details necessary to fulfill a pickup order.
13#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
14pub struct OrderFulfillmentPickupDetails {
15 /// Information about the person meant to pick up this fulfillment from a physical location.
16 pub recipient: Option<OrderFulfillmentRecipient>,
17 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
18 /// indicating when this fulfillment expires if it is not accepted. The expiration time can only
19 /// be set up to 7 days in the future. If `expires_at` is not set, this pickup fulfillment is
20 /// automatically accepted when placed.
21 pub expires_at: Option<DateTime>,
22 /// The duration of time after which an open and accepted pickup fulfillment is automatically
23 /// moved to the `COMPLETED` state. The duration must be in RFC 3339 format (for example,
24 /// "P1W3D").
25 ///
26 /// If not set, this pickup fulfillment remains accepted until it is canceled or completed.
27 ///
28 /// Example for 2 days, 12 hours, 30 minutes, and 15 seconds: P2DT12H30M15S
29 pub auto_complete_duration: Option<String>,
30 /// The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`.
31 pub schedule_type: Option<OrderFulfillmentPickupDetailsScheduleType>,
32 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) that
33 /// represents the start of the pickup window.
34 ///
35 /// For fulfillments with the schedule type `ASAP`, this is automatically set to the current
36 /// time plus the expected duration to prepare the fulfillment.
37 pub pickup_at: Option<DateTime>,
38 /// The window of time in which the order should be picked up after the `pickup_at` timestamp.
39 /// Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an informational
40 /// guideline for merchants.
41 ///
42 /// Example for 2 days, 12 hours, 30 minutes, and 15 seconds: P2DT12H30M15S
43 pub pickup_window_duration: Option<String>,
44 /// The duration of time it takes to prepare this fulfillment. The duration must be in RFC 3339
45 /// format (for example, "P1W3D").
46 ///
47 /// Example for 2 days, 12 hours, 30 minutes, and 15 seconds: P2DT12H30M15S
48 pub prep_time_duration: Option<String>,
49 /// A note meant to provide additional instructions about the pickup fulfillment displayed in
50 /// the Square Point of Sale application and set by the API.
51 pub note: Option<String>,
52 /// Read only
53 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
54 /// indicating when the fulfillment was placed.
55 pub placed_at: Option<DateTime>,
56 /// Read only
57 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
58 /// indicating when the fulfillment was accepted.
59 pub accepted_at: Option<DateTime>,
60 /// Read only
61 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
62 /// indicating when the fulfillment was rejected.
63 pub rejected_at: Option<DateTime>,
64 /// Read only
65 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
66 /// indicating when the fulfillment is marked ready for pickup.
67 pub ready_at: Option<DateTime>,
68 /// Read only
69 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
70 /// indicating when the fulfillment expired.
71 pub expired_at: Option<DateTime>,
72 /// Read only
73 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
74 /// indicating when the fulfillment was picked up by the recipient.
75 pub picked_up_at: Option<DateTime>,
76 /// Read only
77 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
78 /// indicating when the fulfillment was canceled.
79 pub canceled_at: Option<DateTime>,
80 /// A description of why the pickup was canceled. The maximum length: 100 characters.
81 pub cancel_reason: Option<String>,
82 /// If set to `true`, indicates that this pickup order is for curbside pickup, not in-store
83 /// pickup.
84 pub is_curbside_pickup: Option<bool>,
85 /// Specific details for curbside pickup. These details can only be populated if
86 /// `is_curbside_pickup` is set to `true`.
87 pub curbside_pickup_details: Option<OrderFulfillmentPickupDetailsCurbsidePickupDetails>,
88}