osdm_sys/models/
fulfillment.rs

1/*
2 * UIC 90918-10 - OSDM
3 *
4 * Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information.  The following resources are key to get started:    -  [Processes](https://osdm.io/spec/processes/)   -  [Models](https://osdm.io/spec/models/)   -  [Getting started](https://osdm.io/spec/getting-started/) 
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Fulfillment : A fulfillment is a document (or part of a document in distributor mode) that - allows the passenger to prove its travel right - provides easier access to trains and stations - allows an exchange for other services (voucher) A fulfillment refers to services of one or multiple offer parts or a fare (distributor mode). 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Fulfillment {
17    #[serde(rename = "id")]
18    pub id: String,
19    #[serde(rename = "status")]
20    pub status: models::FulfillmentStatus,
21    /// the id of the booking the fulfillment is part of 
22    #[serde(rename = "bookingRef")]
23    pub booking_ref: String,
24    /// A human-readable description of the fulfillment. 
25    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub summary: Option<Option<String>>,
27    #[serde(rename = "createdOn")]
28    pub created_on: String,
29    /// Ticket Control Number. 
30    #[serde(rename = "controlNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub control_number: Option<Option<String>>,
32    /// reference to all booking parts that contributed to this fulfillment. If the fulfillment is made based on booking parts these references must be provided.
33    #[serde(rename = "bookingParts", skip_serializing_if = "Option::is_none")]
34    pub booking_parts: Option<Vec<models::BookingPartReference>>,
35    #[serde(rename = "availableUsage", skip_serializing_if = "Option::is_none")]
36    pub available_usage: Option<Box<models::FulfillmentUsage>>,
37    /// Identifies a company. For rail, a RICS company code or compatible ERA company code are used.  E.g.: 'urn:uic:rics:1185:000011' 
38    #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")]
39    pub issuer: Option<String>,
40    /// Final document created for fulfillment. 
41    #[serde(rename = "fulfillmentDocuments", skip_serializing_if = "Option::is_none")]
42    pub fulfillment_documents: Option<Vec<models::FulfillmentDocument>>,
43    /// the issuing language (ISO-639-1 language code).
44    #[serde(rename = "issuingLanguage", skip_serializing_if = "Option::is_none")]
45    pub issuing_language: Option<String>,
46    /// Fulfillment items to be integrated into tickets (distributor mode). 
47    #[serde(rename = "fulfillmentParts", skip_serializing_if = "Option::is_none")]
48    pub fulfillment_parts: Option<Vec<models::FulfillmentPart>>,
49    /// Indicates whether the fulfillment has all documents or parts generated (if any needed) or they are still pending generation. 
50    #[serde(rename = "contentComplete", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub content_complete: Option<Option<bool>>,
52    #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
53    pub trip_coverage: Option<Box<models::TripCoverage>>,
54    #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
55    pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
56    #[serde(rename = "continuousServiceUsage", skip_serializing_if = "Option::is_none")]
57    pub continuous_service_usage: Option<Box<models::ContinuousServiceUsage>>,
58    ///  Java Property Name: 'links' 
59    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
60    pub _links: Option<Vec<models::Link>>,
61}
62
63impl Fulfillment {
64    /// A fulfillment is a document (or part of a document in distributor mode) that - allows the passenger to prove its travel right - provides easier access to trains and stations - allows an exchange for other services (voucher) A fulfillment refers to services of one or multiple offer parts or a fare (distributor mode). 
65    pub fn new(id: String, status: models::FulfillmentStatus, booking_ref: String, created_on: String) -> Fulfillment {
66        Fulfillment {
67            id,
68            status,
69            booking_ref,
70            summary: None,
71            created_on,
72            control_number: None,
73            booking_parts: None,
74            available_usage: None,
75            issuer: None,
76            fulfillment_documents: None,
77            issuing_language: None,
78            fulfillment_parts: None,
79            content_complete: None,
80            trip_coverage: None,
81            inbound_trip_coverage: None,
82            continuous_service_usage: None,
83            _links: None,
84        }
85    }
86}
87