Skip to main content

autogen_squareup/models/
scheduled_shift.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/// ScheduledShift : Represents a specific time slot in a work schedule. This object is used to manage the lifecycle of a scheduled shift from the draft to published state. A scheduled shift contains the latest draft shift details and current published shift details.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ScheduledShift {
17    /// **Read only** The Square-issued ID of the scheduled shift.
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<String>,
20    #[serde(rename = "draft_shift_details", skip_serializing_if = "Option::is_none")]
21    pub draft_shift_details: Option<Box<models::ScheduledShiftDetails>>,
22    #[serde(rename = "published_shift_details", skip_serializing_if = "Option::is_none")]
23    pub published_shift_details: Option<Box<models::ScheduledShiftDetails>>,
24    /// **Read only** The current version of the scheduled shift, which is incremented with each update. This field is used for [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control to ensure that requests don't overwrite data from another request.
25    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
26    pub version: Option<i32>,
27    /// The timestamp of when the scheduled shift was created, in RFC 3339 format presented as UTC.
28    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
29    pub created_at: Option<String>,
30    /// The timestamp of when the scheduled shift was last updated, in RFC 3339 format presented as UTC.
31    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
32    pub updated_at: Option<String>,
33}
34
35impl ScheduledShift {
36    /// Represents a specific time slot in a work schedule. This object is used to manage the lifecycle of a scheduled shift from the draft to published state. A scheduled shift contains the latest draft shift details and current published shift details.
37    pub fn new() -> ScheduledShift {
38        ScheduledShift {
39            id: None,
40            draft_shift_details: None,
41            published_shift_details: None,
42            version: None,
43            created_at: None,
44            updated_at: None,
45        }
46    }
47}
48