Skip to main content

autogen_squareup/models/
terminal_action.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/// TerminalAction : Represents an action processed by the Square Terminal.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TerminalAction {
17    /// A unique ID for this `TerminalAction`.
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<String>,
20    /// The unique Id of the device intended for this `TerminalAction`. The Id can be retrieved from /v2/devices api.
21    #[serde(rename = "device_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub device_id: Option<Option<String>>,
23    /// The duration as an RFC 3339 duration, after which the action will be automatically canceled. TerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason of `TIMED_OUT`  Default: 5 minutes from creation  Maximum: 5 minutes
24    #[serde(rename = "deadline_duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub deadline_duration: Option<Option<String>>,
26    /// The status of the `TerminalAction`. Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`
27    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
28    pub status: Option<String>,
29    #[serde(rename = "cancel_reason", skip_serializing_if = "Option::is_none")]
30    pub cancel_reason: Option<models::ActionCancelReason>,
31    /// The time when the `TerminalAction` was created as an RFC 3339 timestamp.
32    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
33    pub created_at: Option<String>,
34    /// The time when the `TerminalAction` was last updated as an RFC 3339 timestamp.
35    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
36    pub updated_at: Option<String>,
37    /// The ID of the application that created the action.
38    #[serde(rename = "app_id", skip_serializing_if = "Option::is_none")]
39    pub app_id: Option<String>,
40    /// The location id the action is attached to, if a link can be made.
41    #[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
42    pub location_id: Option<String>,
43    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
44    pub r#type: Option<models::TerminalActionActionType>,
45    #[serde(rename = "qr_code_options", skip_serializing_if = "Option::is_none")]
46    pub qr_code_options: Option<Box<models::QrCodeOptions>>,
47    #[serde(rename = "save_card_options", skip_serializing_if = "Option::is_none")]
48    pub save_card_options: Option<Box<models::SaveCardOptions>>,
49    #[serde(rename = "signature_options", skip_serializing_if = "Option::is_none")]
50    pub signature_options: Option<Box<models::SignatureOptions>>,
51    #[serde(rename = "confirmation_options", skip_serializing_if = "Option::is_none")]
52    pub confirmation_options: Option<Box<models::ConfirmationOptions>>,
53    #[serde(rename = "receipt_options", skip_serializing_if = "Option::is_none")]
54    pub receipt_options: Option<Box<models::ReceiptOptions>>,
55    #[serde(rename = "data_collection_options", skip_serializing_if = "Option::is_none")]
56    pub data_collection_options: Option<Box<models::DataCollectionOptions>>,
57    #[serde(rename = "select_options", skip_serializing_if = "Option::is_none")]
58    pub select_options: Option<Box<models::SelectOptions>>,
59    #[serde(rename = "device_metadata", skip_serializing_if = "Option::is_none")]
60    pub device_metadata: Option<Box<models::DeviceMetadata>>,
61    /// Indicates the action will be linked to another action and requires a waiting dialog to be displayed instead of returning to the idle screen on completion of the action.  Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types.
62    #[serde(rename = "await_next_action", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
63    pub await_next_action: Option<Option<bool>>,
64    /// The timeout duration of the waiting dialog as an RFC 3339 duration, after which the waiting dialog will no longer be displayed and the Terminal will return to the idle screen.  Default: 5 minutes from when the waiting dialog is displayed  Maximum: 5 minutes
65    #[serde(rename = "await_next_action_duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
66    pub await_next_action_duration: Option<Option<String>>,
67}
68
69impl TerminalAction {
70    /// Represents an action processed by the Square Terminal.
71    pub fn new() -> TerminalAction {
72        TerminalAction {
73            id: None,
74            device_id: None,
75            deadline_duration: None,
76            status: None,
77            cancel_reason: None,
78            created_at: None,
79            updated_at: None,
80            app_id: None,
81            location_id: None,
82            r#type: None,
83            qr_code_options: None,
84            save_card_options: None,
85            signature_options: None,
86            confirmation_options: None,
87            receipt_options: None,
88            data_collection_options: None,
89            select_options: None,
90            device_metadata: None,
91            await_next_action: None,
92            await_next_action_duration: None,
93        }
94    }
95}
96