square_api_client/models/order_fullfillment_delivery_details.rs
1//! Model struct for OrderFulfillmentShipmentDetails type
2
3use serde::{Deserialize, Serialize};
4
5use super::{
6 enums::OrderFulfillmentDeliveryDetailsScheduleType, DateTime, OrderFulfillmentRecipient,
7};
8
9/// Describes delivery details of an order fulfillment.
10#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
11pub struct OrderFulfillmentDeliveryDetails {
12 /// Information about the person meant to receive this shipment fulfillment.
13 pub recipient: Option<OrderFulfillmentRecipient>,
14 /// Indicates the fulfillment delivery schedule type. If SCHEDULED, then deliver_at is required.
15 /// If ASAP, then prep_time_duration is required. The default is SCHEDULED
16 pub schedule_type: Option<OrderFulfillmentDeliveryDetailsScheduleType>,
17 /// *Read only* The
18 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
19 /// when the shipment was requested.
20 pub placed_at: Option<DateTime>,
21 /// *Read only* The
22 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
23 /// when fulfillment is supposed to be delivered. Required When the schedule_type is ASAP
24 pub deliver_at: Option<DateTime>,
25 /// *Read only* The
26 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
27 /// what is the duration of time it takes to prepare and deliver this fulfillment
28 pub prep_time_duration: Option<DateTime>,
29 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
30 /// indicating the time period after the deliver_at timestamp in which to deliver the order.
31 pub delivery_window_duration: Option<DateTime>,
32 /// Provides additional instructions about the delivery fulfillment.
33 /// It is displayed in the Square Point of Sale application and set by the API.
34 pub note: Option<String>,
35 /// *Read only* The
36 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
37 /// when this fulfillment was moved to the COMPLETED state, which indicates that the fulfillment
38 /// has been completed by the seller.
39 pub completed_at: Option<DateTime>,
40 /// *Read only* The
41 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
42 /// when this fulfillment was moved to the RESERVED state, which indicates that the fulfillment
43 /// has been started by the seller.
44 pub in_progress_at: Option<DateTime>,
45 /// *Read only* The
46 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
47 /// when this fulfillment was moved to the FAILED state, which indicates that the fulfillment
48 /// has been rejected.
49 pub rejected_at: Option<DateTime>,
50 /// *Read only* The
51 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
52 /// when this fulfillment was moved to the PREPARED state, which indicates that the fulfillment
53 /// has been marked by the seller as ready to be picked up.
54 pub ready_at: Option<DateTime>,
55 /// *Read only* The
56 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
57 /// when this fulfillment has been delivered
58 pub delivered_at: Option<DateTime>,
59 /// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
60 /// indicating the shipment was canceled.
61 pub canceled_at: Option<DateTime>,
62 /// A description of why the shipment was canceled.
63 pub cancel_reason: Option<String>,
64 /// *Read only* The
65 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
66 /// when an order can be picked up by the courier for delivery
67 pub courier_pickup_at: Option<DateTime>,
68 /// *Read only* The
69 /// [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating
70 /// the period of time in which the order should be picked up by the courier after the courier_pickup_at
71 pub courier_pickup_window_duration: Option<DateTime>,
72 /// A description of why the shipment failed to be completed.
73 pub is_no_contact_delivery: Option<bool>,
74 /// A note to provide additional instructions about how to deliver the order.
75 pub dropoff_notes: Option<String>,
76 /// The name of the courier provider
77 pub courier_provider_name: Option<String>,
78 /// The support phone number of the courier.
79 pub courier_support_phone_number: Option<String>,
80 /// The identifier for the delivery created by Square.
81 pub square_delivery_id: Option<String>,
82 /// The identifier for the delivery created by the third-party courier service.
83 pub external_delivery_id: Option<String>,
84 /// The flag to indicate the delivery is managed by a third party (ie DoorDash),
85 /// which means we may not receive all recipient information for PII purposes.
86 pub managed_delivery: Option<bool>,
87}