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
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
use chrono::prelude::*;
use derive_builder::Builder;
use getset::Getters;
use getset::Setters;
use getset::MutGetters;
use serde_derive::{Serialize, Deserialize};
use url::Url;

pub mod action {
    use super::*;
    
    #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
    pub enum InputOutput {
        #[serde(rename="input")]
        Input,
        #[serde(rename="output")]
        Output,
        #[serde(rename="notApplicable")]
        NotApplicable,
    }

    #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
    pub enum Label {
        #[serde(rename="dropoff")]
        Dropoff,
        #[serde(rename="pickup")]
        Pickup,
        #[serde(rename="consume")]
        Consume,
        #[serde(rename="use")]
        Use,
        #[serde(rename="work")]
        Work,
        #[serde(rename="cite")]
        Cite,
        #[serde(rename="produce")]
        Produce,
        #[serde(rename="accept")]
        Accept,
        #[serde(rename="modify")]
        Modify,
        #[serde(rename="pass")]
        Pass,
        #[serde(rename="fail")]
        Fail,
        #[serde(rename="deliver-service")]
        DeliverService,
        #[serde(rename="transfer-all-rights")]
        TransferAllRights,
        #[serde(rename="transfer-custody")]
        TransferCustody,
        #[serde(rename="transfer-complete")]
        TransferComplete,
        #[serde(rename="move")]
        Move,
        #[serde(rename="raise")]
        Raise,
        #[serde(rename="lower")]
        Lower,
    }

    #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
    pub enum PairsWith {
        #[serde(rename="notApplicable")]
        NotApplicable,
        #[serde(rename="dropoff")]
        Dropoff,
        #[serde(rename="pickup")]
        Pickup,
        #[serde(rename="accept")]
        Accept,
        #[serde(rename="modify")]
        Modify,
        #[serde(rename="pass")]
        Pass,
        #[serde(rename="fail")]
        Fail,
    }

    #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
    pub enum ResourceEffect {
        #[serde(rename="increment")]
        Increment,
        #[serde(rename="decrement")]
        Decrement,
        #[serde(rename="noEffect")]
        NoEffect,
        #[serde(rename="decrementIncrement")]
        DecrementIncrement,
    }

    /// An action verb defining the kind of event, commitment, or intent.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Action.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Action {
        /// Denotes if a process input or output, or not related to a process.
        #[builder(setter(into, strip_option), default)]
        input_output: Option<InputOutput>,
        /// A unique verb which defines the action.
        #[builder(setter(into, strip_option), default)]
        label: Option<Label>,
        /// The action that should be included on the other direction of the process, for example accept with modify.
        #[builder(setter(into, strip_option), default)]
        pairs_with: Option<PairsWith>,
        /// The effect of an economic event on a resource, increment, decrement, no effect, or decrement resource and increment 'to' resource.
        resource_effect: ResourceEffect,
    }
    
    impl Action {
        /// Turns Action into ActionBuilder
        pub fn into_builder(self) -> ActionBuilder {
            let Action { input_output, label, pairs_with, resource_effect } = self;
            let mut builder = ActionBuilder::default();
            builder = match input_output { Some(x) => builder.input_output(x), None => builder, };
            builder = match label { Some(x) => builder.label(x), None => builder, };
            builder = match pairs_with { Some(x) => builder.pairs_with(x), None => builder, };
            builder = builder.resource_effect(resource_effect);
            builder
        }
    }
}

pub mod agent {
    use super::*;
    
    /// A person or group or organization with economic agency.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Agent.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Agent {
        /// The uri to an image relevant to the agent, such as a logo, avatar, photo, etc.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        image: Option<Url>,
        /// An informal or formal textual identifier for an agent. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The main place an agent is located, often an address where activities occur and mail can be sent. This is usually a mappable geographic location.  It also could be a website address, as in the case of agents who have no physical location.
        #[builder(setter(into, strip_option), default)]
        primary_location: Option<Box<spatial_thing::SpatialThing>>,
    }
    
    impl Agent {
        /// Turns Agent into AgentBuilder
        pub fn into_builder(self) -> AgentBuilder {
            let Agent { image, name, note, primary_location } = self;
            let mut builder = AgentBuilder::default();
            builder = match image { Some(x) => builder.image(x), None => builder, };
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match primary_location { Some(x) => builder.primary_location(x), None => builder, };
            builder
        }
    }
}

pub mod agent_relationship {
    use super::*;
    
    /// An ongoing voluntary association between 2 Agents of any kind.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/AgentRelationship.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct AgentRelationship {
        /// Grouping around something to create a boundary or context.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The object of a relationship between 2 agents. For example, if Mary is a member of a group, then the group is the object.
        object: Box<agent::Agent>,
        /// A kind of relationship that exists between 2 agents.
        relationship: Box<agent_relationship_role::AgentRelationshipRole>,
        /// The subject of a relationship between 2 agents.  For example, if Mary is a member of a group, then Mary is the subject.
        subject: Box<agent::Agent>,
    }
    
    impl AgentRelationship {
        /// Turns AgentRelationship into AgentRelationshipBuilder
        pub fn into_builder(self) -> AgentRelationshipBuilder {
            let AgentRelationship { in_scope_of, note, object, relationship, subject } = self;
            let mut builder = AgentRelationshipBuilder::default();
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = builder.object(object);
            builder = builder.relationship(relationship);
            builder = builder.subject(subject);
            builder
        }
    }
}

pub mod agent_relationship_role {
    use super::*;
    
    /// A relationship role defining the kind of association one agent can have with another.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/AgentRelationshipRole.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct AgentRelationshipRole {
        /// The human readable name of the role, from the object to the subject. For example, 'has member'.
        #[builder(setter(into, strip_option), default)]
        inverse_role_label: Option<String>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The human readable name of the role, from the subject to the object.  For example, 'is member of'.
        #[builder(setter(into, strip_option), default)]
        role_label: Option<String>,
    }
    
    impl AgentRelationshipRole {
        /// Turns AgentRelationshipRole into AgentRelationshipRoleBuilder
        pub fn into_builder(self) -> AgentRelationshipRoleBuilder {
            let AgentRelationshipRole { inverse_role_label, note, role_label } = self;
            let mut builder = AgentRelationshipRoleBuilder::default();
            builder = match inverse_role_label { Some(x) => builder.inverse_role_label(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match role_label { Some(x) => builder.role_label(x), None => builder, };
            builder
        }
    }
}

pub mod agreement {
    use super::*;
    
    /// Any type of agreement among economic agents.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Agreement.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Agreement {
        /// The date/time the agreement was created.
        #[serde(with="crate::ser::datetime")]
        created: DateTime<Utc>,
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
    }
    
    impl Agreement {
        /// Turns Agreement into AgreementBuilder
        pub fn into_builder(self) -> AgreementBuilder {
            let Agreement { created, name, note } = self;
            let mut builder = AgreementBuilder::default();
            builder = builder.created(created);
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder
        }
    }
}

