Skip to main content

autogen_squareup/models/
order_created.rs

1/*
2 * Square
3 *
4 * Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.
5 *
6 * The version of the OpenAPI document: 2.0
7 * Contact: developers@squareup.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OrderCreated {
16    /// The order's unique ID.
17    #[serde(rename = "order_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub order_id: Option<Option<String>>,
19    /// The version number, which is incremented each time an update is committed to the order. Orders that were not created through the API do not include a version number and therefore cannot be updated.  [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)
20    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
21    pub version: Option<i32>,
22    /// The ID of the seller location that this order is associated with.
23    #[serde(rename = "location_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub location_id: Option<Option<String>>,
25    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
26    pub state: Option<models::OrderState>,
27    /// The timestamp for when the order was created, in RFC 3339 format.
28    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
29    pub created_at: Option<String>,
30}
31
32impl OrderCreated {
33    pub fn new() -> OrderCreated {
34        OrderCreated {
35            order_id: None,
36            version: None,
37            location_id: None,
38            state: None,
39            created_at: None,
40        }
41    }
42}
43