roscal_lib/assessment/
assessment_plan.rs

1use derivative::Derivative;
2use strum::EnumString;
3use derive_builder::Builder;
4use serde::{Serialize, Deserialize};
5use crate::validation;
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "kebab-case")]
9#[derive(Builder, Derivative)]
10#[builder(setter(into, strip_option))]
11#[derivative(PartialEq)]
12#[serde(deny_unknown_fields)]
13pub struct AssessmentPlan {
14    #[serde(rename = "$schema")]
15    #[builder(setter(into, strip_option), default)]
16    #[serde(default, skip_serializing_if = "Option::is_none")]
17    pub schema: Option<String>,
18    pub assessment_plan: SecurityAssessmentPlanSap,
19}
20
21/// An assessment plan, such as those provided by a FedRAMP assessor.
22#[derive(Debug, Clone, Serialize, Deserialize)]
23#[serde(rename_all = "kebab-case")]
24#[derive(Builder, Derivative)]
25#[builder(setter(into, strip_option))]
26#[derivative(PartialEq)]
27#[serde(deny_unknown_fields)]
28pub struct SecurityAssessmentPlanSap {
29    #[builder(setter(into, strip_option), default)]
30    #[serde(default, skip_serializing_if = "Option::is_none")]
31    pub assessment_assets: Option<AssessmentAssets>,
32    #[builder(setter(into, strip_option), default)]
33    #[serde(default, skip_serializing_if = "Option::is_none")]
34    pub assessment_subjects: Option<Vec<SubjectOfAssessment>>,
35    #[builder(setter(into, strip_option), default)]
36    #[serde(default, skip_serializing_if = "Option::is_none")]
37    pub back_matter: Option<BackMatter>,
38    pub import_ssp: ImportSystemSecurityPlan,
39    /// Used to define data objects that are used in the assessment plan, that do not appear in
40    /// the referenced SSP.
41    #[builder(setter(into, strip_option), default)]
42    #[serde(default, skip_serializing_if = "Option::is_none")]
43    pub local_definitions: Option<LocalDefinitions>,
44    pub metadata: DocumentMetadata,
45    pub reviewed_controls: ReviewedControlsAndControlObjectives,
46    #[builder(setter(into, strip_option), default)]
47    #[serde(default, skip_serializing_if = "Option::is_none")]
48    pub tasks: Option<Vec<Task>>,
49    /// Used to define various terms and conditions under which an assessment, described by the
50    /// plan, can be performed. Each child part defines a different type of term or condition.
51    #[builder(setter(into, strip_option), default)]
52    #[serde(default, skip_serializing_if = "Option::is_none")]
53    pub terms_and_conditions: Option<AssessmentPlanTermsAndConditions>,
54    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
55    /// to reference this assessment plan in this or other OSCAL instances. The locally defined
56    /// UUID of the assessment plan can be used to reference the data item locally or globally
57    /// (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject, which
58    /// means it should be consistently used to identify the same subject across revisions of the
59    /// document.
60    #[serde(
61        serialize_with = "validation::ser_uuid",
62        deserialize_with = "validation::deser_uuid"
63    )]
64    #[derivative(PartialEq = "ignore")]
65    pub uuid: String,
66}
67
68/// Identifies the assets used to perform this assessment, such as the assessment team,
69/// scanning tools, and assumptions.
70#[derive(Debug, Clone, Serialize, Deserialize)]
71#[serde(rename_all = "kebab-case")]
72#[derive(Builder, Derivative)]
73#[builder(setter(into, strip_option))]
74#[derivative(PartialEq)]
75#[serde(deny_unknown_fields)]
76pub struct AssessmentAssets {
77    pub assessment_platforms: Vec<AssessmentPlatform>,
78    #[builder(setter(into, strip_option), default)]
79    #[serde(default, skip_serializing_if = "Option::is_none")]
80    pub components: Option<Vec<Component>>,
81}
82
83/// Used to represent the toolset used to perform aspects of the assessment.
84#[derive(Debug, Clone, Serialize, Deserialize)]
85#[serde(rename_all = "kebab-case")]
86#[derive(Builder, Derivative)]
87#[builder(setter(into, strip_option))]
88#[derivative(PartialEq)]
89#[serde(deny_unknown_fields)]
90pub struct AssessmentPlatform {
91    #[builder(setter(into, strip_option), default)]
92    #[serde(default, skip_serializing_if = "Option::is_none")]
93    pub links: Option<Vec<Link>>,
94    #[builder(setter(into, strip_option), default)]
95    #[serde(default, skip_serializing_if = "Option::is_none")]
96    pub props: Option<Vec<Property>>,
97    #[builder(setter(into, strip_option), default)]
98    #[serde(default, skip_serializing_if = "Option::is_none")]
99    #[serde(deserialize_with = "validation::deser_markup_opt")]
100    pub remarks: Option<String>,
101    /// The title or name for the assessment platform.
102    #[builder(setter(into, strip_option), default)]
103    #[serde(default, skip_serializing_if = "Option::is_none")]
104    #[serde(deserialize_with = "validation::deser_markup_opt")]
105    pub title: Option<String>,
106    #[builder(setter(into, strip_option), default)]
107    #[serde(default, skip_serializing_if = "Option::is_none")]
108    pub uses_components: Option<Vec<UsesComponent>>,
109    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
110    /// to reference this assessment platform elsewhere in this or other OSCAL instances. The
111    /// locally defined UUID of the assessment platform can be used to reference the data item
112    /// locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned
113    /// per-subject, which means it should be consistently used to identify the same subject
114    /// across revisions of the document.
115    #[serde(
116        serialize_with = "validation::ser_uuid",
117        deserialize_with = "validation::deser_uuid"
118    )]
119    #[derivative(PartialEq = "ignore")]
120    pub uuid: String,
121}
122
123/// A reference to a local or remote resource, that has a specific relation to the containing
124/// object.
125#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(rename_all = "kebab-case")]
127#[derive(Builder, Derivative)]
128#[builder(setter(into, strip_option))]
129#[derivative(PartialEq)]
130#[serde(deny_unknown_fields)]
131pub struct Link {
132    /// A resolvable URL reference to a resource.
133    #[serde(
134        serialize_with = "validation::ser_uri_ref",
135        deserialize_with = "validation::deser_uri_ref"
136    )]
137    pub href: String,
138    /// A label that indicates the nature of a resource, as a data serialization or format.
139    #[builder(setter(into, strip_option), default)]
140    #[serde(default, skip_serializing_if = "Option::is_none")]
141    pub media_type: Option<String>,
142    /// Describes the type of relationship provided by the link's hypertext reference. This can
143    /// be an indicator of the link's purpose.
144    #[builder(setter(into, strip_option), default)]
145    #[serde(default, skip_serializing_if = "Option::is_none")]
146    #[serde(
147        serialize_with = "validation::ser_token_opt",
148        deserialize_with = "validation::deser_token_opt"
149    )]
150    pub rel: Option<String>,
151    /// In case where the href points to a back-matter/resource, this value will indicate the URI
152    /// fragment to append to any rlink associated with the resource. This value MUST be URI
153    /// encoded.
154    #[builder(setter(into, strip_option), default)]
155    #[serde(default, skip_serializing_if = "Option::is_none")]
156    pub resource_fragment: Option<String>,
157    /// A textual label to associate with the link, which may be used for presentation in a tool.
158    #[builder(setter(into, strip_option), default)]
159    #[serde(default, skip_serializing_if = "Option::is_none")]
160    #[serde(deserialize_with = "validation::deser_markup_opt")]
161    pub text: Option<String>,
162}
163
164/// An attribute, characteristic, or quality of the containing object expressed as a
165/// namespace qualified name/value pair.
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[derive(Builder, Derivative)]
168#[builder(setter(into, strip_option))]
169#[derivative(PartialEq)]
170#[serde(deny_unknown_fields)]
171pub struct Property {
172    /// A textual label that provides a sub-type or characterization of the property's name.
173    #[builder(setter(into, strip_option), default)]
174    #[serde(default, skip_serializing_if = "Option::is_none")]
175    #[serde(
176        serialize_with = "validation::ser_token_opt",
177        deserialize_with = "validation::deser_token_opt"
178    )]
179    pub class: Option<String>,
180    /// An identifier for relating distinct sets of properties.
181    #[builder(setter(into, strip_option), default)]
182    #[serde(default, skip_serializing_if = "Option::is_none")]
183    #[serde(
184        serialize_with = "validation::ser_token_opt",
185        deserialize_with = "validation::deser_token_opt"
186    )]
187    pub group: Option<String>,
188    /// A textual label, within a namespace, that uniquely identifies a specific attribute,
189    /// characteristic, or quality of the property's containing object.
190    #[serde(
191        serialize_with = "validation::ser_token",
192        deserialize_with = "validation::deser_token"
193    )]
194    pub name: String,
195    /// A namespace qualifying the property's name. This allows different organizations to
196    /// associate distinct semantics with the same name.
197    #[builder(setter(into, strip_option), default)]
198    #[serde(default, skip_serializing_if = "Option::is_none")]
199    #[serde(
200        serialize_with = "validation::ser_uri_opt",
201        deserialize_with = "validation::deser_uri_opt"
202    )]
203    pub ns: Option<String>,
204    #[builder(setter(into, strip_option), default)]
205    #[serde(default, skip_serializing_if = "Option::is_none")]
206    #[serde(deserialize_with = "validation::deser_markup_opt")]
207    pub remarks: Option<String>,
208    /// A unique identifier for a property.
209    #[builder(setter(into, strip_option), default)]
210    #[serde(default, skip_serializing_if = "Option::is_none")]
211    #[serde(
212        serialize_with = "validation::ser_uuid_opt",
213        deserialize_with = "validation::deser_uuid_opt"
214    )]
215    #[derivative(PartialEq = "ignore")]
216    pub uuid: Option<String>,
217    /// Indicates the value of the attribute, characteristic, or quality.
218    pub value: String,
219}
220
221/// The set of components that are used by the assessment platform.
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(rename_all = "kebab-case")]
224#[derive(Builder, Derivative)]
225#[builder(setter(into, strip_option))]
226#[derivative(PartialEq)]
227#[serde(deny_unknown_fields)]
228pub struct UsesComponent {
229    /// A machine-oriented identifier reference to a component that is implemented as part of an
230    /// inventory item.
231    #[derivative(PartialEq = "ignore")]
232    #[serde(
233        serialize_with = "validation::ser_uuid",
234        deserialize_with = "validation::deser_uuid"
235    )]
236    pub component_uuid: String,
237    #[builder(setter(into, strip_option), default)]
238    #[serde(default, skip_serializing_if = "Option::is_none")]
239    pub links: Option<Vec<Link>>,
240    #[builder(setter(into, strip_option), default)]
241    #[serde(default, skip_serializing_if = "Option::is_none")]
242    pub props: Option<Vec<Property>>,
243    #[builder(setter(into, strip_option), default)]
244    #[serde(default, skip_serializing_if = "Option::is_none")]
245    #[serde(deserialize_with = "validation::deser_markup_opt")]
246    pub remarks: Option<String>,
247    #[builder(setter(into, strip_option), default)]
248    #[serde(default, skip_serializing_if = "Option::is_none")]
249    pub responsible_parties: Option<Vec<ResponsibleParty>>,
250}
251
252/// A reference to a set of persons and/or organizations that have responsibility for
253/// performing the referenced role in the context of the containing object.
254#[derive(Debug, Clone, Serialize, Deserialize)]
255#[serde(rename_all = "kebab-case")]
256#[derive(Builder, Derivative)]
257#[builder(setter(into, strip_option))]
258#[derivative(PartialEq)]
259#[serde(deny_unknown_fields)]
260pub struct ResponsibleParty {
261    #[builder(setter(into, strip_option), default)]
262    #[serde(default, skip_serializing_if = "Option::is_none")]
263    pub links: Option<Vec<Link>>,
264    #[serde(
265        serialize_with = "validation::ser_uuid_vec",
266        deserialize_with = "validation::deser_uuid_vec"
267    )]
268    pub party_uuids: Vec<String>,
269    #[builder(setter(into, strip_option), default)]
270    #[serde(default, skip_serializing_if = "Option::is_none")]
271    pub props: Option<Vec<Property>>,
272    #[builder(setter(into, strip_option), default)]
273    #[serde(default, skip_serializing_if = "Option::is_none")]
274    #[serde(deserialize_with = "validation::deser_markup_opt")]
275    pub remarks: Option<String>,
276    /// A reference to a role performed by a party.
277    #[serde(
278        serialize_with = "validation::ser_token",
279        deserialize_with = "validation::deser_token"
280    )]
281    pub role_id: String,
282}
283
284/// A defined component that can be part of an implemented system.
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(rename_all = "kebab-case")]
287#[derive(Builder, Derivative)]
288#[builder(setter(into, strip_option))]
289#[derivative(PartialEq)]
290#[serde(deny_unknown_fields)]
291pub struct Component {
292    /// A description of the component, including information about its function.
293    #[serde(deserialize_with = "validation::deser_markup")]
294    pub description: String,
295    #[builder(setter(into, strip_option), default)]
296    #[serde(default, skip_serializing_if = "Option::is_none")]
297    pub links: Option<Vec<Link>>,
298    #[builder(setter(into, strip_option), default)]
299    #[serde(default, skip_serializing_if = "Option::is_none")]
300    pub props: Option<Vec<Property>>,
301    #[builder(setter(into, strip_option), default)]
302    #[serde(default, skip_serializing_if = "Option::is_none")]
303    pub protocols: Option<Vec<ServiceProtocolInformation>>,
304    /// A summary of the technological or business purpose of the component.
305    #[builder(setter(into, strip_option), default)]
306    #[serde(default, skip_serializing_if = "Option::is_none")]
307    #[serde(deserialize_with = "validation::deser_markup_opt")]
308    pub purpose: Option<String>,
309    #[builder(setter(into, strip_option), default)]
310    #[serde(default, skip_serializing_if = "Option::is_none")]
311    #[serde(deserialize_with = "validation::deser_markup_opt")]
312    pub remarks: Option<String>,
313    #[builder(setter(into, strip_option), default)]
314    #[serde(default, skip_serializing_if = "Option::is_none")]
315    pub responsible_roles: Option<Vec<ResponsibleRole>>,
316    /// Describes the operational status of the system component.
317    pub status: Status,
318    /// A human readable name for the system component.
319    #[serde(deserialize_with = "validation::deser_markup")]
320    pub title: String,
321    /// A category describing the purpose of the component.
322    #[serde(rename = "type")]
323    #[serde(
324        serialize_with = "validation::ser_token",
325        deserialize_with = "validation::deser_token"
326    )]
327    pub component_type: String,
328    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
329    /// to reference this component elsewhere in this or other OSCAL instances. The locally
330    /// defined UUID of the component can be used to reference the data item locally or globally
331    /// (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject, which
332    /// means it should be consistently used to identify the same subject across revisions of the
333    /// document.
334    #[serde(
335        serialize_with = "validation::ser_uuid",
336        deserialize_with = "validation::deser_uuid"
337    )]
338    #[derivative(PartialEq = "ignore")]
339    pub uuid: String,
340}
341
342/// Information about the protocol used to provide a service.
343#[derive(Debug, Clone, Serialize, Deserialize)]
344#[serde(rename_all = "kebab-case")]
345#[derive(Builder, Derivative)]
346#[builder(setter(into, strip_option))]
347#[derivative(PartialEq)]
348#[serde(deny_unknown_fields)]
349pub struct ServiceProtocolInformation {
350    /// The common name of the protocol, which should be the appropriate "service name" from the
351    /// IANA Service Name and Transport Protocol Port Number Registry.
352    pub name: String,
353    #[builder(setter(into, strip_option), default)]
354    #[serde(default, skip_serializing_if = "Option::is_none")]
355    pub port_ranges: Option<Vec<PortRange>>,
356    /// A human readable name for the protocol (e.g., Transport Layer Security).
357    #[builder(setter(into, strip_option), default)]
358    #[serde(default, skip_serializing_if = "Option::is_none")]
359    #[serde(deserialize_with = "validation::deser_markup_opt")]
360    pub title: Option<String>,
361    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
362    /// to reference this service protocol information elsewhere in this or other OSCAL
363    /// instances. The locally defined UUID of the service protocol can be used to reference the
364    /// data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be
365    /// assigned per-subject, which means it should be consistently used to identify the same
366    /// subject across revisions of the document.
367    #[builder(setter(into, strip_option), default)]
368    #[serde(default, skip_serializing_if = "Option::is_none")]
369    #[serde(
370        serialize_with = "validation::ser_uuid_opt",
371        deserialize_with = "validation::deser_uuid_opt"
372    )]
373    #[derivative(PartialEq = "ignore")]
374    pub uuid: Option<String>,
375}
376
377/// Where applicable this is the IPv4 port range on which the service operates.
378#[derive(Debug, Clone, Serialize, Deserialize)]
379#[derive(Builder, Derivative)]
380#[builder(setter(into, strip_option))]
381#[derivative(PartialEq)]
382#[serde(deny_unknown_fields)]
383pub struct PortRange {
384    /// Indicates the ending port number in a port range
385    #[builder(setter(into, strip_option), default)]
386    #[serde(default, skip_serializing_if = "Option::is_none")]
387    #[serde(
388        serialize_with = "validation::ser_non_neg_int_opt",
389        deserialize_with = "validation::deser_non_neg_int_opt"
390    )]
391    pub end: Option<i64>,
392    /// Indicates the starting port number in a port range
393    #[builder(setter(into, strip_option), default)]
394    #[serde(default, skip_serializing_if = "Option::is_none")]
395    #[serde(
396        serialize_with = "validation::ser_non_neg_int_opt",
397        deserialize_with = "validation::deser_non_neg_int_opt"
398    )]
399    pub start: Option<i64>,
400    /// Indicates the transport type.
401    #[builder(setter(into, strip_option), default)]
402    #[serde(default, skip_serializing_if = "Option::is_none")]
403    pub transport: Option<Transport>,
404}
405/// Indicates the transport type.
406///
407/// Describes the type of relationship provided by the link's hypertext reference. This can
408/// be an indicator of the link's purpose.
409///
410/// A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition.
411/// https://www.w3.org/TR/xmlschema11-2/#NCName.
412///
413/// A textual label that provides a sub-type or characterization of the property's name.
414///
415/// An identifier for relating distinct sets of properties.
416///
417/// A textual label, within a namespace, that uniquely identifies a specific attribute,
418/// characteristic, or quality of the property's containing object.
419///
420/// A reference to a role performed by a party.
421///
422/// A human-oriented identifier reference to a role performed.
423///
424/// Name of the file before it was encoded as Base64 to be embedded in a resource. This is
425/// the name that will be assigned to the file when the file is decoded.
426///
427/// Points to an assessment objective.
428///
429/// A reference to a control with a corresponding id value. When referencing an externally
430/// defined control, the Control Identifier Reference must be used in the context of the
431/// external / imported OSCAL instance (e.g., uri-reference).
432///
433/// Used to constrain the selection to only specificity identified statements.
434///
435/// An optional textual providing a sub-type or characterization of the part's name, or a
436/// category to which the part belongs.
437///
438/// A unique identifier for the part.
439///
440/// A textual label that uniquely identifies the part's semantic type, which exists in a
441/// value space qualified by the ns.
442///
443/// Reference to a role by UUID.
444///
445/// The type of action documented by the assembly, such as an approval.
446///
447/// A unique identifier for the role.
448///
449/// A textual label that provides a sub-type or characterization of the part's name. This can
450/// be used to further distinguish or discriminate between the semantics of multiple parts of
451/// the same control with the same name and ns.
452///
453/// Used to indicate the type of object pointed to by the uuid-ref within a subject.
454///
455/// Indicates the type of assessment subject, such as a component, inventory, item, location,
456/// or party represented by this selection statement.
457///
458/// Indicates the type of address.
459///
460/// The type of task.
461///
462/// A textual label that uniquely identifies the part's semantic type.
463#[derive(Debug, Clone, Serialize, Deserialize)]
464#[non_exhaustive]
465#[derive(EnumString, Derivative)]
466#[derivative(PartialEq)]
467pub enum Transport {
468    #[serde(rename = "TCP")]
469    Tcp,
470    #[serde(rename = "UDP")]
471    Udp,
472}
473
474/// A reference to a role with responsibility for performing a function relative to the
475/// containing object, optionally associated with a set of persons and/or organizations that
476/// perform that role.
477#[derive(Debug, Clone, Serialize, Deserialize)]
478#[serde(rename_all = "kebab-case")]
479#[derive(Builder, Derivative)]
480#[builder(setter(into, strip_option))]
481#[derivative(PartialEq)]
482#[serde(deny_unknown_fields)]
483pub struct ResponsibleRole {
484    #[builder(setter(into, strip_option), default)]
485    #[serde(default, skip_serializing_if = "Option::is_none")]
486    pub links: Option<Vec<Link>>,
487    #[builder(setter(into, strip_option), default)]
488    #[serde(default, skip_serializing_if = "Option::is_none")]
489    #[serde(
490        serialize_with = "validation::ser_uuid_vec_opt",
491        deserialize_with = "validation::deser_uuid_vec_opt"
492    )]
493    pub party_uuids: Option<Vec<String>>,
494    #[builder(setter(into, strip_option), default)]
495    #[serde(default, skip_serializing_if = "Option::is_none")]
496    pub props: Option<Vec<Property>>,
497    #[builder(setter(into, strip_option), default)]
498    #[serde(default, skip_serializing_if = "Option::is_none")]
499    #[serde(deserialize_with = "validation::deser_markup_opt")]
500    pub remarks: Option<String>,
501    /// A human-oriented identifier reference to a role performed.
502    #[serde(
503        serialize_with = "validation::ser_token",
504        deserialize_with = "validation::deser_token"
505    )]
506    pub role_id: String,
507}
508
509/// Describes the operational status of the system component.
510#[derive(Debug, Clone, Serialize, Deserialize)]
511#[derive(Builder, Derivative)]
512#[builder(setter(into, strip_option))]
513#[derivative(PartialEq)]
514#[serde(deny_unknown_fields)]
515pub struct Status {
516    #[builder(setter(into, strip_option), default)]
517    #[serde(default, skip_serializing_if = "Option::is_none")]
518    #[serde(deserialize_with = "validation::deser_markup_opt")]
519    pub remarks: Option<String>,
520    /// The operational status.
521    pub state: State,
522}
523/// The operational status.
524///
525/// Describes the type of relationship provided by the link's hypertext reference. This can
526/// be an indicator of the link's purpose.
527///
528/// A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition.
529/// https://www.w3.org/TR/xmlschema11-2/#NCName.
530///
531/// A textual label that provides a sub-type or characterization of the property's name.
532///
533/// An identifier for relating distinct sets of properties.
534///
535/// A textual label, within a namespace, that uniquely identifies a specific attribute,
536/// characteristic, or quality of the property's containing object.
537///
538/// A reference to a role performed by a party.
539///
540/// A human-oriented identifier reference to a role performed.
541///
542/// Name of the file before it was encoded as Base64 to be embedded in a resource. This is
543/// the name that will be assigned to the file when the file is decoded.
544///
545/// Points to an assessment objective.
546///
547/// A reference to a control with a corresponding id value. When referencing an externally
548/// defined control, the Control Identifier Reference must be used in the context of the
549/// external / imported OSCAL instance (e.g., uri-reference).
550///
551/// Used to constrain the selection to only specificity identified statements.
552///
553/// An optional textual providing a sub-type or characterization of the part's name, or a
554/// category to which the part belongs.
555///
556/// A unique identifier for the part.
557///
558/// A textual label that uniquely identifies the part's semantic type, which exists in a
559/// value space qualified by the ns.
560///
561/// Reference to a role by UUID.
562///
563/// The type of action documented by the assembly, such as an approval.
564///
565/// A unique identifier for the role.
566///
567/// A textual label that provides a sub-type or characterization of the part's name. This can
568/// be used to further distinguish or discriminate between the semantics of multiple parts of
569/// the same control with the same name and ns.
570///
571/// Used to indicate the type of object pointed to by the uuid-ref within a subject.
572///
573/// Indicates the type of assessment subject, such as a component, inventory, item, location,
574/// or party represented by this selection statement.
575///
576/// Indicates the type of address.
577///
578/// The type of task.
579///
580/// A textual label that uniquely identifies the part's semantic type.
581#[derive(Debug, Clone, Serialize, Deserialize)]
582#[serde(rename_all = "kebab-case")]
583#[non_exhaustive]
584#[derive(EnumString, Derivative)]
585#[derivative(PartialEq)]
586pub enum State {
587    Disposition,
588    Operational,
589    Other,
590    #[serde(rename = "under-development")]
591    UnderDevelopment,
592}
593
594/// Identifies system elements being assessed, such as components, inventory items, and
595/// locations. In the assessment plan, this identifies a planned assessment subject. In the
596/// assessment results this is an actual assessment subject, and reflects any changes from
597/// the plan. exactly what will be the focus of this assessment. Any subjects not identified
598/// in this way are out-of-scope.
599#[derive(Debug, Clone, Serialize, Deserialize)]
600#[serde(rename_all = "kebab-case")]
601#[derive(Builder, Derivative)]
602#[builder(setter(into, strip_option))]
603#[derivative(PartialEq)]
604#[serde(deny_unknown_fields)]
605pub struct SubjectOfAssessment {
606    /// A human-readable description of the collection of subjects being included in this
607    /// assessment.
608    #[builder(setter(into, strip_option), default)]
609    #[serde(default, skip_serializing_if = "Option::is_none")]
610    #[serde(deserialize_with = "validation::deser_markup_opt")]
611    pub description: Option<String>,
612    #[builder(setter(into, strip_option), default)]
613    #[serde(default, skip_serializing_if = "Option::is_none")]
614    pub exclude_subjects: Option<Vec<SelectAssessmentSubject>>,
615    #[builder(setter(into, strip_option), default)]
616    #[serde(default, skip_serializing_if = "Option::is_none")]
617    pub include_all: Option<IncludeAll>,
618    #[builder(setter(into, strip_option), default)]
619    #[serde(default, skip_serializing_if = "Option::is_none")]
620    pub include_subjects: Option<Vec<SelectAssessmentSubject>>,
621    #[builder(setter(into, strip_option), default)]
622    #[serde(default, skip_serializing_if = "Option::is_none")]
623    pub links: Option<Vec<Link>>,
624    #[builder(setter(into, strip_option), default)]
625    #[serde(default, skip_serializing_if = "Option::is_none")]
626    pub props: Option<Vec<Property>>,
627    #[builder(setter(into, strip_option), default)]
628    #[serde(default, skip_serializing_if = "Option::is_none")]
629    #[serde(deserialize_with = "validation::deser_markup_opt")]
630    pub remarks: Option<String>,
631    /// Indicates the type of assessment subject, such as a component, inventory, item, location,
632    /// or party represented by this selection statement.
633    #[serde(rename = "type")]
634    #[serde(
635        serialize_with = "validation::ser_token",
636        deserialize_with = "validation::deser_token"
637    )]
638    pub subject_of_assessment_type: String,
639}
640
641/// Identifies a set of assessment subjects to include/exclude by UUID.
642#[derive(Debug, Clone, Serialize, Deserialize)]
643#[serde(rename_all = "kebab-case")]
644#[derive(Builder, Derivative)]
645#[builder(setter(into, strip_option))]
646#[derivative(PartialEq)]
647#[serde(deny_unknown_fields)]
648pub struct SelectAssessmentSubject {
649    #[builder(setter(into, strip_option), default)]
650    #[serde(default, skip_serializing_if = "Option::is_none")]
651    pub links: Option<Vec<Link>>,
652    #[builder(setter(into, strip_option), default)]
653    #[serde(default, skip_serializing_if = "Option::is_none")]
654    pub props: Option<Vec<Property>>,
655    #[builder(setter(into, strip_option), default)]
656    #[serde(default, skip_serializing_if = "Option::is_none")]
657    #[serde(deserialize_with = "validation::deser_markup_opt")]
658    pub remarks: Option<String>,
659    /// A machine-oriented identifier reference to a component, inventory-item, location, party,
660    /// user, or resource using it's UUID.
661    #[derivative(PartialEq = "ignore")]
662    #[serde(
663        serialize_with = "validation::ser_uuid",
664        deserialize_with = "validation::deser_uuid"
665    )]
666    pub subject_uuid: String,
667    /// Used to indicate the type of object pointed to by the uuid-ref within a subject.
668    #[serde(rename = "type")]
669    #[serde(
670        serialize_with = "validation::ser_token",
671        deserialize_with = "validation::deser_token"
672    )]
673    pub select_assessment_subject_type: String,
674}
675
676/// Include all controls from the imported catalog or profile resources.
677#[derive(Debug, Clone, Serialize, Deserialize)]
678#[derive(Builder, Derivative)]
679#[builder(setter(into, strip_option))]
680#[derivative(PartialEq)]
681#[serde(deny_unknown_fields)]
682pub struct IncludeAll {}
683
684/// A collection of resources that may be referenced from within the OSCAL document instance.
685#[derive(Debug, Clone, Serialize, Deserialize)]
686#[derive(Builder, Derivative)]
687#[builder(setter(into, strip_option))]
688#[derivative(PartialEq)]
689#[serde(deny_unknown_fields)]
690pub struct BackMatter {
691    #[builder(setter(into, strip_option), default)]
692    #[serde(default, skip_serializing_if = "Option::is_none")]
693    pub resources: Option<Vec<Resource>>,
694}
695
696/// A resource associated with content in the containing document instance. A resource may be
697/// directly included in the document using base64 encoding or may point to one or more
698/// equivalent internet resources.
699#[derive(Debug, Clone, Serialize, Deserialize)]
700#[serde(rename_all = "kebab-case")]
701#[derive(Builder, Derivative)]
702#[builder(setter(into, strip_option))]
703#[derivative(PartialEq)]
704#[serde(deny_unknown_fields)]
705pub struct Resource {
706    /// A resource encoded using the Base64 alphabet defined by RFC 2045.
707    #[builder(setter(into, strip_option), default)]
708    #[serde(default, skip_serializing_if = "Option::is_none")]
709    pub base64: Option<Base64>,
710    /// An optional citation consisting of end note text using structured markup.
711    #[builder(setter(into, strip_option), default)]
712    #[serde(default, skip_serializing_if = "Option::is_none")]
713    pub citation: Option<Citation>,
714    /// An optional short summary of the resource used to indicate the purpose of the resource.
715    #[builder(setter(into, strip_option), default)]
716    #[serde(default, skip_serializing_if = "Option::is_none")]
717    #[serde(deserialize_with = "validation::deser_markup_opt")]
718    pub description: Option<String>,
719    #[builder(setter(into, strip_option), default)]
720    #[serde(default, skip_serializing_if = "Option::is_none")]
721    pub document_ids: Option<Vec<DocumentIdentifier>>,
722    #[builder(setter(into, strip_option), default)]
723    #[serde(default, skip_serializing_if = "Option::is_none")]
724    pub props: Option<Vec<Property>>,
725    #[builder(setter(into, strip_option), default)]
726    #[serde(default, skip_serializing_if = "Option::is_none")]
727    #[serde(deserialize_with = "validation::deser_markup_opt")]
728    pub remarks: Option<String>,
729    #[builder(setter(into, strip_option), default)]
730    #[serde(default, skip_serializing_if = "Option::is_none")]
731    pub rlinks: Option<Vec<ResourceLink>>,
732    /// An optional name given to the resource, which may be used by a tool for display and
733    /// navigation.
734    #[builder(setter(into, strip_option), default)]
735    #[serde(default, skip_serializing_if = "Option::is_none")]
736    #[serde(deserialize_with = "validation::deser_markup_opt")]
737    pub title: Option<String>,
738    /// A unique identifier for a resource.
739    #[serde(
740        serialize_with = "validation::ser_uuid",
741        deserialize_with = "validation::deser_uuid"
742    )]
743    #[derivative(PartialEq = "ignore")]
744    pub uuid: String,
745}
746
747/// A resource encoded using the Base64 alphabet defined by RFC 2045.
748#[derive(Debug, Clone, Serialize, Deserialize)]
749#[serde(rename_all = "kebab-case")]
750#[derive(Builder, Derivative)]
751#[builder(setter(into, strip_option))]
752#[derivative(PartialEq)]
753#[serde(deny_unknown_fields)]
754pub struct Base64 {
755    /// Name of the file before it was encoded as Base64 to be embedded in a resource. This is
756    /// the name that will be assigned to the file when the file is decoded.
757    #[builder(setter(into, strip_option), default)]
758    #[serde(default, skip_serializing_if = "Option::is_none")]
759    #[serde(
760        serialize_with = "validation::ser_token_opt",
761        deserialize_with = "validation::deser_token_opt"
762    )]
763    pub filename: Option<String>,
764    /// A label that indicates the nature of a resource, as a data serialization or format.
765    #[builder(setter(into, strip_option), default)]
766    #[serde(default, skip_serializing_if = "Option::is_none")]
767    pub media_type: Option<String>,
768    #[serde(
769        serialize_with = "validation::ser_base64",
770        deserialize_with = "validation::deser_base64"
771    )]
772    pub value: String,
773}
774
775/// An optional citation consisting of end note text using structured markup.
776#[derive(Debug, Clone, Serialize, Deserialize)]
777#[derive(Builder, Derivative)]
778#[builder(setter(into, strip_option))]
779#[derivative(PartialEq)]
780#[serde(deny_unknown_fields)]
781pub struct Citation {
782    #[builder(setter(into, strip_option), default)]
783    #[serde(default, skip_serializing_if = "Option::is_none")]
784    pub links: Option<Vec<Link>>,
785    #[builder(setter(into, strip_option), default)]
786    #[serde(default, skip_serializing_if = "Option::is_none")]
787    pub props: Option<Vec<Property>>,
788    /// A line of citation text.
789    #[serde(deserialize_with = "validation::deser_markup")]
790    pub text: String,
791}
792
793/// A document identifier qualified by an identifier scheme.
794#[derive(Debug, Clone, Serialize, Deserialize)]
795#[derive(Builder, Derivative)]
796#[builder(setter(into, strip_option))]
797#[derivative(PartialEq)]
798#[serde(deny_unknown_fields)]
799pub struct DocumentIdentifier {
800    pub identifier: String,
801    /// Qualifies the kind of document identifier using a URI. If the scheme is not provided the
802    /// value of the element will be interpreted as a string of characters.
803    #[builder(setter(into, strip_option), default)]
804    #[serde(default, skip_serializing_if = "Option::is_none")]
805    #[serde(
806        serialize_with = "validation::ser_uri_opt",
807        deserialize_with = "validation::deser_uri_opt"
808    )]
809    pub scheme: Option<String>,
810}
811
812/// A URL-based pointer to an external resource with an optional hash for verification and
813/// change detection.
814#[derive(Debug, Clone, Serialize, Deserialize)]
815#[serde(rename_all = "kebab-case")]
816#[derive(Builder, Derivative)]
817#[builder(setter(into, strip_option))]
818#[derivative(PartialEq)]
819#[serde(deny_unknown_fields)]
820pub struct ResourceLink {
821    #[builder(setter(into, strip_option), default)]
822    #[serde(default, skip_serializing_if = "Option::is_none")]
823    pub hashes: Option<Vec<Hash>>,
824    /// A resolvable URL pointing to the referenced resource.
825    #[serde(
826        serialize_with = "validation::ser_uri_ref",
827        deserialize_with = "validation::deser_uri_ref"
828    )]
829    pub href: String,
830    /// A label that indicates the nature of a resource, as a data serialization or format.
831    #[builder(setter(into, strip_option), default)]
832    #[serde(default, skip_serializing_if = "Option::is_none")]
833    pub media_type: Option<String>,
834}
835
836/// A representation of a cryptographic digest generated over a resource using a specified
837/// hash algorithm.
838#[derive(Debug, Clone, Serialize, Deserialize)]
839#[derive(Builder, Derivative)]
840#[builder(setter(into, strip_option))]
841#[derivative(PartialEq)]
842#[serde(deny_unknown_fields)]
843pub struct Hash {
844    /// The digest method by which a hash is derived.
845    pub algorithm: String,
846    #[serde(
847        serialize_with = "validation::ser_hash",
848        deserialize_with = "validation::deser_hash"
849    )]
850    pub value: String,
851}
852
853/// Used by the assessment plan and POA&M to import information about the system.
854#[derive(Debug, Clone, Serialize, Deserialize)]
855#[derive(Builder, Derivative)]
856#[builder(setter(into, strip_option))]
857#[derivative(PartialEq)]
858#[serde(deny_unknown_fields)]
859pub struct ImportSystemSecurityPlan {
860    /// A resolvable URL reference to the system security plan for the system being assessed.
861    #[serde(
862        serialize_with = "validation::ser_uri_ref",
863        deserialize_with = "validation::deser_uri_ref"
864    )]
865    pub href: String,
866    #[builder(setter(into, strip_option), default)]
867    #[serde(default, skip_serializing_if = "Option::is_none")]
868    #[serde(deserialize_with = "validation::deser_markup_opt")]
869    pub remarks: Option<String>,
870}
871
872/// Used to define data objects that are used in the assessment plan, that do not appear in
873/// the referenced SSP.
874#[derive(Debug, Clone, Serialize, Deserialize)]
875#[serde(rename_all = "kebab-case")]
876#[derive(Builder, Derivative)]
877#[builder(setter(into, strip_option))]
878#[derivative(PartialEq)]
879#[serde(deny_unknown_fields)]
880pub struct LocalDefinitions {
881    #[builder(setter(into, strip_option), default)]
882    #[serde(default, skip_serializing_if = "Option::is_none")]
883    pub activities: Option<Vec<Activity>>,
884    #[builder(setter(into, strip_option), default)]
885    #[serde(default, skip_serializing_if = "Option::is_none")]
886    pub components: Option<Vec<Component>>,
887    #[builder(setter(into, strip_option), default)]
888    #[serde(default, skip_serializing_if = "Option::is_none")]
889    pub inventory_items: Option<Vec<InventoryItem>>,
890    #[builder(setter(into, strip_option), default)]
891    #[serde(default, skip_serializing_if = "Option::is_none")]
892    pub objectives_and_methods: Option<Vec<AssessmentSpecificControlObjective>>,
893    #[builder(setter(into, strip_option), default)]
894    #[serde(default, skip_serializing_if = "Option::is_none")]
895    #[serde(deserialize_with = "validation::deser_markup_opt")]
896    pub remarks: Option<String>,
897    #[builder(setter(into, strip_option), default)]
898    #[serde(default, skip_serializing_if = "Option::is_none")]
899    pub users: Option<Vec<SystemUser>>,
900}
901
902/// Identifies an assessment or related process that can be performed. In the assessment
903/// plan, this is an intended activity which may be associated with an assessment task. In
904/// the assessment results, this an activity that was actually performed as part of an
905/// assessment.
906#[derive(Debug, Clone, Serialize, Deserialize)]
907#[serde(rename_all = "kebab-case")]
908#[derive(Builder, Derivative)]
909#[builder(setter(into, strip_option))]
910#[derivative(PartialEq)]
911#[serde(deny_unknown_fields)]
912pub struct Activity {
913    /// A human-readable description of this included activity.
914    #[serde(deserialize_with = "validation::deser_markup")]
915    pub description: String,
916    #[builder(setter(into, strip_option), default)]
917    #[serde(default, skip_serializing_if = "Option::is_none")]
918    pub links: Option<Vec<Link>>,
919    #[builder(setter(into, strip_option), default)]
920    #[serde(default, skip_serializing_if = "Option::is_none")]
921    pub props: Option<Vec<Property>>,
922    #[builder(setter(into, strip_option), default)]
923    #[serde(default, skip_serializing_if = "Option::is_none")]
924    pub related_controls: Option<ReviewedControlsAndControlObjectives>,
925    #[builder(setter(into, strip_option), default)]
926    #[serde(default, skip_serializing_if = "Option::is_none")]
927    #[serde(deserialize_with = "validation::deser_markup_opt")]
928    pub remarks: Option<String>,
929    #[builder(setter(into, strip_option), default)]
930    #[serde(default, skip_serializing_if = "Option::is_none")]
931    pub responsible_roles: Option<Vec<ResponsibleRole>>,
932    #[builder(setter(into, strip_option), default)]
933    #[serde(default, skip_serializing_if = "Option::is_none")]
934    pub steps: Option<Vec<Step>>,
935    /// The title for this included activity.
936    #[builder(setter(into, strip_option), default)]
937    #[serde(default, skip_serializing_if = "Option::is_none")]
938    #[serde(deserialize_with = "validation::deser_markup_opt")]
939    pub title: Option<String>,
940    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
941    /// to reference this assessment activity elsewhere in this or other OSCAL instances. The
942    /// locally defined UUID of the activity can be used to reference the data item locally or
943    /// globally (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject,
944    /// which means it should be consistently used to identify the same subject across revisions
945    /// of the document.
946    #[serde(
947        serialize_with = "validation::ser_uuid",
948        deserialize_with = "validation::deser_uuid"
949    )]
950    #[derivative(PartialEq = "ignore")]
951    pub uuid: String,
952}
953
954/// Identifies the controls being assessed and their control objectives.
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[serde(rename_all = "kebab-case")]
957#[derive(Builder, Derivative)]
958#[builder(setter(into, strip_option))]
959#[derivative(PartialEq)]
960#[serde(deny_unknown_fields)]
961pub struct ReviewedControlsAndControlObjectives {
962    #[builder(setter(into, strip_option), default)]
963    #[serde(default, skip_serializing_if = "Option::is_none")]
964    pub control_objective_selections: Option<Vec<ReferencedControlObjectives>>,
965    pub control_selections: Vec<AssessedControls>,
966    /// A human-readable description of control objectives.
967    #[builder(setter(into, strip_option), default)]
968    #[serde(default, skip_serializing_if = "Option::is_none")]
969    #[serde(deserialize_with = "validation::deser_markup_opt")]
970    pub description: Option<String>,
971    #[builder(setter(into, strip_option), default)]
972    #[serde(default, skip_serializing_if = "Option::is_none")]
973    pub links: Option<Vec<Link>>,
974    #[builder(setter(into, strip_option), default)]
975    #[serde(default, skip_serializing_if = "Option::is_none")]
976    pub props: Option<Vec<Property>>,
977    #[builder(setter(into, strip_option), default)]
978    #[serde(default, skip_serializing_if = "Option::is_none")]
979    #[serde(deserialize_with = "validation::deser_markup_opt")]
980    pub remarks: Option<String>,
981}
982
983/// Identifies the control objectives of the assessment. In the assessment plan, these are
984/// the planned objectives. In the assessment results, these are the assessed objectives, and
985/// reflects any changes from the plan.
986#[derive(Debug, Clone, Serialize, Deserialize)]
987#[serde(rename_all = "kebab-case")]
988#[derive(Builder, Derivative)]
989#[builder(setter(into, strip_option))]
990#[derivative(PartialEq)]
991#[serde(deny_unknown_fields)]
992pub struct ReferencedControlObjectives {
993    /// A human-readable description of this collection of control objectives.
994    #[builder(setter(into, strip_option), default)]
995    #[serde(default, skip_serializing_if = "Option::is_none")]
996    #[serde(deserialize_with = "validation::deser_markup_opt")]
997    pub description: Option<String>,
998    #[builder(setter(into, strip_option), default)]
999    #[serde(default, skip_serializing_if = "Option::is_none")]
1000    pub exclude_objectives: Option<Vec<SelectObjective>>,
1001    #[builder(setter(into, strip_option), default)]
1002    #[serde(default, skip_serializing_if = "Option::is_none")]
1003    pub include_all: Option<IncludeAll>,
1004    #[builder(setter(into, strip_option), default)]
1005    #[serde(default, skip_serializing_if = "Option::is_none")]
1006    pub include_objectives: Option<Vec<SelectObjective>>,
1007    #[builder(setter(into, strip_option), default)]
1008    #[serde(default, skip_serializing_if = "Option::is_none")]
1009    pub links: Option<Vec<Link>>,
1010    #[builder(setter(into, strip_option), default)]
1011    #[serde(default, skip_serializing_if = "Option::is_none")]
1012    pub props: Option<Vec<Property>>,
1013    #[builder(setter(into, strip_option), default)]
1014    #[serde(default, skip_serializing_if = "Option::is_none")]
1015    #[serde(deserialize_with = "validation::deser_markup_opt")]
1016    pub remarks: Option<String>,
1017}
1018
1019/// Used to select a control objective for inclusion/exclusion based on the control
1020/// objective's identifier.
1021#[derive(Debug, Clone, Serialize, Deserialize)]
1022#[serde(rename_all = "kebab-case")]
1023#[derive(Builder, Derivative)]
1024#[builder(setter(into, strip_option))]
1025#[derivative(PartialEq)]
1026#[serde(deny_unknown_fields)]
1027pub struct SelectObjective {
1028    /// Points to an assessment objective.
1029    #[serde(
1030        serialize_with = "validation::ser_token",
1031        deserialize_with = "validation::deser_token"
1032    )]
1033    pub objective_id: String,
1034}
1035
1036/// Identifies the controls being assessed. In the assessment plan, these are the planned
1037/// controls. In the assessment results, these are the actual controls, and reflects any
1038/// changes from the plan.
1039#[derive(Debug, Clone, Serialize, Deserialize)]
1040#[serde(rename_all = "kebab-case")]
1041#[derive(Builder, Derivative)]
1042#[builder(setter(into, strip_option))]
1043#[derivative(PartialEq)]
1044#[serde(deny_unknown_fields)]
1045pub struct AssessedControls {
1046    /// A human-readable description of in-scope controls specified for assessment.
1047    #[builder(setter(into, strip_option), default)]
1048    #[serde(default, skip_serializing_if = "Option::is_none")]
1049    #[serde(deserialize_with = "validation::deser_markup_opt")]
1050    pub description: Option<String>,
1051    #[builder(setter(into, strip_option), default)]
1052    #[serde(default, skip_serializing_if = "Option::is_none")]
1053    pub exclude_controls: Option<Vec<SelectControl>>,
1054    #[builder(setter(into, strip_option), default)]
1055    #[serde(default, skip_serializing_if = "Option::is_none")]
1056    pub include_all: Option<IncludeAll>,
1057    #[builder(setter(into, strip_option), default)]
1058    #[serde(default, skip_serializing_if = "Option::is_none")]
1059    pub include_controls: Option<Vec<SelectControl>>,
1060    #[builder(setter(into, strip_option), default)]
1061    #[serde(default, skip_serializing_if = "Option::is_none")]
1062    pub links: Option<Vec<Link>>,
1063    #[builder(setter(into, strip_option), default)]
1064    #[serde(default, skip_serializing_if = "Option::is_none")]
1065    pub props: Option<Vec<Property>>,
1066    #[builder(setter(into, strip_option), default)]
1067    #[serde(default, skip_serializing_if = "Option::is_none")]
1068    #[serde(deserialize_with = "validation::deser_markup_opt")]
1069    pub remarks: Option<String>,
1070}
1071
1072/// Used to select a control for inclusion/exclusion based on one or more control
1073/// identifiers. A set of statement identifiers can be used to target the inclusion/exclusion
1074/// to only specific control statements providing more granularity over the specific
1075/// statements that are within the asessment scope.
1076#[derive(Debug, Clone, Serialize, Deserialize)]
1077#[serde(rename_all = "kebab-case")]
1078#[derive(Builder, Derivative)]
1079#[builder(setter(into, strip_option))]
1080#[derivative(PartialEq)]
1081#[serde(deny_unknown_fields)]
1082pub struct SelectControl {
1083    /// A reference to a control with a corresponding id value. When referencing an externally
1084    /// defined control, the Control Identifier Reference must be used in the context of the
1085    /// external / imported OSCAL instance (e.g., uri-reference).
1086    #[serde(
1087        serialize_with = "validation::ser_token",
1088        deserialize_with = "validation::deser_token"
1089    )]
1090    pub control_id: String,
1091    #[builder(setter(into, strip_option), default)]
1092    #[serde(default, skip_serializing_if = "Option::is_none")]
1093    #[serde(
1094        serialize_with = "validation::ser_token_vec_opt",
1095        deserialize_with = "validation::deser_token_vec_opt"
1096    )]
1097    pub statement_ids: Option<Vec<String>>,
1098}
1099
1100/// Identifies an individual step in a series of steps related to an activity, such as an
1101/// assessment test or examination procedure.
1102#[derive(Debug, Clone, Serialize, Deserialize)]
1103#[serde(rename_all = "kebab-case")]
1104#[derive(Builder, Derivative)]
1105#[builder(setter(into, strip_option))]
1106#[derivative(PartialEq)]
1107#[serde(deny_unknown_fields)]
1108pub struct Step {
1109    /// A human-readable description of this step.
1110    #[serde(deserialize_with = "validation::deser_markup")]
1111    pub description: String,
1112    #[builder(setter(into, strip_option), default)]
1113    #[serde(default, skip_serializing_if = "Option::is_none")]
1114    pub links: Option<Vec<Link>>,
1115    #[builder(setter(into, strip_option), default)]
1116    #[serde(default, skip_serializing_if = "Option::is_none")]
1117    pub props: Option<Vec<Property>>,
1118    #[builder(setter(into, strip_option), default)]
1119    #[serde(default, skip_serializing_if = "Option::is_none")]
1120    #[serde(deserialize_with = "validation::deser_markup_opt")]
1121    pub remarks: Option<String>,
1122    #[builder(setter(into, strip_option), default)]
1123    #[serde(default, skip_serializing_if = "Option::is_none")]
1124    pub responsible_roles: Option<Vec<ResponsibleRole>>,
1125    #[builder(setter(into, strip_option), default)]
1126    #[serde(default, skip_serializing_if = "Option::is_none")]
1127    pub reviewed_controls: Option<ReviewedControlsAndControlObjectives>,
1128    /// The title for this step.
1129    #[builder(setter(into, strip_option), default)]
1130    #[serde(default, skip_serializing_if = "Option::is_none")]
1131    #[serde(deserialize_with = "validation::deser_markup_opt")]
1132    pub title: Option<String>,
1133    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
1134    /// to reference this step elsewhere in this or other OSCAL instances. The locally defined
1135    /// UUID of the step (in a series of steps) can be used to reference the data item locally or
1136    /// globally (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject,
1137    /// which means it should be consistently used to identify the same subject across revisions
1138    /// of the document.
1139    #[serde(
1140        serialize_with = "validation::ser_uuid",
1141        deserialize_with = "validation::deser_uuid"
1142    )]
1143    #[derivative(PartialEq = "ignore")]
1144    pub uuid: String,
1145}
1146
1147/// A single managed inventory item within the system.
1148#[derive(Debug, Clone, Serialize, Deserialize)]
1149#[serde(rename_all = "kebab-case")]
1150#[derive(Builder, Derivative)]
1151#[builder(setter(into, strip_option))]
1152#[derivative(PartialEq)]
1153#[serde(deny_unknown_fields)]
1154pub struct InventoryItem {
1155    /// A summary of the inventory item stating its purpose within the system.
1156    #[serde(deserialize_with = "validation::deser_markup")]
1157    pub description: String,
1158    #[builder(setter(into, strip_option), default)]
1159    #[serde(default, skip_serializing_if = "Option::is_none")]
1160    pub implemented_components: Option<Vec<ImplementedComponent>>,
1161    #[builder(setter(into, strip_option), default)]
1162    #[serde(default, skip_serializing_if = "Option::is_none")]
1163    pub links: Option<Vec<Link>>,
1164    #[builder(setter(into, strip_option), default)]
1165    #[serde(default, skip_serializing_if = "Option::is_none")]
1166    pub props: Option<Vec<Property>>,
1167    #[builder(setter(into, strip_option), default)]
1168    #[serde(default, skip_serializing_if = "Option::is_none")]
1169    #[serde(deserialize_with = "validation::deser_markup_opt")]
1170    pub remarks: Option<String>,
1171    #[builder(setter(into, strip_option), default)]
1172    #[serde(default, skip_serializing_if = "Option::is_none")]
1173    pub responsible_parties: Option<Vec<ResponsibleParty>>,
1174    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
1175    /// to reference this inventory item elsewhere in this or other OSCAL instances. The locally
1176    /// defined UUID of the inventory item can be used to reference the data item locally or
1177    /// globally (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject,
1178    /// which means it should be consistently used to identify the same subject across revisions
1179    /// of the document.
1180    #[serde(
1181        serialize_with = "validation::ser_uuid",
1182        deserialize_with = "validation::deser_uuid"
1183    )]
1184    #[derivative(PartialEq = "ignore")]
1185    pub uuid: String,
1186}
1187
1188/// The set of components that are implemented in a given system inventory item.
1189#[derive(Debug, Clone, Serialize, Deserialize)]
1190#[serde(rename_all = "kebab-case")]
1191#[derive(Builder, Derivative)]
1192#[builder(setter(into, strip_option))]
1193#[derivative(PartialEq)]
1194#[serde(deny_unknown_fields)]
1195pub struct ImplementedComponent {
1196    /// A machine-oriented identifier reference to a component that is implemented as part of an
1197    /// inventory item.
1198    #[derivative(PartialEq = "ignore")]
1199    #[serde(
1200        serialize_with = "validation::ser_uuid",
1201        deserialize_with = "validation::deser_uuid"
1202    )]
1203    pub component_uuid: String,
1204    #[builder(setter(into, strip_option), default)]
1205    #[serde(default, skip_serializing_if = "Option::is_none")]
1206    pub links: Option<Vec<Link>>,
1207    #[builder(setter(into, strip_option), default)]
1208    #[serde(default, skip_serializing_if = "Option::is_none")]
1209    pub props: Option<Vec<Property>>,
1210    #[builder(setter(into, strip_option), default)]
1211    #[serde(default, skip_serializing_if = "Option::is_none")]
1212    #[serde(deserialize_with = "validation::deser_markup_opt")]
1213    pub remarks: Option<String>,
1214    #[builder(setter(into, strip_option), default)]
1215    #[serde(default, skip_serializing_if = "Option::is_none")]
1216    pub responsible_parties: Option<Vec<ResponsibleParty>>,
1217}
1218
1219/// A local definition of a control objective for this assessment. Uses catalog syntax for
1220/// control objective and assessment actions.
1221#[derive(Debug, Clone, Serialize, Deserialize)]
1222#[serde(rename_all = "kebab-case")]
1223#[derive(Builder, Derivative)]
1224#[builder(setter(into, strip_option))]
1225#[derivative(PartialEq)]
1226#[serde(deny_unknown_fields)]
1227pub struct AssessmentSpecificControlObjective {
1228    /// A reference to a control with a corresponding id value. When referencing an externally
1229    /// defined control, the Control Identifier Reference must be used in the context of the
1230    /// external / imported OSCAL instance (e.g., uri-reference).
1231    #[serde(
1232        serialize_with = "validation::ser_token",
1233        deserialize_with = "validation::deser_token"
1234    )]
1235    pub control_id: String,
1236    /// A human-readable description of this control objective.
1237    #[builder(setter(into, strip_option), default)]
1238    #[serde(default, skip_serializing_if = "Option::is_none")]
1239    #[serde(deserialize_with = "validation::deser_markup_opt")]
1240    pub description: Option<String>,
1241    #[builder(setter(into, strip_option), default)]
1242    #[serde(default, skip_serializing_if = "Option::is_none")]
1243    pub links: Option<Vec<Link>>,
1244    pub parts: Vec<Part>,
1245    #[builder(setter(into, strip_option), default)]
1246    #[serde(default, skip_serializing_if = "Option::is_none")]
1247    pub props: Option<Vec<Property>>,
1248    #[builder(setter(into, strip_option), default)]
1249    #[serde(default, skip_serializing_if = "Option::is_none")]
1250    #[serde(deserialize_with = "validation::deser_markup_opt")]
1251    pub remarks: Option<String>,
1252}
1253
1254/// An annotated, markup-based textual element of a control's or catalog group's definition,
1255/// or a child of another part.
1256#[derive(Debug, Clone, Serialize, Deserialize)]
1257#[derive(Builder, Derivative)]
1258#[builder(setter(into, strip_option))]
1259#[derivative(PartialEq)]
1260#[serde(deny_unknown_fields)]
1261pub struct Part {
1262    /// An optional textual providing a sub-type or characterization of the part's name, or a
1263    /// category to which the part belongs.
1264    #[builder(setter(into, strip_option), default)]
1265    #[serde(default, skip_serializing_if = "Option::is_none")]
1266    #[serde(
1267        serialize_with = "validation::ser_token_opt",
1268        deserialize_with = "validation::deser_token_opt"
1269    )]
1270    pub class: Option<String>,
1271    /// A unique identifier for the part.
1272    #[builder(setter(into, strip_option), default)]
1273    #[serde(default, skip_serializing_if = "Option::is_none")]
1274    #[serde(
1275        serialize_with = "validation::ser_token_opt",
1276        deserialize_with = "validation::deser_token_opt"
1277    )]
1278    pub id: Option<String>,
1279    #[builder(setter(into, strip_option), default)]
1280    #[serde(default, skip_serializing_if = "Option::is_none")]
1281    pub links: Option<Vec<Link>>,
1282    /// A textual label that uniquely identifies the part's semantic type, which exists in a
1283    /// value space qualified by the ns.
1284    #[serde(
1285        serialize_with = "validation::ser_token",
1286        deserialize_with = "validation::deser_token"
1287    )]
1288    pub name: String,
1289    /// An optional namespace qualifying the part's name. This allows different organizations to
1290    /// associate distinct semantics with the same name.
1291    #[builder(setter(into, strip_option), default)]
1292    #[serde(default, skip_serializing_if = "Option::is_none")]
1293    #[serde(
1294        serialize_with = "validation::ser_uri_opt",
1295        deserialize_with = "validation::deser_uri_opt"
1296    )]
1297    pub ns: Option<String>,
1298    #[builder(setter(into, strip_option), default)]
1299    #[serde(default, skip_serializing_if = "Option::is_none")]
1300    pub parts: Option<Vec<Part>>,
1301    #[builder(setter(into, strip_option), default)]
1302    #[serde(default, skip_serializing_if = "Option::is_none")]
1303    pub props: Option<Vec<Property>>,
1304    /// Permits multiple paragraphs, lists, tables etc.
1305    #[builder(setter(into, strip_option), default)]
1306    #[serde(default, skip_serializing_if = "Option::is_none")]
1307    #[serde(deserialize_with = "validation::deser_markup_opt")]
1308    pub prose: Option<String>,
1309    /// An optional name given to the part, which may be used by a tool for display and
1310    /// navigation.
1311    #[builder(setter(into, strip_option), default)]
1312    #[serde(default, skip_serializing_if = "Option::is_none")]
1313    #[serde(deserialize_with = "validation::deser_markup_opt")]
1314    pub title: Option<String>,
1315}
1316
1317/// A type of user that interacts with the system based on an associated role.
1318#[derive(Debug, Clone, Serialize, Deserialize)]
1319#[serde(rename_all = "kebab-case")]
1320#[derive(Builder, Derivative)]
1321#[builder(setter(into, strip_option))]
1322#[derivative(PartialEq)]
1323#[serde(deny_unknown_fields)]
1324pub struct SystemUser {
1325    #[builder(setter(into, strip_option), default)]
1326    #[serde(default, skip_serializing_if = "Option::is_none")]
1327    pub authorized_privileges: Option<Vec<Privilege>>,
1328    /// A summary of the user's purpose within the system.
1329    #[builder(setter(into, strip_option), default)]
1330    #[serde(default, skip_serializing_if = "Option::is_none")]
1331    #[serde(deserialize_with = "validation::deser_markup_opt")]
1332    pub description: Option<String>,
1333    #[builder(setter(into, strip_option), default)]
1334    #[serde(default, skip_serializing_if = "Option::is_none")]
1335    pub links: Option<Vec<Link>>,
1336    #[builder(setter(into, strip_option), default)]
1337    #[serde(default, skip_serializing_if = "Option::is_none")]
1338    pub props: Option<Vec<Property>>,
1339    #[builder(setter(into, strip_option), default)]
1340    #[serde(default, skip_serializing_if = "Option::is_none")]
1341    #[serde(deserialize_with = "validation::deser_markup_opt")]
1342    pub remarks: Option<String>,
1343    #[builder(setter(into, strip_option), default)]
1344    #[serde(default, skip_serializing_if = "Option::is_none")]
1345    #[serde(deserialize_with = "validation::deser_token_vec_opt")]
1346    pub role_ids: Option<Vec<String>>,
1347    /// A short common name, abbreviation, or acronym for the user.
1348    #[builder(setter(into, strip_option), default)]
1349    #[serde(default, skip_serializing_if = "Option::is_none")]
1350    pub short_name: Option<String>,
1351    /// A name given to the user, which may be used by a tool for display and navigation.
1352    #[builder(setter(into, strip_option), default)]
1353    #[serde(default, skip_serializing_if = "Option::is_none")]
1354    #[serde(deserialize_with = "validation::deser_markup_opt")]
1355    pub title: Option<String>,
1356    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
1357    /// to reference this user class elsewhere in this or other OSCAL instances. The locally
1358    /// defined UUID of the system user can be used to reference the data item locally or
1359    /// globally (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject,
1360    /// which means it should be consistently used to identify the same subject across revisions
1361    /// of the document.
1362    #[serde(
1363        serialize_with = "validation::ser_uuid",
1364        deserialize_with = "validation::deser_uuid"
1365    )]
1366    #[derivative(PartialEq = "ignore")]
1367    pub uuid: String,
1368}
1369
1370/// Identifies a specific system privilege held by the user, along with an associated
1371/// description and/or rationale for the privilege.
1372#[derive(Debug, Clone, Serialize, Deserialize)]
1373#[serde(rename_all = "kebab-case")]
1374#[derive(Builder, Derivative)]
1375#[builder(setter(into, strip_option))]
1376#[derivative(PartialEq)]
1377#[serde(deny_unknown_fields)]
1378pub struct Privilege {
1379    /// A summary of the privilege's purpose within the system.
1380    #[builder(setter(into, strip_option), default)]
1381    #[serde(default, skip_serializing_if = "Option::is_none")]
1382    #[serde(deserialize_with = "validation::deser_markup_opt")]
1383    pub description: Option<String>,
1384    pub functions_performed: Vec<String>,
1385    /// A human readable name for the privilege.
1386    pub title: String,
1387}
1388
1389/// Provides information about the containing document, and defines concepts that are shared
1390/// across the document.
1391#[derive(Debug, Clone, Serialize, Deserialize)]
1392#[serde(rename_all = "kebab-case")]
1393#[derive(Builder, Derivative)]
1394#[builder(setter(into, strip_option))]
1395#[derivative(PartialEq)]
1396#[serde(deny_unknown_fields)]
1397pub struct DocumentMetadata {
1398    #[builder(setter(into, strip_option), default)]
1399    #[serde(default, skip_serializing_if = "Option::is_none")]
1400    pub actions: Option<Vec<Action>>,
1401    #[builder(setter(into, strip_option), default)]
1402    #[serde(default, skip_serializing_if = "Option::is_none")]
1403    pub document_ids: Option<Vec<DocumentIdentifier>>,
1404    #[serde(
1405        serialize_with = "validation::ser_dttz",
1406        deserialize_with = "validation::deser_dttz"
1407    )]
1408    pub last_modified: String,
1409    #[builder(setter(into, strip_option), default)]
1410    #[serde(default, skip_serializing_if = "Option::is_none")]
1411    pub links: Option<Vec<Link>>,
1412    #[builder(setter(into, strip_option), default)]
1413    #[serde(default, skip_serializing_if = "Option::is_none")]
1414    pub locations: Option<Vec<Location>>,
1415    pub oscal_version: String,
1416    #[builder(setter(into, strip_option), default)]
1417    #[serde(default, skip_serializing_if = "Option::is_none")]
1418    pub parties: Option<Vec<Party>>,
1419    #[builder(setter(into, strip_option), default)]
1420    #[serde(default, skip_serializing_if = "Option::is_none")]
1421    pub props: Option<Vec<Property>>,
1422    #[builder(setter(into, strip_option), default)]
1423    #[serde(default, skip_serializing_if = "Option::is_none")]
1424    pub published: Option<String>,
1425    #[builder(setter(into, strip_option), default)]
1426    #[serde(default, skip_serializing_if = "Option::is_none")]
1427    #[serde(deserialize_with = "validation::deser_markup_opt")]
1428    pub remarks: Option<String>,
1429    #[builder(setter(into, strip_option), default)]
1430    #[serde(default, skip_serializing_if = "Option::is_none")]
1431    pub responsible_parties: Option<Vec<ResponsibleParty>>,
1432    #[builder(setter(into, strip_option), default)]
1433    #[serde(default, skip_serializing_if = "Option::is_none")]
1434    pub revisions: Option<Vec<RevisionHistoryEntry>>,
1435    #[builder(setter(into, strip_option), default)]
1436    #[serde(default, skip_serializing_if = "Option::is_none")]
1437    pub roles: Option<Vec<Role>>,
1438    /// A name given to the document, which may be used by a tool for display and navigation.
1439    #[serde(deserialize_with = "validation::deser_markup")]
1440    pub title: String,
1441    pub version: String,
1442}
1443
1444/// An action applied by a role within a given party to the content.
1445#[derive(Debug, Clone, Serialize, Deserialize)]
1446#[serde(rename_all = "kebab-case")]
1447#[derive(Builder, Derivative)]
1448#[builder(setter(into, strip_option))]
1449#[derivative(PartialEq)]
1450#[serde(deny_unknown_fields)]
1451pub struct Action {
1452    /// The date and time when the action occurred.
1453    #[builder(setter(into, strip_option), default)]
1454    #[serde(default, skip_serializing_if = "Option::is_none")]
1455    #[serde(
1456        serialize_with = "validation::ser_dttz_opt",
1457        deserialize_with = "validation::deser_dttz_opt"
1458    )]
1459    pub date: Option<String>,
1460    #[builder(setter(into, strip_option), default)]
1461    #[serde(default, skip_serializing_if = "Option::is_none")]
1462    pub links: Option<Vec<Link>>,
1463    #[builder(setter(into, strip_option), default)]
1464    #[serde(default, skip_serializing_if = "Option::is_none")]
1465    pub props: Option<Vec<Property>>,
1466    #[builder(setter(into, strip_option), default)]
1467    #[serde(default, skip_serializing_if = "Option::is_none")]
1468    #[serde(deserialize_with = "validation::deser_markup_opt")]
1469    pub remarks: Option<String>,
1470    #[builder(setter(into, strip_option), default)]
1471    #[serde(default, skip_serializing_if = "Option::is_none")]
1472    pub responsible_parties: Option<Vec<ResponsibleParty>>,
1473    /// Specifies the action type system used.
1474    pub system: String,
1475    /// The type of action documented by the assembly, such as an approval.
1476    #[serde(rename = "type")]
1477    #[serde(
1478        serialize_with = "validation::ser_token",
1479        deserialize_with = "validation::deser_token"
1480    )]
1481    pub action_type: String,
1482    /// A unique identifier that can be used to reference this defined action elsewhere in an
1483    /// OSCAL document. A UUID should be consistently used for a given location across revisions
1484    /// of the document.
1485    #[serde(
1486        serialize_with = "validation::ser_uuid",
1487        deserialize_with = "validation::deser_uuid"
1488    )]
1489    #[derivative(PartialEq = "ignore")]
1490    pub uuid: String,
1491}
1492
1493/// A physical point of presence, which may be associated with people, organizations, or
1494/// other concepts within the current or linked OSCAL document.
1495#[derive(Debug, Clone, Serialize, Deserialize)]
1496#[serde(rename_all = "kebab-case")]
1497#[derive(Builder, Derivative)]
1498#[builder(setter(into, strip_option))]
1499#[derivative(PartialEq)]
1500#[serde(deny_unknown_fields)]
1501pub struct Location {
1502    #[builder(setter(into, strip_option), default)]
1503    #[serde(default, skip_serializing_if = "Option::is_none")]
1504    pub address: Option<Address>,
1505    #[builder(setter(into, strip_option), default)]
1506    #[serde(default, skip_serializing_if = "Option::is_none")]
1507    #[serde(
1508        serialize_with = "validation::ser_email_vec_opt",
1509        deserialize_with = "validation::deser_email_vec_opt"
1510    )]
1511    pub email_addresses: Option<Vec<String>>,
1512    #[builder(setter(into, strip_option), default)]
1513    #[serde(default, skip_serializing_if = "Option::is_none")]
1514    pub links: Option<Vec<Link>>,
1515    #[builder(setter(into, strip_option), default)]
1516    #[serde(default, skip_serializing_if = "Option::is_none")]
1517    pub props: Option<Vec<Property>>,
1518    #[builder(setter(into, strip_option), default)]
1519    #[serde(default, skip_serializing_if = "Option::is_none")]
1520    #[serde(deserialize_with = "validation::deser_markup_opt")]
1521    pub remarks: Option<String>,
1522    #[builder(setter(into, strip_option), default)]
1523    #[serde(default, skip_serializing_if = "Option::is_none")]
1524    pub telephone_numbers: Option<Vec<TelephoneNumber>>,
1525    /// A name given to the location, which may be used by a tool for display and navigation.
1526    #[builder(setter(into, strip_option), default)]
1527    #[serde(default, skip_serializing_if = "Option::is_none")]
1528    #[serde(deserialize_with = "validation::deser_markup_opt")]
1529    pub title: Option<String>,
1530    #[builder(setter(into, strip_option), default)]
1531    #[serde(default, skip_serializing_if = "Option::is_none")]
1532    #[serde(
1533        serialize_with = "validation::ser_uri_vec_opt",
1534        deserialize_with = "validation::deser_uri_vec_opt"
1535    )]
1536    pub urls: Option<Vec<String>>,
1537    /// A unique ID for the location, for reference.
1538    #[serde(
1539        serialize_with = "validation::ser_uuid",
1540        deserialize_with = "validation::deser_uuid"
1541    )]
1542    #[derivative(PartialEq = "ignore")]
1543    pub uuid: String,
1544}
1545
1546/// A postal address for the location.
1547#[derive(Debug, Clone, Serialize, Deserialize)]
1548#[serde(rename_all = "kebab-case")]
1549#[derive(Builder, Derivative)]
1550#[builder(setter(into, strip_option))]
1551#[derivative(PartialEq)]
1552#[serde(deny_unknown_fields)]
1553pub struct Address {
1554    #[builder(setter(into, strip_option), default)]
1555    #[serde(default, skip_serializing_if = "Option::is_none")]
1556    pub addr_lines: Option<Vec<String>>,
1557    /// City, town or geographical region for the mailing address.
1558    #[builder(setter(into, strip_option), default)]
1559    #[serde(default, skip_serializing_if = "Option::is_none")]
1560    pub city: Option<String>,
1561    /// The ISO 3166-1 alpha-2 country code for the mailing address.
1562    #[builder(setter(into, strip_option), default)]
1563    #[serde(default, skip_serializing_if = "Option::is_none")]
1564    pub country: Option<String>,
1565    /// Postal or ZIP code for mailing address.
1566    #[builder(setter(into, strip_option), default)]
1567    #[serde(default, skip_serializing_if = "Option::is_none")]
1568    pub postal_code: Option<String>,
1569    /// State, province or analogous geographical region for a mailing address.
1570    #[builder(setter(into, strip_option), default)]
1571    #[serde(default, skip_serializing_if = "Option::is_none")]
1572    pub state: Option<String>,
1573    /// Indicates the type of address.
1574    #[serde(rename = "type")]
1575    #[builder(setter(into, strip_option), default)]
1576    #[serde(default, skip_serializing_if = "Option::is_none")]
1577    #[serde(
1578        serialize_with = "validation::ser_token_opt",
1579        deserialize_with = "validation::deser_token_opt"
1580    )]
1581    pub address_type: Option<String>,
1582}
1583
1584/// A telephone service number as defined by ITU-T E.164.
1585#[derive(Debug, Clone, Serialize, Deserialize)]
1586#[derive(Builder, Derivative)]
1587#[builder(setter(into, strip_option))]
1588#[derivative(PartialEq)]
1589#[serde(deny_unknown_fields)]
1590pub struct TelephoneNumber {
1591    pub number: String,
1592    /// Indicates the type of phone number.
1593    #[serde(rename = "type")]
1594    #[builder(setter(into, strip_option), default)]
1595    #[serde(default, skip_serializing_if = "Option::is_none")]
1596    pub telephone_number_type: Option<String>,
1597}
1598
1599/// An organization or person, which may be associated with roles or other concepts within
1600/// the current or linked OSCAL document.
1601#[derive(Debug, Clone, Serialize, Deserialize)]
1602#[serde(rename_all = "kebab-case")]
1603#[derive(Builder, Derivative)]
1604#[builder(setter(into, strip_option))]
1605#[derivative(PartialEq)]
1606#[serde(deny_unknown_fields)]
1607pub struct Party {
1608    #[builder(setter(into, strip_option), default)]
1609    #[serde(default, skip_serializing_if = "Option::is_none")]
1610    pub addresses: Option<Vec<Address>>,
1611    #[builder(setter(into, strip_option), default)]
1612    #[serde(default, skip_serializing_if = "Option::is_none")]
1613    #[serde(
1614        serialize_with = "validation::ser_email_vec_opt",
1615        deserialize_with = "validation::deser_email_vec_opt"
1616    )]
1617    pub email_addresses: Option<Vec<String>>,
1618    #[builder(setter(into, strip_option), default)]
1619    #[serde(default, skip_serializing_if = "Option::is_none")]
1620    pub external_ids: Option<Vec<PartyExternalIdentifier>>,
1621    #[builder(setter(into, strip_option), default)]
1622    #[serde(default, skip_serializing_if = "Option::is_none")]
1623    pub links: Option<Vec<Link>>,
1624    #[builder(setter(into, strip_option), default)]
1625    #[serde(default, skip_serializing_if = "Option::is_none")]
1626    pub location_uuids: Option<Vec<String>>,
1627    #[builder(setter(into, strip_option), default)]
1628    #[serde(default, skip_serializing_if = "Option::is_none")]
1629    #[serde(
1630        serialize_with = "validation::ser_uuid_vec_opt",
1631        deserialize_with = "validation::deser_uuid_vec_opt"
1632    )]
1633    pub member_of_organizations: Option<Vec<String>>,
1634    /// The full name of the party. This is typically the legal name associated with the party.
1635    #[builder(setter(into, strip_option), default)]
1636    #[serde(default, skip_serializing_if = "Option::is_none")]
1637    pub name: Option<String>,
1638    #[builder(setter(into, strip_option), default)]
1639    #[serde(default, skip_serializing_if = "Option::is_none")]
1640    pub props: Option<Vec<Property>>,
1641    #[builder(setter(into, strip_option), default)]
1642    #[serde(default, skip_serializing_if = "Option::is_none")]
1643    #[serde(deserialize_with = "validation::deser_markup_opt")]
1644    pub remarks: Option<String>,
1645    /// A short common name, abbreviation, or acronym for the party.
1646    #[builder(setter(into, strip_option), default)]
1647    #[serde(default, skip_serializing_if = "Option::is_none")]
1648    pub short_name: Option<String>,
1649    #[builder(setter(into, strip_option), default)]
1650    #[serde(default, skip_serializing_if = "Option::is_none")]
1651    pub telephone_numbers: Option<Vec<TelephoneNumber>>,
1652    /// A category describing the kind of party the object describes.
1653    #[serde(rename = "type")]
1654    pub party_type: PartyType,
1655    /// A unique identifier for the party.
1656    #[serde(
1657        serialize_with = "validation::ser_uuid",
1658        deserialize_with = "validation::deser_uuid"
1659    )]
1660    #[derivative(PartialEq = "ignore")]
1661    pub uuid: String,
1662}
1663
1664/// An identifier for a person or organization using a designated scheme. e.g. an Open
1665/// Researcher and Contributor ID (ORCID).
1666#[derive(Debug, Clone, Serialize, Deserialize)]
1667#[derive(Builder, Derivative)]
1668#[builder(setter(into, strip_option))]
1669#[derivative(PartialEq)]
1670#[serde(deny_unknown_fields)]
1671pub struct PartyExternalIdentifier {
1672    pub id: String,
1673    /// Indicates the type of external identifier.
1674    #[serde(
1675        serialize_with = "validation::ser_uri",
1676        deserialize_with = "validation::deser_uri"
1677    )]
1678    pub scheme: String,
1679}
1680/// A category describing the kind of party the object describes.
1681///
1682/// A label that indicates the nature of a resource, as a data serialization or format.
1683///
1684/// A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9,
1685/// U+10, U+32 or [
1686/// ]+
1687///
1688/// In case where the href points to a back-matter/resource, this value will indicate the URI
1689/// fragment to append to any rlink associated with the resource. This value MUST be URI
1690/// encoded.
1691///
1692/// Indicates the value of the attribute, characteristic, or quality.
1693///
1694/// The common name of the protocol, which should be the appropriate "service name" from the
1695/// IANA Service Name and Transport Protocol Port Number Registry.
1696///
1697/// Describes a function performed for a given authorized privilege by this user class.
1698///
1699/// A short common name, abbreviation, or acronym for the user.
1700///
1701/// A single line of an address.
1702///
1703/// City, town or geographical region for the mailing address.
1704///
1705/// The ISO 3166-1 alpha-2 country code for the mailing address.
1706///
1707/// Postal or ZIP code for mailing address.
1708///
1709/// State, province or analogous geographical region for a mailing address.
1710///
1711/// The OSCAL model version the document was authored against and will conform to as valid.
1712///
1713/// The full name of the party. This is typically the legal name associated with the party.
1714///
1715/// A short common name, abbreviation, or acronym for the party.
1716///
1717/// Used to distinguish a specific revision of an OSCAL document from other previous and
1718/// future versions.
1719///
1720/// A short common name, abbreviation, or acronym for the role.
1721///
1722/// A category describing the purpose of the component.
1723///
1724/// The digest method by which a hash is derived.
1725///
1726/// Indicates the type of phone number.
1727#[derive(Debug, Clone, Serialize, Deserialize)]
1728#[serde(rename_all = "snake_case")]
1729#[non_exhaustive]
1730#[derive(EnumString, Derivative)]
1731#[derivative(PartialEq)]
1732pub enum PartyType {
1733    Organization,
1734    Person,
1735}
1736
1737/// An entry in a sequential list of revisions to the containing document, expected to be in
1738/// reverse chronological order (i.e. latest first).
1739#[derive(Debug, Clone, Serialize, Deserialize)]
1740#[serde(rename_all = "kebab-case")]
1741#[derive(Builder, Derivative)]
1742#[builder(setter(into, strip_option))]
1743#[derivative(PartialEq)]
1744#[serde(deny_unknown_fields)]
1745pub struct RevisionHistoryEntry {
1746    #[builder(setter(into, strip_option), default)]
1747    #[serde(default, skip_serializing_if = "Option::is_none")]
1748    #[serde(
1749        serialize_with = "validation::ser_dttz_opt",
1750        deserialize_with = "validation::deser_dttz_opt"
1751    )]
1752    pub last_modified: Option<String>,
1753    #[builder(setter(into, strip_option), default)]
1754    #[serde(default, skip_serializing_if = "Option::is_none")]
1755    pub links: Option<Vec<Link>>,
1756    #[builder(setter(into, strip_option), default)]
1757    #[serde(default, skip_serializing_if = "Option::is_none")]
1758    pub oscal_version: Option<String>,
1759    #[builder(setter(into, strip_option), default)]
1760    #[serde(default, skip_serializing_if = "Option::is_none")]
1761    pub props: Option<Vec<Property>>,
1762    #[builder(setter(into, strip_option), default)]
1763    #[serde(default, skip_serializing_if = "Option::is_none")]
1764    #[serde(
1765        serialize_with = "validation::ser_dttz_opt",
1766        deserialize_with = "validation::deser_dttz_opt"
1767    )]
1768    pub published: Option<String>,
1769    #[builder(setter(into, strip_option), default)]
1770    #[serde(default, skip_serializing_if = "Option::is_none")]
1771    #[serde(deserialize_with = "validation::deser_markup_opt")]
1772    pub remarks: Option<String>,
1773    /// A name given to the document revision, which may be used by a tool for display and
1774    /// navigation.
1775    #[builder(setter(into, strip_option), default)]
1776    #[serde(default, skip_serializing_if = "Option::is_none")]
1777    #[serde(deserialize_with = "validation::deser_markup_opt")]
1778    pub title: Option<String>,
1779    pub version: String,
1780}
1781
1782/// Defines a function, which might be assigned to a party in a specific situation.
1783#[derive(Debug, Clone, Serialize, Deserialize)]
1784#[serde(rename_all = "kebab-case")]
1785#[derive(Builder, Derivative)]
1786#[builder(setter(into, strip_option))]
1787#[derivative(PartialEq)]
1788#[serde(deny_unknown_fields)]
1789pub struct Role {
1790    /// A summary of the role's purpose and associated responsibilities.
1791    #[builder(setter(into, strip_option), default)]
1792    #[serde(default, skip_serializing_if = "Option::is_none")]
1793    #[serde(deserialize_with = "validation::deser_markup_opt")]
1794    pub description: Option<String>,
1795    /// A unique identifier for the role.
1796    #[serde(
1797        serialize_with = "validation::ser_token",
1798        deserialize_with = "validation::deser_token"
1799    )]
1800    pub id: String,
1801    #[builder(setter(into, strip_option), default)]
1802    #[serde(default, skip_serializing_if = "Option::is_none")]
1803    pub links: Option<Vec<Link>>,
1804    #[builder(setter(into, strip_option), default)]
1805    #[serde(default, skip_serializing_if = "Option::is_none")]
1806    pub props: Option<Vec<Property>>,
1807    #[builder(setter(into, strip_option), default)]
1808    #[serde(default, skip_serializing_if = "Option::is_none")]
1809    #[serde(deserialize_with = "validation::deser_markup_opt")]
1810    pub remarks: Option<String>,
1811    /// A short common name, abbreviation, or acronym for the role.
1812    #[builder(setter(into, strip_option), default)]
1813    #[serde(default, skip_serializing_if = "Option::is_none")]
1814    pub short_name: Option<String>,
1815    /// A name given to the role, which may be used by a tool for display and navigation.
1816    pub title: String,
1817}
1818
1819/// Represents a scheduled event or milestone, which may be associated with a series of
1820/// assessment actions.
1821#[derive(Debug, Clone, Serialize, Deserialize)]
1822#[serde(rename_all = "kebab-case")]
1823#[derive(Builder, Derivative)]
1824#[builder(setter(into, strip_option))]
1825#[derivative(PartialEq)]
1826#[serde(deny_unknown_fields)]
1827pub struct Task {
1828    #[builder(setter(into, strip_option), default)]
1829    #[serde(default, skip_serializing_if = "Option::is_none")]
1830    pub associated_activities: Option<Vec<AssociatedActivity>>,
1831    #[builder(setter(into, strip_option), default)]
1832    #[serde(default, skip_serializing_if = "Option::is_none")]
1833    pub dependencies: Option<Vec<TaskDependency>>,
1834    /// A human-readable description of this task.
1835    #[builder(setter(into, strip_option), default)]
1836    #[serde(default, skip_serializing_if = "Option::is_none")]
1837    #[serde(deserialize_with = "validation::deser_markup_opt")]
1838    pub description: Option<String>,
1839    #[builder(setter(into, strip_option), default)]
1840    #[serde(default, skip_serializing_if = "Option::is_none")]
1841    pub links: Option<Vec<Link>>,
1842    #[builder(setter(into, strip_option), default)]
1843    #[serde(default, skip_serializing_if = "Option::is_none")]
1844    pub props: Option<Vec<Property>>,
1845    #[builder(setter(into, strip_option), default)]
1846    #[serde(default, skip_serializing_if = "Option::is_none")]
1847    #[serde(deserialize_with = "validation::deser_markup_opt")]
1848    pub remarks: Option<String>,
1849    #[builder(setter(into, strip_option), default)]
1850    #[serde(default, skip_serializing_if = "Option::is_none")]
1851    pub responsible_roles: Option<Vec<ResponsibleRole>>,
1852    #[builder(setter(into, strip_option), default)]
1853    #[serde(default, skip_serializing_if = "Option::is_none")]
1854    pub subjects: Option<Vec<SubjectOfAssessment>>,
1855    #[builder(setter(into, strip_option), default)]
1856    #[serde(default, skip_serializing_if = "Option::is_none")]
1857    pub tasks: Option<Vec<Task>>,
1858    /// The timing under which the task is intended to occur.
1859    #[builder(setter(into, strip_option), default)]
1860    #[serde(default, skip_serializing_if = "Option::is_none")]
1861    pub timing: Option<EventTiming>,
1862    /// The title for this task.
1863    #[serde(deserialize_with = "validation::deser_markup")]
1864    pub title: String,
1865    /// The type of task.
1866    #[serde(rename = "type")]
1867    #[serde(
1868        serialize_with = "validation::ser_token",
1869        deserialize_with = "validation::deser_token"
1870    )]
1871    pub task_type: String,
1872    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
1873    /// to reference this task elsewhere in this or other OSCAL instances. The locally defined
1874    /// UUID of the task can be used to reference the data item locally or globally (e.g., in an
1875    /// imported OSCAL instance). This UUID should be assigned per-subject, which means it should
1876    /// be consistently used to identify the same subject across revisions of the document.
1877    #[serde(
1878        serialize_with = "validation::ser_uuid",
1879        deserialize_with = "validation::deser_uuid"
1880    )]
1881    #[derivative(PartialEq = "ignore")]
1882    pub uuid: String,
1883}
1884
1885/// Identifies an individual activity to be performed as part of a task.
1886#[derive(Debug, Clone, Serialize, Deserialize)]
1887#[serde(rename_all = "kebab-case")]
1888#[derive(Builder, Derivative)]
1889#[builder(setter(into, strip_option))]
1890#[derivative(PartialEq)]
1891#[serde(deny_unknown_fields)]
1892pub struct AssociatedActivity {
1893    /// A machine-oriented identifier reference to an activity defined in the list of activities.
1894    #[derivative(PartialEq = "ignore")]
1895    #[serde(
1896        serialize_with = "validation::ser_uuid",
1897        deserialize_with = "validation::deser_uuid"
1898    )]
1899    pub activity_uuid: String,
1900    #[builder(setter(into, strip_option), default)]
1901    #[serde(default, skip_serializing_if = "Option::is_none")]
1902    pub links: Option<Vec<Link>>,
1903    #[builder(setter(into, strip_option), default)]
1904    #[serde(default, skip_serializing_if = "Option::is_none")]
1905    pub props: Option<Vec<Property>>,
1906    #[builder(setter(into, strip_option), default)]
1907    #[serde(default, skip_serializing_if = "Option::is_none")]
1908    #[serde(deserialize_with = "validation::deser_markup_opt")]
1909    pub remarks: Option<String>,
1910    #[builder(setter(into, strip_option), default)]
1911    #[serde(default, skip_serializing_if = "Option::is_none")]
1912    pub responsible_roles: Option<Vec<ResponsibleRole>>,
1913    pub subjects: Vec<SubjectOfAssessment>,
1914}
1915
1916/// Used to indicate that a task is dependent on another task.
1917#[derive(Debug, Clone, Serialize, Deserialize)]
1918#[serde(rename_all = "kebab-case")]
1919#[derive(Builder, Derivative)]
1920#[builder(setter(into, strip_option))]
1921#[derivative(PartialEq)]
1922#[serde(deny_unknown_fields)]
1923pub struct TaskDependency {
1924    #[builder(setter(into, strip_option), default)]
1925    #[serde(default, skip_serializing_if = "Option::is_none")]
1926    #[serde(deserialize_with = "validation::deser_markup_opt")]
1927    pub remarks: Option<String>,
1928    /// A machine-oriented identifier reference to a unique task.
1929    #[derivative(PartialEq = "ignore")]
1930    #[serde(
1931        serialize_with = "validation::ser_uuid",
1932        deserialize_with = "validation::deser_uuid"
1933    )]
1934    pub task_uuid: String,
1935}
1936
1937/// The timing under which the task is intended to occur.
1938#[derive(Debug, Clone, Serialize, Deserialize)]
1939#[serde(rename_all = "kebab-case")]
1940#[derive(Builder, Derivative)]
1941#[builder(setter(into, strip_option))]
1942#[derivative(PartialEq)]
1943#[serde(deny_unknown_fields)]
1944pub struct EventTiming {
1945    /// The task is intended to occur at the specified frequency.
1946    #[builder(setter(into, strip_option), default)]
1947    #[serde(default, skip_serializing_if = "Option::is_none")]
1948    pub at_frequency: Option<FrequencyCondition>,
1949    /// The task is intended to occur on the specified date.
1950    #[builder(setter(into, strip_option), default)]
1951    #[serde(default, skip_serializing_if = "Option::is_none")]
1952    pub on_date: Option<OnDateCondition>,
1953    /// The task is intended to occur within the specified date range.
1954    #[builder(setter(into, strip_option), default)]
1955    #[serde(default, skip_serializing_if = "Option::is_none")]
1956    pub within_date_range: Option<OnDateRangeCondition>,
1957}
1958
1959/// The task is intended to occur at the specified frequency.
1960#[derive(Debug, Clone, Serialize, Deserialize)]
1961#[derive(Builder, Derivative)]
1962#[builder(setter(into, strip_option))]
1963#[derivative(PartialEq)]
1964#[serde(deny_unknown_fields)]
1965pub struct FrequencyCondition {
1966    /// The task must occur after the specified period has elapsed.
1967    #[serde(
1968        serialize_with = "validation::ser_positive_int",
1969        deserialize_with = "validation::deser_positive_int"
1970    )]
1971    pub period: i64,
1972    /// The unit of time for the period.
1973    pub unit: TimeUnit,
1974}
1975/// The unit of time for the period.
1976///
1977/// A label that indicates the nature of a resource, as a data serialization or format.
1978///
1979/// A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9,
1980/// U+10, U+32 or [
1981/// ]+
1982///
1983/// In case where the href points to a back-matter/resource, this value will indicate the URI
1984/// fragment to append to any rlink associated with the resource. This value MUST be URI
1985/// encoded.
1986///
1987/// Indicates the value of the attribute, characteristic, or quality.
1988///
1989/// The common name of the protocol, which should be the appropriate "service name" from the
1990/// IANA Service Name and Transport Protocol Port Number Registry.
1991///
1992/// Describes a function performed for a given authorized privilege by this user class.
1993///
1994/// A short common name, abbreviation, or acronym for the user.
1995///
1996/// A single line of an address.
1997///
1998/// City, town or geographical region for the mailing address.
1999///
2000/// The ISO 3166-1 alpha-2 country code for the mailing address.
2001///
2002/// Postal or ZIP code for mailing address.
2003///
2004/// State, province or analogous geographical region for a mailing address.
2005///
2006/// The OSCAL model version the document was authored against and will conform to as valid.
2007///
2008/// The full name of the party. This is typically the legal name associated with the party.
2009///
2010/// A short common name, abbreviation, or acronym for the party.
2011///
2012/// Used to distinguish a specific revision of an OSCAL document from other previous and
2013/// future versions.
2014///
2015/// A short common name, abbreviation, or acronym for the role.
2016///
2017/// A category describing the purpose of the component.
2018///
2019/// The digest method by which a hash is derived.
2020///
2021/// Indicates the type of phone number.
2022#[derive(Debug, Clone, Serialize, Deserialize)]
2023#[serde(rename_all = "snake_case")]
2024#[non_exhaustive]
2025#[derive(EnumString, Derivative)]
2026#[derivative(PartialEq)]
2027pub enum TimeUnit {
2028    Days,
2029    Hours,
2030    Minutes,
2031    Months,
2032    Seconds,
2033    Years,
2034}
2035
2036/// The task is intended to occur on the specified date.
2037#[derive(Debug, Clone, Serialize, Deserialize)]
2038#[derive(Builder, Derivative)]
2039#[builder(setter(into, strip_option))]
2040#[derivative(PartialEq)]
2041#[serde(deny_unknown_fields)]
2042pub struct OnDateCondition {
2043    /// The task must occur on the specified date.
2044    pub date: String,
2045}
2046
2047/// The task is intended to occur within the specified date range.
2048#[derive(Debug, Clone, Serialize, Deserialize)]
2049#[derive(Builder, Derivative)]
2050#[builder(setter(into, strip_option))]
2051#[derivative(PartialEq)]
2052#[serde(deny_unknown_fields)]
2053pub struct OnDateRangeCondition {
2054    /// The task must occur on or before the specified date.
2055    pub end: String,
2056    /// The task must occur on or after the specified date.
2057    pub start: String,
2058}
2059
2060/// Used to define various terms and conditions under which an assessment, described by the
2061/// plan, can be performed. Each child part defines a different type of term or condition.
2062#[derive(Debug, Clone, Serialize, Deserialize)]
2063#[derive(Builder, Derivative)]
2064#[builder(setter(into, strip_option))]
2065#[derivative(PartialEq)]
2066#[serde(deny_unknown_fields)]
2067pub struct AssessmentPlanTermsAndConditions {
2068    #[builder(setter(into, strip_option), default)]
2069    #[serde(default, skip_serializing_if = "Option::is_none")]
2070    pub parts: Option<Vec<AssessmentPart>>,
2071}
2072
2073/// A partition of an assessment plan or results or a child of another part.
2074#[derive(Debug, Clone, Serialize, Deserialize)]
2075#[derive(Builder, Derivative)]
2076#[builder(setter(into, strip_option))]
2077#[derivative(PartialEq)]
2078#[serde(deny_unknown_fields)]
2079pub struct AssessmentPart {
2080    /// A textual label that provides a sub-type or characterization of the part's name. This can
2081    /// be used to further distinguish or discriminate between the semantics of multiple parts of
2082    /// the same control with the same name and ns.
2083    #[builder(setter(into, strip_option), default)]
2084    #[serde(default, skip_serializing_if = "Option::is_none")]
2085    #[serde(
2086        serialize_with = "validation::ser_token_opt",
2087        deserialize_with = "validation::deser_token_opt"
2088    )]
2089    pub class: Option<String>,
2090    #[builder(setter(into, strip_option), default)]
2091    #[serde(default, skip_serializing_if = "Option::is_none")]
2092    pub links: Option<Vec<Link>>,
2093    /// A textual label that uniquely identifies the part's semantic type.
2094    #[serde(
2095        serialize_with = "validation::ser_token",
2096        deserialize_with = "validation::deser_token"
2097    )]
2098    pub name: String,
2099    /// A namespace qualifying the part's name. This allows different organizations to associate
2100    /// distinct semantics with the same name.
2101    #[builder(setter(into, strip_option), default)]
2102    #[serde(default, skip_serializing_if = "Option::is_none")]
2103    #[serde(
2104        serialize_with = "validation::ser_uri_opt",
2105        deserialize_with = "validation::deser_uri_opt"
2106    )]
2107    pub ns: Option<String>,
2108    #[builder(setter(into, strip_option), default)]
2109    #[serde(default, skip_serializing_if = "Option::is_none")]
2110    pub parts: Option<Vec<AssessmentPart>>,
2111    #[builder(setter(into, strip_option), default)]
2112    #[serde(default, skip_serializing_if = "Option::is_none")]
2113    pub props: Option<Vec<Property>>,
2114    /// Permits multiple paragraphs, lists, tables etc.
2115    #[builder(setter(into, strip_option), default)]
2116    #[serde(default, skip_serializing_if = "Option::is_none")]
2117    pub prose: Option<String>,
2118    /// A name given to the part, which may be used by a tool for display and navigation.
2119    #[builder(setter(into, strip_option), default)]
2120    #[serde(default, skip_serializing_if = "Option::is_none")]
2121    #[serde(deserialize_with = "validation::deser_markup_opt")]
2122    pub title: Option<String>,
2123    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
2124    /// to reference this part elsewhere in this or other OSCAL instances. The locally defined
2125    /// UUID of the part can be used to reference the data item locally or globally (e.g., in an
2126    /// ported OSCAL instance). This UUID should be assigned per-subject, which means it should
2127    /// be consistently used to identify the same subject across revisions of the document.
2128    #[builder(setter(into, strip_option), default)]
2129    #[serde(default, skip_serializing_if = "Option::is_none")]
2130    #[serde(
2131        serialize_with = "validation::ser_uuid_opt",
2132        deserialize_with = "validation::deser_uuid_opt"
2133    )]
2134    #[derivative(PartialEq = "ignore")]
2135    pub uuid: Option<String>,
2136}