autogen_squareup/models/invoice_payment_made_event.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/// InvoicePaymentMadeEvent : Published when a payment that is associated with an [invoice](entity:Invoice) is completed. For more information about invoice payments, see [Pay an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice).
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InvoicePaymentMadeEvent {
17 /// The ID of the target merchant associated with the event.
18 #[serde(rename = "merchant_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19 pub merchant_id: Option<Option<String>>,
20 /// The type of event this represents, `\"invoice.payment_made\"`.
21 #[serde(rename = "type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub r#type: Option<Option<String>>,
23 /// A unique ID for the event.
24 #[serde(rename = "event_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25 pub event_id: Option<Option<String>>,
26 /// Timestamp of when the event was created, in RFC 3339 format.
27 #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
28 pub created_at: Option<String>,
29 #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
30 pub data: Option<Box<models::InvoicePaymentMadeEventData>>,
31}
32
33impl InvoicePaymentMadeEvent {
34 /// Published when a payment that is associated with an [invoice](entity:Invoice) is completed. For more information about invoice payments, see [Pay an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice).
35 pub fn new() -> InvoicePaymentMadeEvent {
36 InvoicePaymentMadeEvent {
37 merchant_id: None,
38 r#type: None,
39 event_id: None,
40 created_at: None,
41 data: None,
42 }
43 }
44}
45