edifact-types 0.4.1

Bindings for the Edifact standard
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
use super::*;
use crate::util::{clean_num, Parser};
use edifact_types_macros::{DisplayInnerSegment, ParseElement};
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::{
    fmt::{self, Debug},
    str::FromStr,
};

/// C002 - DOCUMENT/MESSAGE NAME
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C002 {
    pub _010: Option<String>,
    pub _020: Option<String>,
    pub _030: Option<String>,
    pub _040: Option<String>,
}

/// C040 - CARRIER
///
/// Identification of a carrier by code and/or by name. Code
/// preferred.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C040 {
    /// Carrier identification
    ///
    /// C  an..17
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Carrier name
    ///
    /// C  an..35
    pub _040: Option<String>,
}

/// C056 - DEPARTMENT OR EMPLOYEE DETAILS
///
/// Code and/or name of a department or employee. Code
/// preferred.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C056 {
    /// Department or employee identification
    ///
    /// C  an..17
    pub _010: Option<String>,
    /// Department or employee
    ///
    /// C  an..35
    pub _020: Option<String>,
}

/// C058 - NAME AND ADDRESS
///
/// Unstructured name and address: one to five lines.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C058 {
    /// Name and address line
    ///
    /// M  an..35
    pub _010: String,
    /// Name and address line
    ///
    /// C  an..35
    pub _020: Option<String>,
    /// Name and address line
    ///
    /// C  an..35
    pub _030: Option<String>,
    /// Name and address line
    ///
    /// C  an..35
    pub _040: Option<String>,
    /// Name and address line
    ///
    /// C  an..35
    pub _050: Option<String>,
}

/// C059 - STREET
///
/// Street address and/or PO Box number in a structured
/// address: one to three lines.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C059 {
    /// Street and number/p.o. box
    ///
    /// M  an..35
    pub _010: String,
    /// Street and number/p.o. box
    ///
    /// C  an..35
    pub _020: Option<String>,
    /// Street and number/p.o. box
    ///
    /// C  an..35
    pub _030: Option<String>,
}

/// C080 - PARTY NAME
///
/// Identification of a transaction party by name, one to five
/// lines. Party name may be formatted.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C080 {
    /// Party name
    ///
    /// M  an..35
    pub _010: String,
    /// Party name
    ///
    /// C  an..35
    pub _020: Option<String>,
    /// Party name
    ///
    /// C  an..35
    pub _030: Option<String>,
    /// Party name
    ///
    /// C  an..35
    pub _040: Option<String>,
    /// Party name
    ///
    /// C  an..35
    pub _050: Option<String>,
    /// Party name format, coded
    ///
    /// C  an..3
    pub _060: Option<String>,
}

/// C082  PARTY IDENTIFICATION DETAILS
///
/// Identification of a transaction party by code.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C082 {
    /// Party id. identification
    ///
    /// M  an..35
    pub _010: String,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
}

/// C107 - TEXT REFERENCE
///
/// Coded reference to a standard text and its source.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C107 {
    /// Free text, coded
    ///
    /// M  an..3
    pub _010: String,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
}

/// C108 - TEXT LITERAL
///
/// Free text; one to five lines.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C108 {
    /// Free text
    ///
    /// M  an..70
    pub _010: String,
    /// Free text
    ///
    /// C  an..70
    pub _020: Option<String>,
    /// Free text
    ///
    /// C  an..70
    pub _030: Option<String>,
    /// Free text
    ///
    /// C  an..70
    pub _040: Option<String>,
    /// Free text
    ///
    /// C  an..70
    pub _050: Option<String>,
}

/// C174 - VALUE/RANGE
///
/// Measurement value and relevant minimum and maximum
/// tolerances in that order.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C174 {
    /// Measure unit qualifier
    ///
    /// M  an..3
    pub _010: String,
    /// Measurement value
    ///
    /// C  n..18
    pub _020: Option<String>,
    /// Range minimum
    ///
    /// C  n..18
    pub _030: Option<String>,
    /// Range maximum
    ///
    /// C  n..18
    pub _040: Option<String>,
    /// Significant digits
    ///
    /// C  n..2
    pub _050: Option<String>,
}

