oscal 0.1.1

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

//!Generated OSCAL types for the `profile` model.
#![allow(clippy::doc_markdown)]
use serde::{Deserialize, Serialize};
use super::common::*;
/// Error returned when a required field was not set before calling `build()`.
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
pub enum BuildError {
    #[error("missing required field: {0}")]
    MissingField(&'static str),
}
///Each OSCAL profile is defined by aprofileelement.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Profile {
    ///Provides a globally unique means to identify a given profile instance.
    pub uuid: uuid::Uuid,
    ///
    pub metadata: Metadata,
    ///
    #[serde(default)]
    pub imports: Vec<Import>,
    ///
    #[serde(skip_serializing_if = "Option::is_none")]
    pub merge: Option<Merge>,
    ///
    #[serde(skip_serializing_if = "Option::is_none")]
    pub modify: Option<Modify>,
    ///
    #[serde(skip_serializing_if = "Option::is_none")]
    pub back_matter: Option<BackMatter>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct ProfileBuilder {
    uuid: Option<uuid::Uuid>,
    metadata: Option<Metadata>,
    imports: Vec<Import>,
    merge: Option<Merge>,
    modify: Option<Modify>,
    back_matter: Option<BackMatter>,
}
impl ProfileBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            uuid: None,
            metadata: None,
            imports: Vec::new(),
            merge: None,
            modify: None,
            back_matter: None,
        }
    }
}
impl Default for ProfileBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl ProfileBuilder {
    ///Set the `uuid` field.
    pub fn uuid(mut self, v: impl Into<uuid::Uuid>) -> Self {
        self.uuid = Some(v.into());
        self
    }
    ///Set the `metadata` field.
    pub fn metadata(mut self, v: impl Into<Metadata>) -> Self {
        self.metadata = Some(v.into());
        self
    }
    ///Set the `imports` field.
    pub fn imports(mut self, v: impl Into<Import>) -> Self {
        self.imports.push(v.into());
        self
    }
    ///Set the `merge` field.
    pub fn merge(mut self, v: impl Into<Merge>) -> Self {
        self.merge = Some(v.into());
        self
    }
    ///Set the `modify` field.
    pub fn modify(mut self, v: impl Into<Modify>) -> Self {
        self.modify = Some(v.into());
        self
    }
    ///Set the `back-matter` field.
    pub fn back_matter(mut self, v: impl Into<BackMatter>) -> Self {
        self.back_matter = Some(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Profile, BuildError> {
        let uuid = self
            .uuid
            .ok_or_else(|| BuildError::MissingField("required field `uuid` not set"))?;
        let metadata = self
            .metadata
            .ok_or_else(|| BuildError::MissingField(
                "required field `metadata` not set",
            ))?;
        Ok(Profile {
            uuid,
            metadata,
            imports: self.imports,
            merge: self.merge,
            modify: self.modify,
            back_matter: self.back_matter,
        })
    }
}
impl Profile {
    /// Return a new builder for this type.
    pub fn builder() -> ProfileBuilder {
        ProfileBuilder::new()
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ImportChoice1 {
    IncludeAll(IncludeAll),
    SelectControlById(Vec<SelectControlById>),
}
///Designates a referenced source catalog or profile that provides a source of control information for use in creating a new overlay or baseline.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Import {
    ///A resolvable URL reference to the base catalog or profile that this profile is tailoring.
    pub href: crate::primitives::UriReference,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub import_choice1: Option<ImportChoice1>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub exclude_controls: Vec<SelectControlById>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct ImportBuilder {
    href: Option<crate::primitives::UriReference>,
    import_choice1: Option<ImportChoice1>,
    exclude_controls: Vec<SelectControlById>,
}
impl ImportBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            href: None,
            import_choice1: None,
            exclude_controls: Vec::new(),
        }
    }
}
impl Default for ImportBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl ImportBuilder {
    ///Set the `href` field.
    pub fn href(mut self, v: impl Into<crate::primitives::UriReference>) -> Self {
        self.href = Some(v.into());
        self
    }
    ///Set the `import_choice1` field.
    pub fn import_choice1(mut self, v: impl Into<ImportChoice1>) -> Self {
        self.import_choice1 = Some(v.into());
        self
    }
    ///Set the `exclude-controls` field.
    pub fn exclude_controls(mut self, v: impl Into<SelectControlById>) -> Self {
        self.exclude_controls.push(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Import, BuildError> {
        let href = self
            .href
            .ok_or_else(|| BuildError::MissingField("required field `href` not set"))?;
        Ok(Import {
            href,
            import_choice1: self.import_choice1,
            exclude_controls: self.exclude_controls,
        })
    }
}
impl Import {
    /// Return a new builder for this type.
    pub fn builder() -> ImportBuilder {
        ImportBuilder::new()
    }
}
///A Combine element defines how to resolve duplicate instances of the same control (e.g., controls with the same ID).
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Combine {
    ///Declare how clashing controls should be handled.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub method: Option<String>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct CombineBuilder {
    method: Option<String>,
}
impl CombineBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self { method: None }
    }
}
impl Default for CombineBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl CombineBuilder {
    ///Set the `method` field.
    pub fn method(mut self, v: impl Into<String>) -> Self {
        self.method = Some(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Combine, BuildError> {
        Ok(Combine { method: self.method })
    }
}
impl Combine {
    /// Return a new builder for this type.
    pub fn builder() -> CombineBuilder {
        CombineBuilder::new()
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MergeChoice1 {}
///Provides structuring directives that instruct how controls are organized after profile resolution.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Merge {
    ///A Combine element defines how to resolve duplicate instances of the same control (e.g., controls with the same ID).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub combine: Option<Combine>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub merge_choice1: Option<MergeChoice1>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct MergeBuilder {
    combine: Option<Combine>,
    merge_choice1: Option<MergeChoice1>,
}
impl MergeBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            combine: None,
            merge_choice1: None,
        }
    }
}
impl Default for MergeBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl MergeBuilder {
    ///Set the `combine` field.
    pub fn combine(mut self, v: impl Into<Combine>) -> Self {
        self.combine = Some(v.into());
        self
    }
    ///Set the `merge_choice1` field.
    pub fn merge_choice1(mut self, v: impl Into<MergeChoice1>) -> Self {
        self.merge_choice1 = Some(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Merge, BuildError> {
        Ok(Merge {
            combine: self.combine,
            merge_choice1: self.merge_choice1,
        })
    }
}
impl Merge {
    /// Return a new builder for this type.
    pub fn builder() -> MergeBuilder {
        MergeBuilder::new()
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SetParameterChoice1 {
    ParameterValue(Vec<String>),
    ParameterSelection(Option<ParameterSelection>),
}
///A parameter setting, to be propagated to points of insertion.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct SetParameter {
    ///An identifier for the parameter.
    pub param_id: String,
    ///A textual label that provides a characterization of the parameter.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub class: Option<String>,
    ///**(deprecated)** Another parameter invoking this one. This construct has been deprecated and should not be used.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub depends_on: Option<String>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub props: Vec<Property>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub links: Vec<Link>,
    ///A short, placeholder name for the parameter, which can be used as a substitute for avalueif no value is assigned.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub label: Option<crate::primitives::MarkupLine>,
    ///Describes the purpose and use of a parameter.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub usage: Option<crate::primitives::MarkupMultiline>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub constraints: Vec<ParameterConstraint>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub guidelines: Vec<ParameterGuideline>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub set_parameter_choice1: Option<SetParameterChoice1>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct SetParameterBuilder {
    param_id: Option<String>,
    class: Option<String>,
    depends_on: Option<String>,
    props: Vec<Property>,
    links: Vec<Link>,
    label: Option<crate::primitives::MarkupLine>,
    usage: Option<crate::primitives::MarkupMultiline>,
    constraints: Vec<ParameterConstraint>,
    guidelines: Vec<ParameterGuideline>,
    set_parameter_choice1: Option<SetParameterChoice1>,
}
impl SetParameterBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            param_id: None,
            class: None,
            depends_on: None,
            props: Vec::new(),
            links: Vec::new(),
            label: None,
            usage: None,
            constraints: Vec::new(),
            guidelines: Vec::new(),
            set_parameter_choice1: None,
        }
    }
}
impl Default for SetParameterBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl SetParameterBuilder {
    ///Set the `param-id` field.
    pub fn param_id(mut self, v: impl Into<String>) -> Self {
        self.param_id = Some(v.into());
        self
    }
    ///Set the `class` field.
    pub fn class(mut self, v: impl Into<String>) -> Self {
        self.class = Some(v.into());
        self
    }
    ///Set the `depends-on` field.
    pub fn depends_on(mut self, v: impl Into<String>) -> Self {
        self.depends_on = Some(v.into());
        self
    }
    ///Set the `props` field.
    pub fn props(mut self, v: impl Into<Property>) -> Self {
        self.props.push(v.into());
        self
    }
    ///Set the `links` field.
    pub fn links(mut self, v: impl Into<Link>) -> Self {
        self.links.push(v.into());
        self
    }
    ///Set the `label` field.
    pub fn label(mut self, v: impl Into<crate::primitives::MarkupLine>) -> Self {
        self.label = Some(v.into());
        self
    }
    ///Set the `usage` field.
    pub fn usage(mut self, v: impl Into<crate::primitives::MarkupMultiline>) -> Self {
        self.usage = Some(v.into());
        self
    }
    ///Set the `constraints` field.
    pub fn constraints(mut self, v: impl Into<ParameterConstraint>) -> Self {
        self.constraints.push(v.into());
        self
    }
    ///Set the `guidelines` field.
    pub fn guidelines(mut self, v: impl Into<ParameterGuideline>) -> Self {
        self.guidelines.push(v.into());
        self
    }
    ///Set the `set_parameter_choice1` field.
    pub fn set_parameter_choice1(mut self, v: impl Into<SetParameterChoice1>) -> Self {
        self.set_parameter_choice1 = Some(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<SetParameter, BuildError> {
        let param_id = self
            .param_id
            .ok_or_else(|| BuildError::MissingField(
                "required field `param-id` not set",
            ))?;
        Ok(SetParameter {
            param_id,
            class: self.class,
            depends_on: self.depends_on,
            props: self.props,
            links: self.links,
            label: self.label,
            usage: self.usage,
            constraints: self.constraints,
            guidelines: self.guidelines,
            set_parameter_choice1: self.set_parameter_choice1,
        })
    }
}
impl SetParameter {
    /// Return a new builder for this type.
    pub fn builder() -> SetParameterBuilder {
        SetParameterBuilder::new()
    }
}
///Specifies objects to be removed from a control based on specific aspects of the object that must all match.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Remove {
    ///Identify items remove by matching their assigned name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub by_name: Option<String>,
    ///Identify items to remove by matching theirclass.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub by_class: Option<String>,
    ///Identify items to remove indicated by theirid.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub by_id: Option<String>,
    ///Identify items to remove by the name of the item's information object name, e.g.titleorprop.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub by_item_name: Option<String>,
    ///Identify items to remove by the item'sns, which is the namespace associated with apart, orprop.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub by_ns: Option<url::Url>,
    ///
    #[serde(skip_serializing_if = "Option::is_none")]
    pub remarks: Option<crate::primitives::MarkupMultiline>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct RemoveBuilder {
    by_name: Option<String>,
    by_class: Option<String>,
    by_id: Option<String>,
    by_item_name: Option<String>,
    by_ns: Option<url::Url>,
    remarks: Option<crate::primitives::MarkupMultiline>,
}
impl RemoveBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            by_name: None,
            by_class: None,
            by_id: None,
            by_item_name: None,
            by_ns: None,
            remarks: None,
        }
    }
}
impl Default for RemoveBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl RemoveBuilder {
    ///Set the `by-name` field.
    pub fn by_name(mut self, v: impl Into<String>) -> Self {
        self.by_name = Some(v.into());
        self
    }
    ///Set the `by-class` field.
    pub fn by_class(mut self, v: impl Into<String>) -> Self {
        self.by_class = Some(v.into());
        self
    }
    ///Set the `by-id` field.
    pub fn by_id(mut self, v: impl Into<String>) -> Self {
        self.by_id = Some(v.into());
        self
    }
    ///Set the `by-item-name` field.
    pub fn by_item_name(mut self, v: impl Into<String>) -> Self {
        self.by_item_name = Some(v.into());
        self
    }
    ///Set the `by-ns` field.
    pub fn by_ns(mut self, v: impl Into<url::Url>) -> Self {
        self.by_ns = Some(v.into());
        self
    }
    ///Set the `remarks` field.
    pub fn remarks(mut self, v: impl Into<crate::primitives::MarkupMultiline>) -> Self {
        self.remarks = Some(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Remove, BuildError> {
        Ok(Remove {
            by_name: self.by_name,
            by_class: self.by_class,
            by_id: self.by_id,
            by_item_name: self.by_item_name,
            by_ns: self.by_ns,
            remarks: self.remarks,
        })
    }
}
impl Remove {
    /// Return a new builder for this type.
    pub fn builder() -> RemoveBuilder {
        RemoveBuilder::new()
    }
}
///Specifies contents to be added into controls, in resolution.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Add {
    ///Where to add the new content with respect to the targeted element (beside it or inside it).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub position: Option<String>,
    ///Target location of the addition.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub by_id: Option<String>,
    ///A name given to the control, which may be used by a tool for display and navigation.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<crate::primitives::MarkupLine>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub params: Vec<Parameter>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub props: Vec<Property>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub links: Vec<Link>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub parts: Vec<Part>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct AddBuilder {
    position: Option<String>,
    by_id: Option<String>,
    title: Option<crate::primitives::MarkupLine>,
    params: Vec<Parameter>,
    props: Vec<Property>,
    links: Vec<Link>,
    parts: Vec<Part>,
}
impl AddBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            position: None,
            by_id: None,
            title: None,
            params: Vec::new(),
            props: Vec::new(),
            links: Vec::new(),
            parts: Vec::new(),
        }
    }
}
impl Default for AddBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl AddBuilder {
    ///Set the `position` field.
    pub fn position(mut self, v: impl Into<String>) -> Self {
        self.position = Some(v.into());
        self
    }
    ///Set the `by-id` field.
    pub fn by_id(mut self, v: impl Into<String>) -> Self {
        self.by_id = Some(v.into());
        self
    }
    ///Set the `title` field.
    pub fn title(mut self, v: impl Into<crate::primitives::MarkupLine>) -> Self {
        self.title = Some(v.into());
        self
    }
    ///Set the `params` field.
    pub fn params(mut self, v: impl Into<Parameter>) -> Self {
        self.params.push(v.into());
        self
    }
    ///Set the `props` field.
    pub fn props(mut self, v: impl Into<Property>) -> Self {
        self.props.push(v.into());
        self
    }
    ///Set the `links` field.
    pub fn links(mut self, v: impl Into<Link>) -> Self {
        self.links.push(v.into());
        self
    }
    ///Set the `parts` field.
    pub fn parts(mut self, v: impl Into<Part>) -> Self {
        self.parts.push(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Add, BuildError> {
        Ok(Add {
            position: self.position,
            by_id: self.by_id,
            title: self.title,
            params: self.params,
            props: self.props,
            links: self.links,
            parts: self.parts,
        })
    }
}
impl Add {
    /// Return a new builder for this type.
    pub fn builder() -> AddBuilder {
        AddBuilder::new()
    }
}
///Specifies changes to be made to an included control when a profile is resolved.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Alter {
    ///
    pub control_id: String,
    ///Specifies objects to be removed from a control based on specific aspects of the object that must all match.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub remove: Vec<Remove>,
    ///Specifies contents to be added into controls, in resolution.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub add: Vec<Add>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct AlterBuilder {
    control_id: Option<String>,
    remove: Vec<Remove>,
    add: Vec<Add>,
}
impl AlterBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            control_id: None,
            remove: Vec::new(),
            add: Vec::new(),
        }
    }
}
impl Default for AlterBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl AlterBuilder {
    ///Set the `control-id` field.
    pub fn control_id(mut self, v: impl Into<String>) -> Self {
        self.control_id = Some(v.into());
        self
    }
    ///Set the `remove` field.
    pub fn remove(mut self, v: impl Into<Remove>) -> Self {
        self.remove.push(v.into());
        self
    }
    ///Set the `add` field.
    pub fn add(mut self, v: impl Into<Add>) -> Self {
        self.add.push(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Alter, BuildError> {
        let control_id = self
            .control_id
            .ok_or_else(|| BuildError::MissingField(
                "required field `control-id` not set",
            ))?;
        Ok(Alter {
            control_id,
            remove: self.remove,
            add: self.add,
        })
    }
}
impl Alter {
    /// Return a new builder for this type.
    pub fn builder() -> AlterBuilder {
        AlterBuilder::new()
    }
}
///Set parameters or amend controls in resolution.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Modify {
    ///A parameter setting, to be propagated to points of insertion.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub set_parameter: Vec<SetParameter>,
    ///Specifies changes to be made to an included control when a profile is resolved.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub alter: Vec<Alter>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct ModifyBuilder {
    set_parameter: Vec<SetParameter>,
    alter: Vec<Alter>,
}
impl ModifyBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            set_parameter: Vec::new(),
            alter: Vec::new(),
        }
    }
}
impl Default for ModifyBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl ModifyBuilder {
    ///Set the `set-parameter` field.
    pub fn set_parameter(mut self, v: impl Into<SetParameter>) -> Self {
        self.set_parameter.push(v.into());
        self
    }
    ///Set the `alter` field.
    pub fn alter(mut self, v: impl Into<Alter>) -> Self {
        self.alter.push(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<Modify, BuildError> {
        Ok(Modify {
            set_parameter: self.set_parameter,
            alter: self.alter,
        })
    }
}
impl Modify {
    /// Return a new builder for this type.
    pub fn builder() -> ModifyBuilder {
        ModifyBuilder::new()
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum InsertControlsChoice1 {
    IncludeAll(IncludeAll),
    SelectControlById(Vec<SelectControlById>),
}
///Specifies which controls to use in the containing context.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct InsertControls {
    ///A designation of how a selection of controls in a profile is to be ordered.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub order: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub insert_controls_choice1: Option<InsertControlsChoice1>,
    ///
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub exclude_controls: Vec<SelectControlById>,
}
/// Builder for [`#struct_name`].
///
/// Construct via [`#struct_name::builder()`], chain setters, then call
/// [`#builder_name::build()`].
#[must_use]
#[derive(Debug)]
pub struct InsertControlsBuilder {
    order: Option<String>,
    insert_controls_choice1: Option<InsertControlsChoice1>,
    exclude_controls: Vec<SelectControlById>,
}
impl InsertControlsBuilder {
    /// Create an empty builder with all fields unset.
    pub fn new() -> Self {
        Self {
            order: None,
            insert_controls_choice1: None,
            exclude_controls: Vec::new(),
        }
    }
}
impl Default for InsertControlsBuilder {
    fn default() -> Self {
        Self::new()
    }
}
impl InsertControlsBuilder {
    ///Set the `order` field.
    pub fn order(mut self, v: impl Into<String>) -> Self {
        self.order = Some(v.into());
        self
    }
    ///Set the `insert_controls_choice1` field.
    pub fn insert_controls_choice1(
        mut self,
        v: impl Into<InsertControlsChoice1>,
    ) -> Self {
        self.insert_controls_choice1 = Some(v.into());
        self
    }
    ///Set the `exclude-controls` field.
    pub fn exclude_controls(mut self, v: impl Into<SelectControlById>) -> Self {
        self.exclude_controls.push(v.into());
        self
    }
    /// Consume the builder and return a fully constructed [`#struct_name`].
    ///
    /// # Errors
    ///
    /// Returns [`BuildError::MissingField`] if any required field was not set.
    pub fn build(self) -> ::core::result::Result<InsertControls, BuildError> {
        Ok(InsertControls {
            order: self.order,
            insert_controls_choice1: self.insert_controls_choice1,
            exclude_controls: self.exclude_controls,
        })
    }
}
impl InsertControls {
    /// Return a new builder for this type.
    pub fn builder() -> InsertControlsBuilder {
        InsertControlsBuilder::new()
    }
}