Skip to main content

autogen_squareup/models/
upsert_order_custom_attribute_request.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/// UpsertOrderCustomAttributeRequest : Represents an upsert request for an order custom attribute.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UpsertOrderCustomAttributeRequest {
17    #[serde(rename = "custom_attribute")]
18    pub custom_attribute: Box<models::CustomAttribute>,
19    /// A unique identifier for this request, used to ensure idempotency.  For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
20    #[serde(rename = "idempotency_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub idempotency_key: Option<Option<String>>,
22}
23
24impl UpsertOrderCustomAttributeRequest {
25    /// Represents an upsert request for an order custom attribute.
26    pub fn new(custom_attribute: models::CustomAttribute) -> UpsertOrderCustomAttributeRequest {
27        UpsertOrderCustomAttributeRequest {
28            custom_attribute: Box::new(custom_attribute),
29            idempotency_key: None,
30        }
31    }
32}
33