/// C205 - HAZARD CODE
///
/// The identification of the dangerous goods in code.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C205 {
    /// Hazard code identification                        M  an..7
    pub _010: String,
    /// Hazard substance/item/page number                 C  an..7
    pub _020: Option<String>,
    /// Hazard code version number                        C  an..10
    pub _030: Option<String>,
}

/// C211 - DIMENSIONS
///
/// Specification of the dimensions of a transportable unit.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C211 {
    /// Measure unit qualifier
    ///
    /// M  an..3
    pub _010: String,
    /// Length dimension
    ///
    /// C  n..15
    pub _020: Option<String>,
    /// Width dimension
    ///
    /// C  n..15
    pub _030: Option<String>,
    /// Height dimension
    ///
    /// C  n..15
    pub _040: Option<String>,
}

/// C215 - SEAL ISSUER
///
/// Identification of the issuer of a seal on equipment either
/// by code or by name.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C215 {
    /// Sealing party, coded
    ///
    /// C  an..3
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Sealing party
    ///
    /// C  an..35
    pub _040: Option<String>,
}

/// C219 - MOVEMENT TYPE
///
/// Description of type of service for movement of cargo.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C219 {
    /// Movement type, coded
    ///
    /// C  an..3
    pub _010: Option<String>,
    /// Movement type
    ///
    /// C  an..35
    pub _020: Option<String>,
}

/// C220 - MODE OF TRANSPORT
///
/// Method of transport code or name. Code preferred.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C220 {
    /// Mode of transport, coded
    ///
    /// C  an..3
    pub _010: Option<String>,
    /// Mode of transport
    ///
    /// C  an..17
    pub _020: Option<String>,
}

/// C222 - TRANSPORT IDENTIFICATION
///
/// Code and/or name identifying the means of transport.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C222 {
    /// Id. of means of transport identification
    ///
    /// C  an..9
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Id. of the means of transport
    ///
    /// C  an..35
    pub _040: Option<String>,
    /// Nationality of means of transport, coded
    ///
    /// C  an..3
    pub _050: Option<String>,
}

/// C223 - DANGEROUS GOODS SHIPMENT FLASHPOINT
///
/// Temperature at which a vapor according to ISO 1523/73 can
/// be ignited.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C223 {
    /// Shipment flashpoint
    ///
    /// C  n3
    pub _010: Option<String>,
    /// Measure unit qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
}

/// C224 - EQUIPMENT SIZE AND TYPE
///
/// Code and/or name identifying size and type of equipment
/// used in transport. Code preferred.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C224 {
    /// Equipment size and type identification
    ///
    /// C  an..10
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Equipment size and type
    ///
    /// C  an..35
    pub _040: Option<String>,
}

/// C228 - TRANSPORT MEANS
///
/// Code and/or name identifying the type of means of
/// transport.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C228 {
    /// Type of means of transport identification
    ///
    /// C  an..8
    pub _010: Option<String>,
    /// Type of means of transport
    ///
    /// C  an..17
    pub _020: Option<String>,
}

/// C234 - UNDG INFORMATION
///
/// Information on United Nations Dangerous Goods
/// classification.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C234 {
    /// UNDG number
    ///
    /// C  n4
    pub _010: Option<String>,
    /// Dangerous goods flashpoint
    ///
    /// C  an..8
    pub _020: Option<String>,
}

/// C235 - HAZARD IDENTIFICATION
///
/// Identification of the Orange placard required on the means
/// of transport.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C235 {
    /// Hazard identification number, upper part
    ///
    /// C  an..4
    pub _010: Option<String>,
    /// Substance identification number, lower part
    ///
    /// C  an4
    pub _020: Option<String>,
}

/// C236 - DANGEROUS GOODS LABEL
///
/// Markings identifying the type of hazardous goods and
/// similar information.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C236 {
    /// Dangerous goods label marking                     C  an..4
    pub _010: Option<String>,
    /// Dangerous goods label marking                     C  an..4
    pub _020: Option<String>,
    /// Dangerous goods label marking                     C  an..4
    pub _030: Option<String>,
}