pub mod appreciation {
    use super::*;
    
    /// A way to tie an economic event that is given in loose fulfilment for another economic event, without commitments or expectations. Supports the gift economy.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Appreciation.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Appreciation {
        /// The economic event this appreciation has been given in acknowledgement of.
        #[builder(setter(into, strip_option), default)]
        appreciation_of: Option<Box<economic_event::EconomicEvent>>,
        /// The economic event provided as a gift in appreciation.
        #[builder(setter(into, strip_option), default)]
        appreciation_with: Option<Box<economic_event::EconomicEvent>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
    }
    
    impl Appreciation {
        /// Turns Appreciation into AppreciationBuilder
        pub fn into_builder(self) -> AppreciationBuilder {
            let Appreciation { appreciation_of, appreciation_with, note } = self;
            let mut builder = AppreciationBuilder::default();
            builder = match appreciation_of { Some(x) => builder.appreciation_of(x), None => builder, };
            builder = match appreciation_with { Some(x) => builder.appreciation_with(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder
        }
    }
}

pub mod claim {
    use super::*;
    
    /// A claim for a future economic event(s) in reciprocity for an economic event that already occurred. For example, a claim for payment for goods received.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Claim.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Claim {
        /// Relates a claim to a verb, such as consume, produce, work, improve, etc.
        action: String,
        /// Reference to an agreement between agents which specifies the rules or policies or calculations which govern this claim.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        agreed_in: Option<Url>,
        /// The date on which the claim was made.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        created: Option<DateTime<Utc>>,
        /// The due date/time of the claim.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        due: Option<DateTime<Utc>>,
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// The claim is complete or not.  This is irrespective of if the original goal has been met, and indicates that no more will be done.
        #[builder(setter(into, strip_option), default)]
        finished: Option<bool>,
        /// Grouping around something to create a boundary or context, used for documenting, accounting, planning.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The economic agent from whom the claim is initiated.
        #[builder(setter(into, strip_option), default)]
        provider: Option<Box<agent::Agent>>,
        /// The economic agent whom the claim is for.
        #[builder(setter(into, strip_option), default)]
        receiver: Option<Box<agent::Agent>>,
        /// References a concept in a common taxonomy or other classification scheme for purposes of categorization or grouping.
        #[serde(with="crate::ser::url_vec")]
        resource_classified_as: Vec<Url>,
        /// The primary resource specification or definition of an existing or potential economic resource. A resource will have only one, as this specifies exactly what the resource is.
        #[builder(setter(into, strip_option), default)]
        resource_conforms_to: Option<Box<resource_specification::ResourceSpecification>>,
        /// The amount and unit of the economic resource counted or inventoried.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
        /// References an economic event that implied the claim, often based on a prior agreement.
        #[builder(setter(into, strip_option), default)]
        triggered_by: Option<Box<economic_event::EconomicEvent>>,
    }
    
    impl Claim {
        /// Turns Claim into ClaimBuilder
        pub fn into_builder(self) -> ClaimBuilder {
            let Claim { action, agreed_in, created, due, effort_quantity, finished, in_scope_of, note, provider, receiver, resource_classified_as, resource_conforms_to, resource_quantity, triggered_by } = self;
            let mut builder = ClaimBuilder::default();
            builder = builder.action(action);
            builder = match agreed_in { Some(x) => builder.agreed_in(x), None => builder, };
            builder = match created { Some(x) => builder.created(x), None => builder, };
            builder = match due { Some(x) => builder.due(x), None => builder, };
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = match finished { Some(x) => builder.finished(x), None => builder, };
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match provider { Some(x) => builder.provider(x), None => builder, };
            builder = match receiver { Some(x) => builder.receiver(x), None => builder, };
            builder = builder.resource_classified_as(resource_classified_as);
            builder = match resource_conforms_to { Some(x) => builder.resource_conforms_to(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder = match triggered_by { Some(x) => builder.triggered_by(x), None => builder, };
            builder
        }
    }
}

pub mod commitment {
    use super::*;
    
    /// A planned economic flow that has been promised by an agent to another agent.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Commitment.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Commitment {
        /// Relates a commitment to a verb, such as consume, produce, work, improve, etc.
        action: String,
        /// Reference to an agreement between agents which specifies the rules or policies or calculations which govern this commitment.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        agreed_in: Option<Url>,
        /// The place where a commitment occurs.  Usually mappable.
        #[builder(setter(into, strip_option), default)]
        at_location: Option<Box<spatial_thing::SpatialThing>>,
        /// This commitment is part of the agreement.
        #[builder(setter(into, strip_option), default)]
        clause_of: Option<Box<agreement::Agreement>>,
        /// The creation time of the commitment.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        created: Option<DateTime<Utc>>,
        /// The due date/time of the commitment.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        due: Option<DateTime<Utc>>,
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// The commitment is complete or not.  This is irrespective of if the original goal has been met, and indicates that no more will be done.
        #[builder(setter(into, strip_option), default)]
        finished: Option<bool>,
        /// The planned beginning of the commitment.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_beginning: Option<DateTime<Utc>>,
        /// The planned end of the commitment.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_end: Option<DateTime<Utc>>,
        /// The planned date/time for the commitment. Can be used instead of beginning and end.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_point_in_time: Option<DateTime<Utc>>,
        /// Grouping around something to create a boundary or context, used for documenting, accounting, planning.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// Represents a desired deliverable expected from this plan.
        #[builder(setter(into, strip_option), default)]
        independent_demand_of: Option<Box<plan::Plan>>,
        /// Defines the process to which this commitment is an input.
        #[builder(setter(into, strip_option), default)]
        input_of: Option<Box<process::Process>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// Defines the process for which this commitment is an output.
        #[builder(setter(into, strip_option), default)]
        output_of: Option<Box<process::Process>>,
        /// The economic agent from whom the commitment is initiated.
        #[builder(setter(into, strip_option), default)]
        provider: Option<Box<agent::Agent>>,
        /// The economic agent whom the commitment is for.
        #[builder(setter(into, strip_option), default)]
        receiver: Option<Box<agent::Agent>>,
        /// References a concept in a common taxonomy or other classification scheme for purposes of categorization or grouping.
        #[serde(with="crate::ser::url_vec")]
        resource_classified_as: Vec<Url>,
        /// The primary resource specification or definition of an existing or potential economic resource. A resource will have only one, as this specifies exactly what the resource is.
        #[builder(setter(into, strip_option), default)]
        resource_conforms_to: Option<Box<resource_specification::ResourceSpecification>>,
        /// Economic resource involved in the commitment.
        #[builder(setter(into, strip_option), default)]
        resource_inventoried_as: Option<Box<economic_resource::EconomicResource>>,
        /// The amount and unit of the economic resource counted or inventoried. This is the quantity that could be used to increment or decrement a resource, depending on the type of resource and resource effect of action.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
    }
    
    impl Commitment {
        /// Turns Commitment into CommitmentBuilder
        pub fn into_builder(self) -> CommitmentBuilder {
            let Commitment { action, agreed_in, at_location, clause_of, created, due, effort_quantity, finished, has_beginning, has_end, has_point_in_time, in_scope_of, independent_demand_of, input_of, note, output_of, provider, receiver, resource_classified_as, resource_conforms_to, resource_inventoried_as, resource_quantity } = self;
            let mut builder = CommitmentBuilder::default();
            builder = builder.action(action);
            builder = match agreed_in { Some(x) => builder.agreed_in(x), None => builder, };
            builder = match at_location { Some(x) => builder.at_location(x), None => builder, };
            builder = match clause_of { Some(x) => builder.clause_of(x), None => builder, };
            builder = match created { Some(x) => builder.created(x), None => builder, };
            builder = match due { Some(x) => builder.due(x), None => builder, };
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = match finished { Some(x) => builder.finished(x), None => builder, };
            builder = match has_beginning { Some(x) => builder.has_beginning(x), None => builder, };
            builder = match has_end { Some(x) => builder.has_end(x), None => builder, };
            builder = match has_point_in_time { Some(x) => builder.has_point_in_time(x), None => builder, };
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = match independent_demand_of { Some(x) => builder.independent_demand_of(x), None => builder, };
            builder = match input_of { Some(x) => builder.input_of(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match output_of { Some(x) => builder.output_of(x), None => builder, };
            builder = match provider { Some(x) => builder.provider(x), None => builder, };
            builder = match receiver { Some(x) => builder.receiver(x), None => builder, };
            builder = builder.resource_classified_as(resource_classified_as);
            builder = match resource_conforms_to { Some(x) => builder.resource_conforms_to(x), None => builder, };
            builder = match resource_inventoried_as { Some(x) => builder.resource_inventoried_as(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder
        }
    }
}

pub mod duration {
    use super::*;
    
    /// A time duration.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Duration.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Duration {
        /// A numeric value.
        numeric_duration: f64,
        /// A unit of time duration.
        unit_type: String,
    }
    
    impl Duration {
        /// Turns Duration into DurationBuilder
        pub fn into_builder(self) -> DurationBuilder {
            let Duration { numeric_duration, unit_type } = self;
            let mut builder = DurationBuilder::default();
            builder = builder.numeric_duration(numeric_duration);
            builder = builder.unit_type(unit_type);
            builder
        }
    }
}

pub mod economic_event {
    use super::*;
    
    /// An observed economic flow, as opposed to a flow planned to happen in the future. It could reflect a change in the quantity of an economic resource. It is also defined by its behavior in relation to the economic resource.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/EconomicEvent.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct EconomicEvent {
        /// Relates an economic event to a verb, such as consume, produce, work, improve, etc.
        action: String,
        /// Reference to an agreement between agents which specifies the rules or policies or calculations which govern this economic event.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        agreed_in: Option<Url>,
        /// The place where an economic event occurs.  Usually mappable.
        #[builder(setter(into, strip_option), default)]
        at_location: Option<Box<spatial_thing::SpatialThing>>,
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// The beginning of the economic event.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_beginning: Option<DateTime<Utc>>,
        /// The end of the economic event.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_end: Option<DateTime<Utc>>,
        /// The date/time at which the economic event occurred. Can be used instead of beginning and end.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_point_in_time: Option<DateTime<Utc>>,
        /// Grouping around something to create a boundary or context, used for documenting, accounting, planning.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// Defines the process to which this event is an input.
        #[builder(setter(into, strip_option), default)]
        input_of: Option<Box<process::Process>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// Defines the process for which this event is an output.
        #[builder(setter(into, strip_option), default)]
        output_of: Option<Box<process::Process>>,
        /// The economic agent from whom the economic event is initiated.
        #[builder(setter(into, strip_option), default)]
        provider: Option<Box<agent::Agent>>,
        /// This economic event occurs as part of this agreement.
        #[builder(setter(into, strip_option), default)]
        realization_of: Option<Box<agreement::Agreement>>,
        /// The economic agent whom the economic event is for.
        #[builder(setter(into, strip_option), default)]
        receiver: Option<Box<agent::Agent>>,
        /// References a concept in a common taxonomy or other classification scheme for purposes of categorization or grouping.
        #[serde(with="crate::ser::url_vec")]
        resource_classified_as: Vec<Url>,
        /// The primary resource specification or definition of an existing or potential economic resource. A resource will have only one, as this specifies exactly what the resource is.
        #[builder(setter(into, strip_option), default)]
        resource_conforms_to: Option<Box<resource_specification::ResourceSpecification>>,
        /// Economic resource involved in the economic event.
        #[builder(setter(into, strip_option), default)]
        resource_inventoried_as: Option<Box<economic_resource::EconomicResource>>,
        /// The amount and unit of the economic resource counted or inventoried. This is the quantity that could be used to increment or decrement a resource, depending on the type of resource and resource effect of action.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
        /// Additional economic resource on the economic event when needed by the receiver. Used when a transfer or move, or sometimes other actions, requires explicitly identifying an economic resource on the receiving side.
        #[builder(setter(into, strip_option), default)]
        to_resource_inventoried_as: Option<Box<economic_resource::EconomicResource>>,
        /// References another economic event that implied this economic event, often based on a prior agreement.
        #[builder(setter(into, strip_option), default)]
        triggered_by: Option<Box<economic_event::EconomicEvent>>,
    }
    
    impl EconomicEvent {
        /// Turns EconomicEvent into EconomicEventBuilder
        pub fn into_builder(self) -> EconomicEventBuilder {
            let EconomicEvent { action, agreed_in, at_location, effort_quantity, has_beginning, has_end, has_point_in_time, in_scope_of, input_of, note, output_of, provider, realization_of, receiver, resource_classified_as, resource_conforms_to, resource_inventoried_as, resource_quantity, to_resource_inventoried_as, triggered_by } = self;
            let mut builder = EconomicEventBuilder::default();
            builder = builder.action(action);
            builder = match agreed_in { Some(x) => builder.agreed_in(x), None => builder, };
            builder = match at_location { Some(x) => builder.at_location(x), None => builder, };
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = match has_beginning { Some(x) => builder.has_beginning(x), None => builder, };
            builder = match has_end { Some(x) => builder.has_end(x), None => builder, };
            builder = match has_point_in_time { Some(x) => builder.has_point_in_time(x), None => builder, };
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = match input_of { Some(x) => builder.input_of(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match output_of { Some(x) => builder.output_of(x), None => builder, };
            builder = match provider { Some(x) => builder.provider(x), None => builder, };
            builder = match realization_of { Some(x) => builder.realization_of(x), None => builder, };
            builder = match receiver { Some(x) => builder.receiver(x), None => builder, };
            builder = builder.resource_classified_as(resource_classified_as);
            builder = match resource_conforms_to { Some(x) => builder.resource_conforms_to(x), None => builder, };
            builder = match resource_inventoried_as { Some(x) => builder.resource_inventoried_as(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder = match to_resource_inventoried_as { Some(x) => builder.to_resource_inventoried_as(x), None => builder, };
            builder = match triggered_by { Some(x) => builder.triggered_by(x), None => builder, };
            builder
        }
    }
}

pub mod economic_resource {
    use super::*;
    
    /// A resource which is useful to people or the ecosystem.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/EconomicResource.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct EconomicResource {
        /// The current amount and unit of the economic resource for which the agent has primary rights and responsibilities, sometimes thought of as ownership. This can be either stored or derived from economic events affecting the resource.
        #[builder(setter(into, strip_option), default)]
        accounting_quantity: Option<Box<measure::Measure>>,
        /// References one or more concepts in a common taxonomy or other classification scheme for purposes of categorization or grouping.
        #[serde(with="crate::ser::url_vec")]
        classified_as: Vec<Url>,
        /// The primary resource knowledge specification or definition of an existing or potential resource.
        #[builder(setter(into, strip_option), default)]
        conforms_to: Option<Box<resource_specification::ResourceSpecification>>,
        /// Used when a stock economic resource contains items also defined as economic resources.
        #[builder(setter(into, strip_option), default)]
        contained_in: Option<Box<economic_resource::EconomicResource>>,
        /// The current place an economic resource is located.  Could be at any level of granularity, from a town to an address to a warehouse location.  Should be mappable.
        #[builder(setter(into, strip_option), default)]
        current_location: Option<Box<spatial_thing::SpatialThing>>,
        /// The uri to an image relevant to the item, such as a photo, diagram, etc.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        image: Option<Url>,
        /// Lot or batch of an economic resource, used to track forward or backwards to all occurrences of resources of that lot. Note more than one resource can be of the same lot.
        #[builder(setter(into, strip_option), default)]
        lot: Option<Box<product_batch::ProductBatch>>,
        /// An informal or formal textual identifier for an object. Does not imply uniqueness.
        #[builder(setter(into, strip_option), default)]
        name: Option<String>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The current amount and unit of the economic resource which is under direct control of the agent.  It may be more or less than the accounting quantity. This can be either stored or derived from economic events affecting the resource.
        #[builder(setter(into, strip_option), default)]
        onhand_quantity: Option<Box<measure::Measure>>,
        /// References the ProcessSpecification of the last process the desired economic resource went through. Stage is used when the last process is important for finding proper resources, such as where the publishing process wants only documents that have gone through the editing process.
        #[builder(setter(into, strip_option), default)]
        stage: Option<Box<process_specification::ProcessSpecification>>,
        /// The state of the desired economic resource (pass or fail), after coming out of a test or review process. Can be derived from the last event if a pass or fail event.
        #[builder(setter(into, strip_option), default)]
        state: Option<Box<action::Action>>,
        /// Sometimes called serial number, used when each item must have a traceable identifier (like a computer). Could also be used for other unique tracking identifiers needed for resources.
        #[builder(setter(into, strip_option), default)]
        tracking_identifier: Option<String>,
        /// The unit used for use action on this resource or work or cite action in the recipe.
        #[builder(setter(into, strip_option), default)]
        unit_of_effort: Option<Box<unit::Unit>>,
    }
    
    impl EconomicResource {
        /// Turns EconomicResource into EconomicResourceBuilder
        pub fn into_builder(self) -> EconomicResourceBuilder {
            let EconomicResource { accounting_quantity, classified_as, conforms_to, contained_in, current_location, image, lot, name, note, onhand_quantity, stage, state, tracking_identifier, unit_of_effort } = self;
            let mut builder = EconomicResourceBuilder::default();
            builder = match accounting_quantity { Some(x) => builder.accounting_quantity(x), None => builder, };
            builder = builder.classified_as(classified_as);
            builder = match conforms_to { Some(x) => builder.conforms_to(x), None => builder, };
            builder = match contained_in { Some(x) => builder.contained_in(x), None => builder, };
            builder = match current_location { Some(x) => builder.current_location(x), None => builder, };
            builder = match image { Some(x) => builder.image(x), None => builder, };
            builder = match lot { Some(x) => builder.lot(x), None => builder, };
            builder = match name { Some(x) => builder.name(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match onhand_quantity { Some(x) => builder.onhand_quantity(x), None => builder, };
            builder = match stage { Some(x) => builder.stage(x), None => builder, };
            builder = match state { Some(x) => builder.state(x), None => builder, };
            builder = match tracking_identifier { Some(x) => builder.tracking_identifier(x), None => builder, };
            builder = match unit_of_effort { Some(x) => builder.unit_of_effort(x), None => builder, };
            builder
        }
    }
}

pub mod fulfillment {
    use super::*;
    
    /// Represents many-to-many relationships between commitments and economic events that fully or partially satisfy one or more commitments.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Fulfillment.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Fulfillment {
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// The economic event which completely or partially fulfills a commitment.
        fulfilled_by: Box<economic_event::EconomicEvent>,
        /// The commitment which is completely or partially fulfilled by an economic event.
        fulfills: Box<commitment::Commitment>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The amount and unit of the economic resource counted or inventoried.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
    }
    
    impl Fulfillment {
        /// Turns Fulfillment into FulfillmentBuilder
        pub fn into_builder(self) -> FulfillmentBuilder {
            let Fulfillment { effort_quantity, fulfilled_by, fulfills, note, resource_quantity } = self;
            let mut builder = FulfillmentBuilder::default();
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = builder.fulfilled_by(fulfilled_by);
            builder = builder.fulfills(fulfills);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder
        }
    }
}

pub mod intent {
    use super::*;
    
    /// A planned economic flow, which can lead to economic events (sometimes through commitments).
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Intent.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Intent {
        /// Relates an intent to a verb, such as consume, produce, work, improve, etc.
        action: String,
        /// Reference to an agreement between agents which specifies the rules or policies or calculations which govern this intent.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        agreed_in: Option<Url>,
        /// The place where an intent occurs.  Usually mappable.
        #[builder(setter(into, strip_option), default)]
        at_location: Option<Box<spatial_thing::SpatialThing>>,
        /// The total quantity of the offered resource available.
        #[builder(setter(into, strip_option), default)]
        available_quantity: Option<Box<measure::Measure>>,
        /// The due date/time of the intent.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        due: Option<DateTime<Utc>>,
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// The intent is complete or not.  This is irrespective of if the original goal has been met, and indicates that no more will be done.
        #[builder(setter(into, strip_option), default)]
        finished: Option<bool>,
        /// The planned beginning of the intent.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_beginning: Option<DateTime<Utc>>,
        /// The planned end of the intent.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_end: Option<DateTime<Utc>>,
        /// The planned date/time for the intent. Can be used instead of beginning and end.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_point_in_time: Option<DateTime<Utc>>,
        /// The uri to an image relevant to the item, such as a photo, diagram, etc.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        image: Option<Url>,
        /// Grouping around something to create a boundary or context, used for documenting, accounting, planning.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// Defines the process to which this intent is an input.
        #[builder(setter(into, strip_option), default)]
        input_of: Option<Box<process::Process>>,
        /// An informal or formal textual identifier for the intent. Does not imply uniqueness.
        #[builder(setter(into, strip_option), default)]
        name: Option<String>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// Defines the process for which this intent is an output.
        #[builder(setter(into, strip_option), default)]
        output_of: Option<Box<process::Process>>,
        /// The economic agent from whom the intent is initiated. This implies that the intent is an offer.
        #[builder(setter(into, strip_option), default)]
        provider: Option<Box<agent::Agent>>,
        /// The economic agent whom the intent is for.  This implies that the intent is a request.
        #[builder(setter(into, strip_option), default)]
        receiver: Option<Box<agent::Agent>>,
        /// References a concept in a common taxonomy or other classification scheme for purposes of categorization or grouping.
        #[serde(with="crate::ser::url_vec")]
        resource_classified_as: Vec<Url>,
        /// The primary resource specification or definition of an existing or potential economic resource. A resource will have only one, as this specifies exactly what the resource is.
        #[builder(setter(into, strip_option), default)]
        resource_conforms_to: Option<Box<resource_specification::ResourceSpecification>>,
        /// Economic resource involved in the intent.
        #[builder(setter(into, strip_option), default)]
        resource_inventoried_as: Option<Box<economic_resource::EconomicResource>>,
        /// The amount and unit of the economic resource counted or inventoried.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
    }
    
    impl Intent {
        /// Turns Intent into IntentBuilder
        pub fn into_builder(self) -> IntentBuilder {
            let Intent { action, agreed_in, at_location, available_quantity, due, effort_quantity, finished, has_beginning, has_end, has_point_in_time, image, in_scope_of, input_of, name, note, output_of, provider, receiver, resource_classified_as, resource_conforms_to, resource_inventoried_as, resource_quantity } = self;
            let mut builder = IntentBuilder::default();
            builder = builder.action(action);
            builder = match agreed_in { Some(x) => builder.agreed_in(x), None => builder, };
            builder = match at_location { Some(x) => builder.at_location(x), None => builder, };
            builder = match available_quantity { Some(x) => builder.available_quantity(x), None => builder, };
            builder = match due { Some(x) => builder.due(x), None => builder, };
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = match finished { Some(x) => builder.finished(x), None => builder, };
            builder = match has_beginning { Some(x) => builder.has_beginning(x), None => builder, };
            builder = match has_end { Some(x) => builder.has_end(x), None => builder, };
            builder = match has_point_in_time { Some(x) => builder.has_point_in_time(x), None => builder, };
            builder = match image { Some(x) => builder.image(x), None => builder, };
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = match input_of { Some(x) => builder.input_of(x), None => builder, };
            builder = match name { Some(x) => builder.name(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match output_of { Some(x) => builder.output_of(x), None => builder, };
            builder = match provider { Some(x) => builder.provider(x), None => builder, };
            builder = match receiver { Some(x) => builder.receiver(x), None => builder, };
            builder = builder.resource_classified_as(resource_classified_as);
            builder = match resource_conforms_to { Some(x) => builder.resource_conforms_to(x), None => builder, };
            builder = match resource_inventoried_as { Some(x) => builder.resource_inventoried_as(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder
        }
    }
}

pub mod measure {
    use super::*;
    
    /// A numeric value with its unit of measure.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Measure.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Measure {
        /// A numeric value.
        has_numerical_value: f64,
        /// A unit of measure.
        has_unit: Box<unit::Unit>,
    }
    
    impl Measure {
        /// Turns Measure into MeasureBuilder
        pub fn into_builder(self) -> MeasureBuilder {
            let Measure { has_numerical_value, has_unit } = self;
            let mut builder = MeasureBuilder::default();
            builder = builder.has_numerical_value(has_numerical_value);
            builder = builder.has_unit(has_unit);
            builder
        }
    }
}

pub mod plan {
    use super::*;
    
    /// A logical collection of processes that constitute a body of planned work with defined deliverable(s).
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Plan.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Plan {
        /// The date/time the plan was made.
        #[serde(with="crate::ser::datetime")]
        created: DateTime<Utc>,
        /// The due date/time of the plan.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        due: Option<DateTime<Utc>>,
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// This plan refines a scenario, making it operational.
        #[builder(setter(into, strip_option), default)]
        refinement_of: Option<Box<scenario::Scenario>>,
    }
    
    impl Plan {
        /// Turns Plan into PlanBuilder
        pub fn into_builder(self) -> PlanBuilder {
            let Plan { created, due, name, note, refinement_of } = self;
            let mut builder = PlanBuilder::default();
            builder = builder.created(created);
            builder = match due { Some(x) => builder.due(x), None => builder, };
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match refinement_of { Some(x) => builder.refinement_of(x), None => builder, };
            builder
        }
    }
}

pub mod process {
    use super::*;
    
    /// An activity that changes inputs into outputs.  It could transform or transport economic resource(s).
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Process.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Process {
        /// The definition or specification for a process.
        #[builder(setter(into, strip_option), default)]
        based_on: Option<Box<process_specification::ProcessSpecification>>,
        /// References one or more concepts in a common taxonomy or other classification scheme for purposes of categorization or grouping.
        #[serde(with="crate::ser::url_vec")]
        classified_as: Vec<Url>,
        /// The process is complete or not. This is irrespective of if the original goal has been met, and indicates that no more will be done.
        #[builder(setter(into, strip_option), default)]
        finished: Option<bool>,
        /// The planned beginning of the process.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_beginning: Option<DateTime<Utc>>,
        /// The planned end of the process.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_end: Option<DateTime<Utc>>,
        /// Grouping around something to create a boundary or context, used for documenting, accounting, planning.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// An informal or formal textual identifier for an object. Does not imply uniqueness.
        name: String,
        /// The process with its inputs and outputs is part of the scenario.
        #[builder(setter(into, strip_option), default)]
        nested_in: Option<Box<scenario::Scenario>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The process with its inputs and outputs is part of the plan.
        #[builder(setter(into, strip_option), default)]
        planned_within: Option<Box<plan::Plan>>,
    }
    
    impl Process {
        /// Turns Process into ProcessBuilder
        pub fn into_builder(self) -> ProcessBuilder {
            let Process { based_on, classified_as, finished, has_beginning, has_end, in_scope_of, name, nested_in, note, planned_within } = self;
            let mut builder = ProcessBuilder::default();
            builder = match based_on { Some(x) => builder.based_on(x), None => builder, };
            builder = builder.classified_as(classified_as);
            builder = match finished { Some(x) => builder.finished(x), None => builder, };
            builder = match has_beginning { Some(x) => builder.has_beginning(x), None => builder, };
            builder = match has_end { Some(x) => builder.has_end(x), None => builder, };
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = builder.name(name);
            builder = match nested_in { Some(x) => builder.nested_in(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match planned_within { Some(x) => builder.planned_within(x), None => builder, };
            builder
        }
    }
}

pub mod process_specification {
    use super::*;
    
    /// Specifies the kind of process.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/ProcessSpecification.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct ProcessSpecification {
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
    }
    
    impl ProcessSpecification {
        /// Turns ProcessSpecification into ProcessSpecificationBuilder
        pub fn into_builder(self) -> ProcessSpecificationBuilder {
            let ProcessSpecification { name, note } = self;
            let mut builder = ProcessSpecificationBuilder::default();
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder
        }
    }
}

pub mod product_batch {
    use super::*;
    
    /// A lot or batch, defining a resource produced at the same time in the same way. From DataFoodConsortium vocabulary https://datafoodconsortium.gitbook.io/dfc-standard-documentation/.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/ProductBatch.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct ProductBatch {
        /// The standard unique identifier of the batch.
        batch_number: String,
        /// Expiration date of the batch, commonly used for food.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        expiry_date: Option<DateTime<Utc>>,
        /// Date the batch was produced.  Can be derived from the economic event of production.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        production_date: Option<DateTime<Utc>>,
    }
    
    impl ProductBatch {
        /// Turns ProductBatch into ProductBatchBuilder
        pub fn into_builder(self) -> ProductBatchBuilder {
            let ProductBatch { batch_number, expiry_date, production_date } = self;
            let mut builder = ProductBatchBuilder::default();
            builder = builder.batch_number(batch_number);
            builder = match expiry_date { Some(x) => builder.expiry_date(x), None => builder, };
            builder = match production_date { Some(x) => builder.production_date(x), None => builder, };
            builder
        }
    }
}

pub mod proposal {
    use super::*;
    
    /// Published requests or offers, sometimes with what is expected in return.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Proposal.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Proposal {
        /// The date and time the proposal was created.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        created: Option<DateTime<Utc>>,
        /// Location or area where the proposal is valid.
        #[builder(setter(into, strip_option), default)]
        eligible_location: Option<Box<spatial_thing::SpatialThing>>,
        /// The beginning date/time of proposal publication.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_beginning: Option<DateTime<Utc>>,
        /// The end date/time of proposal publication.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_end: Option<DateTime<Utc>>,
        /// Grouping around something to create a boundary or context, used for documenting, accounting, planning.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// An informal or formal textual identifier for the proposal. Does not imply uniqueness.
        #[builder(setter(into, strip_option), default)]
        name: Option<String>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// This proposal contains unit based quantities, which can be multipied to create commitments; commonly seen in a price list or e-commerce.
        #[builder(setter(into, strip_option), default)]
        unit_based: Option<bool>,
    }
    
    impl Proposal {
        /// Turns Proposal into ProposalBuilder
        pub fn into_builder(self) -> ProposalBuilder {
            let Proposal { created, eligible_location, has_beginning, has_end, in_scope_of, name, note, unit_based } = self;
            let mut builder = ProposalBuilder::default();
            builder = match created { Some(x) => builder.created(x), None => builder, };
            builder = match eligible_location { Some(x) => builder.eligible_location(x), None => builder, };
            builder = match has_beginning { Some(x) => builder.has_beginning(x), None => builder, };
            builder = match has_end { Some(x) => builder.has_end(x), None => builder, };
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = match name { Some(x) => builder.name(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match unit_based { Some(x) => builder.unit_based(x), None => builder, };
            builder
        }
    }
}

pub mod proposed_intent {
    use super::*;
    
    /// Represents many-to-many relationships between Proposals and Intents, supporting including intents in multiple proposals, as well as a proposal including multiple intents.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/ProposedIntent.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct ProposedIntent {
        /// The published proposal which this intent is part of.
        published_in: Box<proposal::Proposal>,
        /// The intent which is part of this published proposal.
        publishes: Box<intent::Intent>,
        /// This is a reciprocal intent of this proposal, not primary. Not meant to be used for intent matching.
        #[builder(setter(into, strip_option), default)]
        reciprocal: Option<bool>,
    }
    
    impl ProposedIntent {
        /// Turns ProposedIntent into ProposedIntentBuilder
        pub fn into_builder(self) -> ProposedIntentBuilder {
            let ProposedIntent { published_in, publishes, reciprocal } = self;
            let mut builder = ProposedIntentBuilder::default();
            builder = builder.published_in(published_in);
            builder = builder.publishes(publishes);
            builder = match reciprocal { Some(x) => builder.reciprocal(x), None => builder, };
            builder
        }
    }
}

pub mod proposed_to {
    use super::*;
    
    /// An agent to which the proposal is to be published.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/ProposedTo.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct ProposedTo {
        /// The proposal that is published to a specific agent.
        proposed: Box<proposal::Proposal>,
        /// The agent to which the proposal is published.
        proposed_to: Box<agent::Agent>,
    }
    
    impl ProposedTo {
        /// Turns ProposedTo into ProposedToBuilder
        pub fn into_builder(self) -> ProposedToBuilder {
            let ProposedTo { proposed, proposed_to } = self;
            let mut builder = ProposedToBuilder::default();
            builder = builder.proposed(proposed);
            builder = builder.proposed_to(proposed_to);
            builder
        }
    }
}

pub mod recipe_flow {
    use super::*;
    
    /// The specification of a resource inflow to, or outflow from, a recipe process.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/RecipeFlow.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct RecipeFlow {
        /// Relates a process input or output to a verb, such as consume, produce, work, modify, etc.
        action: Box<action::Action>,
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The resource definition referenced by this flow in the recipe.
        #[builder(setter(into, strip_option), default)]
        recipe_flow_resource: Option<Box<recipe_resource::RecipeResource>>,
        /// Relates an input flow to its process in a recipe.
        #[builder(setter(into, strip_option), default)]
        recipe_input_of: Option<Box<recipe_process::RecipeProcess>>,
        /// Relates an output flow to its process in a recipe.
        #[builder(setter(into, strip_option), default)]
        recipe_output_of: Option<Box<recipe_process::RecipeProcess>>,
        /// The amount and unit of the economic resource counted or inventoried.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
    }
    
    impl RecipeFlow {
        /// Turns RecipeFlow into RecipeFlowBuilder
        pub fn into_builder(self) -> RecipeFlowBuilder {
            let RecipeFlow { action, effort_quantity, note, recipe_flow_resource, recipe_input_of, recipe_output_of, resource_quantity } = self;
            let mut builder = RecipeFlowBuilder::default();
            builder = builder.action(action);
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match recipe_flow_resource { Some(x) => builder.recipe_flow_resource(x), None => builder, };
            builder = match recipe_input_of { Some(x) => builder.recipe_input_of(x), None => builder, };
            builder = match recipe_output_of { Some(x) => builder.recipe_output_of(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder
        }
    }
}

pub mod recipe_process {
    use super::*;
    
    /// Specifies a process in a recipe for use in planning from recipe.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/RecipeProcess.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct RecipeProcess {
        /// The planned calendar duration of the process as defined for the recipe batch.
        #[builder(setter(into, strip_option), default)]
        has_duration: Option<Box<duration::Duration>>,
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// References a concept in a common taxonomy or other classification scheme for purposes of categorization.
        #[serde(with="crate::ser::url_vec")]
        process_classified_as: Vec<Url>,
        /// The standard specification or definition of a process.
        process_conforms_to: Box<process_specification::ProcessSpecification>,
    }
    
    impl RecipeProcess {
        /// Turns RecipeProcess into RecipeProcessBuilder
        pub fn into_builder(self) -> RecipeProcessBuilder {
            let RecipeProcess { has_duration, name, note, process_classified_as, process_conforms_to } = self;
            let mut builder = RecipeProcessBuilder::default();
            builder = match has_duration { Some(x) => builder.has_duration(x), None => builder, };
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = builder.process_classified_as(process_classified_as);
            builder = builder.process_conforms_to(process_conforms_to);
            builder
        }
    }
}

pub mod recipe_resource {
    use super::*;
    
    /// Specifies the resource as part of a recipe, for use in planning from recipe.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/RecipeResource.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct RecipeResource {
        /// The uri to an image relevant to the item, such as a photo, diagram, etc.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        image: Option<Url>,
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// References a concept in a common taxonomy or other classification scheme for purposes of categorization or grouping.
        #[serde(with="crate::ser::url_vec")]
        resource_classified_as: Vec<Url>,
        /// The primary resource specification or definition of an existing or potential economic resource. A resource will have only one, as this specifies exactly what the resource is.
        #[builder(setter(into, strip_option), default)]
        resource_conforms_to: Option<Box<resource_specification::ResourceSpecification>>,
        /// Defines if any resource of that type can be freely substituted for any other resource of that type when used, consumed, traded, etc.
        #[builder(setter(into, strip_option), default)]
        substitutable: Option<bool>,
        /// The unit used for use action on this resource or work or cite action in the recipe.
        #[builder(setter(into, strip_option), default)]
        unit_of_effort: Option<Box<unit::Unit>>,
        /// The unit of inventory used for this resource in the recipe.
        #[builder(setter(into, strip_option), default)]
        unit_of_resource: Option<Box<unit::Unit>>,
    }
    
    impl RecipeResource {
        /// Turns RecipeResource into RecipeResourceBuilder
        pub fn into_builder(self) -> RecipeResourceBuilder {
            let RecipeResource { image, name, note, resource_classified_as, resource_conforms_to, substitutable, unit_of_effort, unit_of_resource } = self;
            let mut builder = RecipeResourceBuilder::default();
            builder = match image { Some(x) => builder.image(x), None => builder, };
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = builder.resource_classified_as(resource_classified_as);
            builder = match resource_conforms_to { Some(x) => builder.resource_conforms_to(x), None => builder, };
            builder = match substitutable { Some(x) => builder.substitutable(x), None => builder, };
            builder = match unit_of_effort { Some(x) => builder.unit_of_effort(x), None => builder, };
            builder = match unit_of_resource { Some(x) => builder.unit_of_resource(x), None => builder, };
            builder
        }
    }
}

pub mod resource_specification {
    use super::*;
    
    /// Specification of a kind of resource. Could define a material item, service, digital item, currency account, etc.  Used instead of a classification when more information is needed, particularly for recipes.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/ResourceSpecification.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct ResourceSpecification {
        /// The uri to an image relevant to the item, such as a photo, diagram, etc.
        #[serde(with="crate::ser::url_opt")]
        #[builder(setter(into, strip_option), default)]
        image: Option<Url>,
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
    }
    
    impl ResourceSpecification {
        /// Turns ResourceSpecification into ResourceSpecificationBuilder
        pub fn into_builder(self) -> ResourceSpecificationBuilder {
            let ResourceSpecification { image, name, note } = self;
            let mut builder = ResourceSpecificationBuilder::default();
            builder = match image { Some(x) => builder.image(x), None => builder, };
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder
        }
    }
}

pub mod satisfaction {
    use super::*;
    
    /// Represents many-to-many relationships between intents and commitments or events that partially or full satisfy one or more intents.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Satisfaction.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Satisfaction {
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The amount and unit of the economic resource counted or inventoried.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
        /// A commitment or economic event fully or partially satisfying an intent.
        satisfied_by: Box<economic_event::EconomicEvent>,
        /// An intent satisfied fully or partially by an economic event or commitment.
        satisfies: Box<commitment::Commitment>,
    }
    
    impl Satisfaction {
        /// Turns Satisfaction into SatisfactionBuilder
        pub fn into_builder(self) -> SatisfactionBuilder {
            let Satisfaction { effort_quantity, note, resource_quantity, satisfied_by, satisfies } = self;
            let mut builder = SatisfactionBuilder::default();
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder = builder.satisfied_by(satisfied_by);
            builder = builder.satisfies(satisfies);
            builder
        }
    }
}

pub mod scenario {
    use super::*;
    
    /// An estimated or analytical logical collection of higher level processes used for budgeting, analysis, plan refinement, etc.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Scenario.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Scenario {
        /// The beginning date/time of the scenario, often the beginning of an accounting period.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_beginning: Option<DateTime<Utc>>,
        /// The ending date/time of the scenario, often the end of an accounting period.
        #[serde(with="crate::ser::datetime_opt")]
        #[builder(setter(into, strip_option), default)]
        has_end: Option<DateTime<Utc>>,
        /// Grouping around something to create a boundary or context, used for documenting, accounting, planning.
        #[builder(setter(into, strip_option), default)]
        in_scope_of: Option<Box<agent::Agent>>,
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// This scenario refines another scenario, often as time moves closer or for more detail.
        #[builder(setter(into, strip_option), default)]
        refinement_of: Option<Box<scenario::Scenario>>,
    }
    
    impl Scenario {
        /// Turns Scenario into ScenarioBuilder
        pub fn into_builder(self) -> ScenarioBuilder {
            let Scenario { has_beginning, has_end, in_scope_of, name, note, refinement_of } = self;
            let mut builder = ScenarioBuilder::default();
            builder = match has_beginning { Some(x) => builder.has_beginning(x), None => builder, };
            builder = match has_end { Some(x) => builder.has_end(x), None => builder, };
            builder = match in_scope_of { Some(x) => builder.in_scope_of(x), None => builder, };
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match refinement_of { Some(x) => builder.refinement_of(x), None => builder, };
            builder
        }
    }
}

pub mod scenario_definition {
    use super::*;
    
    /// The type definition of one or more scenarios, such as Yearly Budget.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/ScenarioDefinition.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct ScenarioDefinition {
        /// The duration of the scenario, often an accounting period.
        #[builder(setter(into, strip_option), default)]
        has_duration: Option<Box<duration::Duration>>,
        /// An informal or formal textual identifier for the item. Does not imply uniqueness.
        name: String,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
    }
    
    impl ScenarioDefinition {
        /// Turns ScenarioDefinition into ScenarioDefinitionBuilder
        pub fn into_builder(self) -> ScenarioDefinitionBuilder {
            let ScenarioDefinition { has_duration, name, note } = self;
            let mut builder = ScenarioDefinitionBuilder::default();
            builder = match has_duration { Some(x) => builder.has_duration(x), None => builder, };
            builder = builder.name(name);
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder
        }
    }
}

pub mod settlement {
    use super::*;
    
    /// Represents many-to-many relationships between claim and economic events that fully or partially settle one or more claims.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Settlement.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Settlement {
        /// The amount and unit of the work or use or citation effort-based action. This is often a time duration, but also could be cycle counts or other measures of effort or usefulness.
        #[builder(setter(into, strip_option), default)]
        effort_quantity: Option<Box<measure::Measure>>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
        /// The amount and unit of the economic resource counted or inventoried.
        #[builder(setter(into, strip_option), default)]
        resource_quantity: Option<Box<measure::Measure>>,
        /// The economic event fully or partially settling a claim.
        settled_by: Box<economic_event::EconomicEvent>,
        /// A claim that is fully or partially settled by an economic event.
        settles: Box<claim::Claim>,
    }
    
    impl Settlement {
        /// Turns Settlement into SettlementBuilder
        pub fn into_builder(self) -> SettlementBuilder {
            let Settlement { effort_quantity, note, resource_quantity, settled_by, settles } = self;
            let mut builder = SettlementBuilder::default();
            builder = match effort_quantity { Some(x) => builder.effort_quantity(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder = match resource_quantity { Some(x) => builder.resource_quantity(x), None => builder, };
            builder = builder.settled_by(settled_by);
            builder = builder.settles(settles);
            builder
        }
    }
}

pub mod spatial_thing {
    use super::*;
    
    /// A mappable location.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/SpatialThing.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct SpatialThing {
        /// Altitude.
        #[builder(setter(into, strip_option), default)]
        alt: Option<f64>,
        /// Latitude.
        #[builder(setter(into, strip_option), default)]
        lat: Option<f64>,
        /// Longitude.
        #[builder(setter(into, strip_option), default)]
        long: Option<f64>,
        /// A textual address that can be mapped by standard mapping software.
        #[builder(setter(into, strip_option), default)]
        mappable_address: Option<String>,
        /// An informal or formal textual identifier for a location. Does not imply uniqueness.
        #[builder(setter(into, strip_option), default)]
        name: Option<String>,
        /// A textual comment or description.
        #[builder(setter(into, strip_option), default)]
        note: Option<String>,
    }
    
    impl SpatialThing {
        /// Turns SpatialThing into SpatialThingBuilder
        pub fn into_builder(self) -> SpatialThingBuilder {
            let SpatialThing { alt, lat, long, mappable_address, name, note } = self;
            let mut builder = SpatialThingBuilder::default();
            builder = match alt { Some(x) => builder.alt(x), None => builder, };
            builder = match lat { Some(x) => builder.lat(x), None => builder, };
            builder = match long { Some(x) => builder.long(x), None => builder, };
            builder = match mappable_address { Some(x) => builder.mappable_address(x), None => builder, };
            builder = match name { Some(x) => builder.name(x), None => builder, };
            builder = match note { Some(x) => builder.note(x), None => builder, };
            builder
        }
    }
}

pub mod unit {
    use super::*;
    
    /// A unit of measure.
    ///
    /// ID: https://raw.githubusercontent.com/valueflows/valueflows/master/json-schemas/Unit.json
    #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Builder, Getters)]
    #[derive(Setters)]
    #[derive(MutGetters)]
    #[builder(pattern = "owned")]
    #[getset(get = "pub", set = "pub", get_mut = "pub")]
    pub struct Unit {
        /// A standard label for the unit of measure.
        label: String,
        /// A standard symbol of the unit of measure.
        #[builder(setter(into, strip_option), default)]
        symbol: Option<String>,
    }
    
    impl Unit {
        /// Turns Unit into UnitBuilder
        pub fn into_builder(self) -> UnitBuilder {
            let Unit { label, symbol } = self;
            let mut builder = UnitBuilder::default();
            builder = builder.label(label);
            builder = match symbol { Some(x) => builder.symbol(x), None => builder, };
            builder
        }
    }
}