/// C237 - EQUIPMENT IDENTIFICATION
///
/// Marks (letters and/or numbers) identifying equipment used
/// for transport such as a container.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C237 {
    /// Equipment identification number
    ///
    /// C  an..17
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Country, coded
    ///
    /// C  an..3
    pub _040: Option<String>,
}

/// C239 - TEMPERATURE SETTING
///
/// The temperature under which the goods are (to be) stored
/// or shipped.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C239 {
    /// Temperature setting                               C  n3
    pub _010: Option<String>,
    /// Measure unit qualifier                            C  an..3
    pub _020: Option<String>,
}

/// C270 - CONTROL
///
/// Control total for checking integrity of a message or part
/// of a message.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C270 {
    /// Control qualifier
    ///
    /// M  an..3
    pub _010: String,
    /// Control value
    ///
    /// M  n..18
    pub _020: String,
    /// Measure unit qualifier
    ///
    /// C  an..3
    pub _030: Option<String>,
}

/// C280 - RANGE
///
/// Range minimum and maximum limits.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C280 {
    /// Measure unit qualifier                            M  an..3
    pub _010: String,
    /// Range minimum                                     C  n..18
    pub _020: Option<String>,
    /// Range maximum                                     C  n..18
    pub _030: Option<String>,
}

/// C401 - EXCESS TRANSPORTATION INFORMATION
///
/// To provide details of reason for, and responsibility for,
/// use of transportation other than normally utilized.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C401 {
    /// Excess transportation reason, coded
    ///
    /// M  an..3
    pub _010: String,
    /// Excess transportation responsibility, coded
    ///
    /// M  an..3
    pub _020: String,
    /// Customer authorization number
    ///
    /// C  an..17
    pub _030: Option<String>,
}

/// C502 - MEASUREMENT DETAILS
///
/// Identification of measurement type.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C502 {
    /// Measurement dimension, coded                      C  an..3
    pub _010: Option<String>,
    /// Measurement significance, coded                   C  an..3
    pub _020: Option<String>,
    /// Measurement attribute, coded                      C  an..3
    pub _030: Option<String>,
    /// Measurement attribute                             C  an..70
    pub _040: Option<String>,
}

/// C506 - REFERENCE
///
/// Identification of a reference.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C506 {
    /// Reference qualifier
    ///
    /// M  an..3
    pub _010: String,
    /// Reference number
    ///
    /// C  an..35
    pub _020: Option<String>,
    /// Line number
    ///
    /// C  an..6
    pub _030: Option<String>,
    /// Reference version number
    ///
    /// C  an..35
    pub _040: Option<String>,
}

/// C507 - DATE/TIME/PERIOD
///
/// Date and/or time, or period relevant to the specified
/// date/time/period type.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C507 {
    pub _010: String,
    pub _020: Option<String>,
    pub _030: Option<String>,
}

/// C517 - LOCATION IDENTIFICATION
///
/// Identification of a location by code or name.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C517 {
    /// Place/location identification
    ///
    /// C  an..25
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Place/location
    ///
    /// C  an..17
    pub _040: Option<String>,
}

/// C519 - RELATED LOCATION ONE IDENTIFICATION
///
/// Identification the first related location by code or name.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C519 {
    /// Related place/location one identification
    ///
    /// C  an..25
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Related place/location one
    ///
    /// C  an..70
    pub _040: Option<String>,
}

/// C523 - NUMBER OF UNIT DETAILS
///
/// Identification of number of units and its purpose.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C523 {
    /// Number of units                                   C  n..15
    pub _010: Option<String>,
    /// Number of units qualifier                         C  an..3
    pub _020: Option<String>,
}

/// C553 - RELATED LOCATION TWO IDENTIFICATION
///
/// Identification of second related location by code or name.
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct C553 {
    /// Related place/location two identification
    ///
    /// C  an..25
    pub _010: Option<String>,
    /// Code list qualifier
    ///
    /// C  an..3
    pub _020: Option<String>,
    /// Code list responsible agency, coded
    ///
    /// C  an..3
    pub _030: Option<String>,
    /// Related place/location two
    ///
    /// C  an..70
    pub _040: Option<String>,
}

/// Syntax identifier
///
/// Identification of the agency controlling the syntax and indication of syntax level, plus the syntax version number.
#[derive(
    Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement, PartialEq, Eq, Default,
)]
pub struct S001 {
    pub _010: _0001,
    pub _020: _0002,
}

/// Interchange sender
///
/// Identification of the sender of the interchange.
#[derive(
    Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
)]
pub struct S002 {
    /// Sender identification
    ///
    /// Name or coded representation of the sender of a data interchange.
    /// Code or name as specified in IA.
    pub _010: String,
    pub _020: Option<_0007>,
    /// Address for reverse routing
    ///
    /// Address specified by the sender of an interchange to be included by the recipient in the response interchanges to facilitate internal routing.
    pub _030: Option<String>,
}

/// Interchange recipient
///
/// Identification of the recipient of the interchange.
#[derive(
    Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
)]
pub struct S003 {
    /// Recipient identification
    ///
    /// Name or coded representation of the recipient of a data interchange.
    /// Code or name as specified in IA.
    pub _010: String,
    pub _020: Option<_0007>,
    /// Routing address
    ///
    /// Address specified by the recipient of an interchange to be included by the sender and used by the recipient for routing of received interchanges inside his organization.
    /// If used, normally coded sub-address for onward routing.
    pub _030: Option<String>,
}

/// Date/time of preparation
///
/// Date/time of preparation of the interchange.
#[derive(
    Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
)]
pub struct S004 {
    /// Date of preparation
    ///
    /// Local date when an interchange or a functional group was prepared.
    /// YYMMDD
    pub _010: String,
    /// Time of preparation
    ///
    /// Local time of day when an interchange or a functional group was prepared.
    /// HHMM
    pub _020: String,
}

/// Recipient's reference, password
///
/// Reference or password as agreed between the communicating partners.
#[derive(
    Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
)]
pub struct S005 {
    /// Recipient's reference/password
    ///
    /// Unique reference assigned by the recipient to the data interchange or a password
    /// to the recipient's system or to a third party network as specified in the partners interchange agreement.
    /// As specified in IA. May be password to recipient's system or to third party network.
    pub _010: String,
    /// Recipient's reference/password qualifier
    ///
    /// Qualifier for the recipient's reference or password.
    /// Used if specified in IA.
    pub _020: Option<_0025>,
}

#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment)]
pub struct S009 {
    /// Message type
    ///
    /// M   an1..6
    pub _010: String,
    /// Message version number
    ///
    /// M   an1..3
    pub _020: String,
    /// Message release number
    ///
    /// M   an1..3
    pub _030: String,
    /// Controlling agency, coded
    ///
    /// M   an1..3
    pub _040: String,
    /// Association assigned code
    ///
    /// C   an1..6
    pub _050: Option<String>,
}

impl<'a> Parser<&'a str, S009, nom::error::Error<&'a str>> for S009 {
    fn parse(input: &'a str) -> IResult<&'a str, S009> {
        let (_, vars) = crate::util::parse_colon_section(input)?;
        let v = vars.get(1).unwrap().to_string();
        let r = vars.get(2).unwrap().to_string();
        if format!("{v}{r}") != VERSION {
            return Err(nom::Err::Error(nom::error::Error::new(
                "File supplied EDIFACT Version/Release in UNH segment. Please use the correct parsing feature",
                nom::error::ErrorKind::Verify,
            )));
        }
        let output = S009 {
            _010: vars.first().unwrap().to_string(),
            _020: v,
            _030: r,
            _040: vars.get(3).unwrap().to_string(),
            _050: vars.get(4).map(|x| x.to_string()),
        };
        Ok(("", output))
    }
}

/// STATUS OF THE TRANSFER
#[derive(
    Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone, DisplayInnerSegment, ParseElement,
)]
pub struct S010 {
    /// Sequence of transfers
    ///
    /// M  n..2
    pub _010: String,
    /// First and last transfer
    ///
    /// C  a1
    pub _020: Option<String>,
}